VSTR (scripts) explanation
4 posters
Page 1 of 1
VSTR (scripts) explanation
Here, something useful from me:
I want to explain the thing that is "vstr" or (I think they are called) vstrings or "Binding multiple commands on a single (or multiple) button(s)"
Here's my (let's call them scripts) script for hiding the 2D stuff from the screen (cg_draw2d 0) . That includes text, the HUD but not the crosshair.
bind f11 "vstr 2Dstring"
set 2dstring "vstr 2D0"
set 2D0 "cg_draw2d 0; set 2Dstring vstr 2D1"
set 2D1 "cg_draw2d 1; set 2Dstring vstr 2D0"
So let's take this script apart:
I have colour coded stuff to make it easier. Or harder...
The first line assigns the command 2Dstring to be executed when f11 is pressed.
bind f11 "vstr 2Dstring"
The second line assigns a definition to 2Dstring. At the moment 2Dstring equals 2D0. So when f11 is pressed, the script goes on to find the actions assigned to 2D0 and run them
set 2Dstring "vstr 2D0"
The third and fourth lines assign actions to the 2D0 and 2D1 and change the meaning of 2Dstring.
For example: here, for this script, 2D0 means "turn off the 2 dimensional textures and assign 2D1 to 2Dstring".
And the next time you press f11, it will execute "2Dstring" which is now changed to 2D1
set 2D0 "cg_draw2d 0; set 2Dstring vstr 2D1"
set 2D1 "cg_draw2d 1; set 2Dstring vstr 2D0"
The script will run in a loop, alternatively turning the 2D textures off and on.
If i wanted to remove the crosshair, i would add cg_CrosshairAlpha 0 and cg_CrosshairAlphaAlt 0 to the script. That would make the crosshair fully transparent.
Such a script would look like this:
bind f11 "vstr 2Dstring"
set 2dstring "vstr 2D0"
set 2D0 "cg_draw2d 0; cg_crosshairalpha 0; cg_crosshairalphaalt 0; set 2Dstring vstr 2D1"
set 2D1 "cg_draw2d 1; cg_crosshairalpha 1; cg_crosshairalphaalt 1; set 2Dstring vstr 2D0"
You can assign more buttons to execute more actions. Like my volume script for instance has "volume up" and "volume down".
Now i know i suck at explaining stuff to people. I couldn't teach anyone to pour water out of a bucket with the instructions printed to the bottom.
So feel free to ask a lot of questions :3
I want to explain the thing that is "vstr" or (I think they are called) vstrings or "Binding multiple commands on a single (or multiple) button(s)"
Here's my (let's call them scripts) script for hiding the 2D stuff from the screen (cg_draw2d 0) . That includes text, the HUD but not the crosshair.
bind f11 "vstr 2Dstring"
set 2dstring "vstr 2D0"
set 2D0 "cg_draw2d 0; set 2Dstring vstr 2D1"
set 2D1 "cg_draw2d 1; set 2Dstring vstr 2D0"
So let's take this script apart:
I have colour coded stuff to make it easier. Or harder...
The first line assigns the command 2Dstring to be executed when f11 is pressed.
bind f11 "vstr 2Dstring"
The second line assigns a definition to 2Dstring. At the moment 2Dstring equals 2D0. So when f11 is pressed, the script goes on to find the actions assigned to 2D0 and run them
set 2Dstring "vstr 2D0"
The third and fourth lines assign actions to the 2D0 and 2D1 and change the meaning of 2Dstring.
For example: here, for this script, 2D0 means "turn off the 2 dimensional textures and assign 2D1 to 2Dstring".
And the next time you press f11, it will execute "2Dstring" which is now changed to 2D1
set 2D0 "cg_draw2d 0; set 2Dstring vstr 2D1"
set 2D1 "cg_draw2d 1; set 2Dstring vstr 2D0"
The script will run in a loop, alternatively turning the 2D textures off and on.
If i wanted to remove the crosshair, i would add cg_CrosshairAlpha 0 and cg_CrosshairAlphaAlt 0 to the script. That would make the crosshair fully transparent.
Such a script would look like this:
bind f11 "vstr 2Dstring"
set 2dstring "vstr 2D0"
set 2D0 "cg_draw2d 0; cg_crosshairalpha 0; cg_crosshairalphaalt 0; set 2Dstring vstr 2D1"
set 2D1 "cg_draw2d 1; cg_crosshairalpha 1; cg_crosshairalphaalt 1; set 2Dstring vstr 2D0"
You can assign more buttons to execute more actions. Like my volume script for instance has "volume up" and "volume down".
Now i know i suck at explaining stuff to people. I couldn't teach anyone to pour water out of a bucket with the instructions printed to the bottom.
So feel free to ask a lot of questions :3
{GTB} URmS- Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12
Re: VSTR (scripts) explanation
0.0 didnt understood a thing there.... but why would you want to disable the 2d (shapes?text?info?)
{GTB} Energy- Number of posts : 295
Age : 28
Location : Crewe Cheshire
Registration date : 2010-03-31
Re: VSTR (scripts) explanation
well i think you explained that well urms. i understood "makes a change"
but the only thing missing is like energy says why would we do this, for what
reason
buntski
but the only thing missing is like energy says why would we do this, for what
reason
buntski
{GTB} buntski- Number of posts : 128
Age : 63
Location : kings lynn' norfolk, england.
Registration date : 2009-01-05
Re: VSTR (scripts) explanation
you can use vstr for any toggle function, for example settings, configs, names, binds i donno what all
{GTB} V-ReX- Number of posts : 559
Age : 31
Location : Kirchroa, Limburg, The Netherlands.
Registration date : 2009-01-13
Re: VSTR (scripts) explanation
Toggleconsole is already a "toggle" bind.
You can use it to lower or increase the volume, brightness, switch (with one button) between !djon or !djon, and a lot more...
You can use it to lower or increase the volume, brightness, switch (with one button) between !djon or !djon, and a lot more...
{GTB} URmS- Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12
Re: VSTR (scripts) explanation
so thats same as just /bind ?
{GTB} Energy- Number of posts : 295
Age : 28
Location : Crewe Cheshire
Registration date : 2010-03-31
Re: VSTR (scripts) explanation
No. With /bind, you can only assign one task to one button.
So for a volume control, you need to have this:
bind 0 s_volume 0.0
bind 1 s_volume 0.1
bind 2 s_volume 0.2
bind 3 s_volume 0.3
bind 4 s_volume 0.4
bind 5 s_volume 0.5
bind 6 s_volume 0.6
bind 7 s_volume 0.7
bind 8 s_volume 0.8
bind 9 s_volume 0.9
And then you'll have your whole keyboard full of binds that could be done with a VSTR and a single button.
I like my volume controls separate because with my VSTR, i can set the volume "in-game" without messing with the Windows' volume.
So for a volume control, you need to have this:
bind 0 s_volume 0.0
bind 1 s_volume 0.1
bind 2 s_volume 0.2
bind 3 s_volume 0.3
bind 4 s_volume 0.4
bind 5 s_volume 0.5
bind 6 s_volume 0.6
bind 7 s_volume 0.7
bind 8 s_volume 0.8
bind 9 s_volume 0.9
And then you'll have your whole keyboard full of binds that could be done with a VSTR and a single button.
I like my volume controls separate because with my VSTR, i can set the volume "in-game" without messing with the Windows' volume.
{GTB} URmS- Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12
Re: VSTR (scripts) explanation
cant you just do like /bind 0 s_volume "0.0""0.1""0.2""0.3""0.4".... cause you can do that kinda binds in cod 4 easily would it not wor in et?
{GTB} Energy- Number of posts : 295
Age : 28
Location : Crewe Cheshire
Registration date : 2010-03-31
Re: VSTR (scripts) explanation
You can do
bind 1 "s_volume 0.1; s_volume 0.2; s_volume 0.3; s_volume 0.4; s_volume 0.5"
and when you hit "1", the game will run through the bind setting the volume at 0.1, then 0.2, 0.3, 0.4 and when the bind ends at 0.5, ET will go ahead and leave the volume at 0.5
So doing
bind 1 "s_volume 0.1; s_volume 0.2; s_volume 0.3; s_volume 0.4; s_volume 0.5"
is the same as doing
bind 1 "s_volume 0.5"
bind 1 "s_volume 0.1; s_volume 0.2; s_volume 0.3; s_volume 0.4; s_volume 0.5"
and when you hit "1", the game will run through the bind setting the volume at 0.1, then 0.2, 0.3, 0.4 and when the bind ends at 0.5, ET will go ahead and leave the volume at 0.5
So doing
bind 1 "s_volume 0.1; s_volume 0.2; s_volume 0.3; s_volume 0.4; s_volume 0.5"
is the same as doing
bind 1 "s_volume 0.5"
{GTB} URmS- Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Mon May 01, 2023 1:41 am by {GTB} Senorankka
» Good ol' days
Sat Oct 21, 2017 9:31 pm by {GTB} Granny
» Just for fun
Sat Jul 25, 2015 7:26 pm by {GTB} Bloodyfin
» {GTB} FailWizArd
Fri Aug 02, 2013 4:19 pm by {GTB} Granny
» Hackusation!!!
Fri Aug 02, 2013 4:17 pm by {GTB} Granny
» Whats your internet speed
Thu May 02, 2013 12:07 pm by rathi91
» crimbo
Wed Dec 12, 2012 6:12 pm by {GTB} buntski
» O my terribly god,
Wed Aug 01, 2012 9:22 am by {GTB} Nodrog
» Power out - Official Goodbye :]
Fri Jul 13, 2012 11:47 am by {GTB} birra