Veni, Vidi, Vici | behave please!
You haven't logged in yet. No account yet?, then register!
When you're logged in, your able to see everything.
Veni, Vidi, Vici | behave please!
You haven't logged in yet. No account yet?, then register!
When you're logged in, your able to see everything.
Veni, Vidi, Vici | behave please!
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomepageHomeSearchLatest imagesLearning simple scripts Team10RegisterLog in

We are recruiting!, JOIN US NOW!


 

 Learning simple scripts

Go down 
3 posters
AuthorMessage
Ghostcarrot
Sergeant
Sergeant



Posts : 58
Forum Activity : 3954
Reputation : 0

Learning simple scripts Empty
PostSubject: Learning simple scripts   Learning simple scripts EmptyFri Jan 03, 2014 4:50 am

Recreating the topic i had on the good old forums in our past since i'm bored.

This entire post is focused on 1 command that allows us to make these little "scripts". the "vstr" cvar allows us to create shortcuts.
"vstr: Identifies what follows it as a variable string, used for scripting."
The amount of different things you can do with this command are huge (you can create a script that is able to do trickjumps for example) and is a fun thing to mess around with.

Vstr can also be used as +vstr making into a toggle which can be used to make a script that allows us to shoot and sprint with the press of 1 button.


Simple use of the +vstr command.

Spoiler:

First line: we bind a key to execute our +vstr cmd, and tell it the names of the commands we want it to run. Do not put a semicolon inbetween the first and second command name, separate them with a space instead.
Second line: we tell the game what to do as long as the button is pressed
Last line: we tell the game what to do if the button is released

So as mentioned before, the + infront of the vstr makes it into a toggle meaning when we press and hold the button (mouse1 in this case) the game will "load" the shootON command we made. Resulting in a sprint while shooting. Letting go of the button will stop the shooting and sprinting.

Now, onto vstr without our +. This script here is an example of how to use it to toggle between options, changing our pmove_fixed to 1 or 0. You can choose whatever you want to define the vstr command, you don't need to use pmove1 if you're making a pmove toggle script, you can name it ilovebigpencils if you want...

Sentences in red are added to make it easier to explain so don't copy those if you wish to use this.
Spoiler:

Note: Always jump back to the first vstr command so you can continuously toggle between the 2 options.


Another thing you can do is have 2 buttons to choose an option and then select it.
Next example is a name changer.

Spoiler:
Note: since this is a toggle remember to change the switch key back to the first option.

Learning the vstr command is all about messing around and testing things, trial and error. You should be able to look at these scripts and teach yourself the rest of scripting. If something is unclear (very certain it is since i'm rushing this... i need to pee badly) just post and i'll try to clear it up.
Back to top Go down
Kankeli<3
Captain
Captain
Kankeli<3


Posts : 216
Forum Activity : 4075
Reputation : 0
Age : 26
Country : Finland

Learning simple scripts Empty
PostSubject: Re: Learning simple scripts   Learning simple scripts EmptyFri Jan 03, 2014 4:55 am

GJ !Smile
Back to top Go down
.RommeL/CFG / pro.headoff
Corporal
Corporal
.RommeL/CFG / pro.headoff


Posts : 37
Forum Activity : 3896
Reputation : 0
Age : 32
Country : PL

Learning simple scripts Empty
PostSubject: Re: Learning simple scripts   Learning simple scripts EmptySun Jan 05, 2014 4:34 am

Scripts r easy to learn tho. Look at scripts in my cfg and u will understand them easly.

GL
Back to top Go down
Sponsored content





Learning simple scripts Empty
PostSubject: Re: Learning simple scripts   Learning simple scripts Empty

Back to top Go down
 
Learning simple scripts
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Veni, Vidi, Vici | behave please! :: General board :: Tutorials-
Jump to: