The {GTB} Clan
Would you like to react to this message? Create an account in a few clicks or log in to continue.
{GTB} NQ 1.2.3
Poll

Do you prefer 8 bots or 12 bots?

VSTR (scripts) explanation Vote_lcap57%VSTR (scripts) explanation Vote_rcap 57% [ 20 ]
VSTR (scripts) explanation Vote_lcap20%VSTR (scripts) explanation Vote_rcap 20% [ 7 ]
VSTR (scripts) explanation Vote_lcap23%VSTR (scripts) explanation Vote_rcap 23% [ 8 ]

Total Votes : 35

Gallery


VSTR (scripts) explanation Empty
Latest topics
» Nostalgia Dive
VSTR (scripts) explanation EmptyMon May 01, 2023 1:41 am by {GTB} Senorankka

» Good ol' days
VSTR (scripts) explanation EmptySat Oct 21, 2017 9:31 pm by {GTB} Granny

» Just for fun
VSTR (scripts) explanation EmptySat Jul 25, 2015 7:26 pm by {GTB} Bloodyfin

» {GTB} FailWizArd
VSTR (scripts) explanation EmptyFri Aug 02, 2013 4:19 pm by {GTB} Granny

» Hackusation!!!
VSTR (scripts) explanation EmptyFri Aug 02, 2013 4:17 pm by {GTB} Granny

» Whats your internet speed
VSTR (scripts) explanation EmptyThu May 02, 2013 12:07 pm by rathi91

» crimbo
VSTR (scripts) explanation EmptyWed Dec 12, 2012 6:12 pm by {GTB} buntski

» O my terribly god,
VSTR (scripts) explanation EmptyWed Aug 01, 2012 9:22 am by {GTB} Nodrog

» Power out - Official Goodbye :]
VSTR (scripts) explanation EmptyFri Jul 13, 2012 11:47 am by {GTB} birra

Search
 
 

Display results as :
 


Rechercher Advanced Search


VSTR (scripts) explanation

4 posters

Go down

VSTR (scripts) explanation Empty VSTR (scripts) explanation

Post  {GTB} URmS Tue Jun 21, 2011 11:11 pm

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... Rolling Eyes

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
{GTB} URmS

Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} Energy Wed Jun 22, 2011 9:30 am

0.0 didnt understood a thing there.... but why would you want to disable the 2d (shapes?text?info?)
{GTB} Energy
{GTB} Energy

Number of posts : 295
Age : 28
Location : Crewe Cheshire
Registration date : 2010-03-31

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} buntski Wed Jun 22, 2011 5:05 pm

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 VSTR (scripts) explanation 425337 VSTR (scripts) explanation 425337 VSTR (scripts) explanation 425337
{GTB} buntski
{GTB} buntski

Number of posts : 128
Age : 63
Location : kings lynn' norfolk, england.
Registration date : 2009-01-05

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} V-ReX Thu Jun 23, 2011 1:31 am

you can use vstr for any toggle function, for example settings, configs, names, binds i donno what all
{GTB} V-ReX
{GTB} V-ReX

Number of posts : 559
Age : 31
Location : Kirchroa, Limburg, The Netherlands.
Registration date : 2009-01-13

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} URmS Sat Jun 25, 2011 7:40 pm

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...
{GTB} URmS
{GTB} URmS

Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} Energy Sun Jun 26, 2011 11:59 am

so thats same as just /bind ?
{GTB} Energy
{GTB} Energy

Number of posts : 295
Age : 28
Location : Crewe Cheshire
Registration date : 2010-03-31

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} URmS Sun Jul 03, 2011 4:01 pm

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.
Cool

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
{GTB} URmS

Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} Energy Sun Jul 03, 2011 4:47 pm

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
{GTB} Energy

Number of posts : 295
Age : 28
Location : Crewe Cheshire
Registration date : 2010-03-31

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  {GTB} URmS Sun Jul 03, 2011 5:28 pm

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"
Rolling Eyes
{GTB} URmS
{GTB} URmS

Number of posts : 1506
Age : 32
Location : Saku, Estonia
Registration date : 2008-07-12

Back to top Go down

VSTR (scripts) explanation Empty Re: VSTR (scripts) explanation

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum