Kay, I'm startin a topic to show people who are interested in scripting how to script. First you have to know what a script is, if you dont already know.
Script: A script is a set of commands written in the notepad accessory and saved to .cfg. It tells the console what to do, what commands to put in. There are chat scripts, tele scripts, and saber scripts. There might be more, but those are the ones I am most familiar with.Anyway, we want to get to the real stuff.
First, you have to decide what you want in your script. Say you want a script that cycles through things that say yes.
1st thing's first, you need a bind to cycle through the says. Say you wanted G. It would go like this.
bind G "vstr MYES"
Notice how i put Quotation marks in there. and for those who havent scripted before, vstr is a command that goes to something else. So basically, when you hit G, it will vstr MYES. MYES is the whole cycle, pretty much. Anyway, back to this.
set MYES "vstr Y01"
Now, Y01 is one of the says in the script. There can be as many Y's as you want, and they can go higher than 9, if youre worred about that. Now, we're going to set Y01 to vstr the next one in the cycle, Y02, and tell it to say something through the semicolon (;) Let's say you wanted to say Yes.
seta Y01 "set MYES vstr Y02; say Yes.
Now, as I mentioned before, vstr is going to reach out to something. You're basically setting MYES (the whole cycle) to connect to the next one, Y02.Now, before we go on to the cycle, I need to show you how to comment on things, say, if you were writing a script for someone else.
//(Insert comment here)
This will in no way hurt or mess up the script. This is just a comment to whoever's going to be writing and saving the script. If you'd like an example, look on the next line.
//This is your key to assign to the say commands:
bind G "vstr MYES"
Kay. you can add comments throughout all your script. Now, back to telling you how to write a script.
Now, lets show you how to cycle back through to the first say.
seta Y02 "set MYES vstr Y01; say Yeah."
as you can see, it vstr's back to Y01 so it loops. DO NOT FORGET THIS, THIS IS THE MOST IMPORTANT PART Kay. got that out. anyway, let's show you how to add something else to the script.
seta Y02 "set MYES vstr Y03; say Yeah."
See how the vstr changed so it cycles to another say? You can add things all the way throughout your script. You use the same method to make it cycle back to the 1st one again.
seta Y03 "set MYES vstr Y01; say Yesh."
Now, I'm going to give you what a whole cycle looks like.
//These are you keys to assign to the say commands:
bind G "vstr MYES"
//These are the set commands to vstr the say commands:
set MYES "vstr Y01"
//These are the say commands:
seta Y01 "set MYES vstr Y02; say Yes."
seta Y02 "set MYES vstr Y03; say Yeah."
seta Y03 "set MYES vstr Y04; say Mhm."
seta Y04 "set MYES vstr Y05; say Yesh."
seta Y05 "set MYES vstr Y06; say Yup yup."
seta Y06 "set MYES vstr Y01; say Yep."
These are say commands from my Winscripts, except Y05 (Forgot what it was lol) Anyway, here are some handy helpful hints incase you have any questions.
-'MYES' can be anything, MHI, MNO, MLOL, etc.
-'MYES' doesnt have to have an M infront of it I don't think, and the M can be anything in a different cycle. You can't change the 'MYES' in anyway throughout the script, or it wont work.
-You can add something to say in the script when you /exec it in the console, just put it in the first line of the script. Example:
Say "Executing Delev's chat script."
//These are your keys to assign to the say commands:
bind g "vstr MYES"
-To save your script, it needs to be a config. When you're done writing your script in the notepad, X it out and it will say "The text in the untitled file has changed. Do you wish to save the changes?"
Say yes and when it comes up to where you want to save it, save it as .cfg
and you'll be able to move it to the japlus folder in your gamedata directory (C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\Gamedata)
-To access your script to change it or edit it, Left click it twice and it will come up. Also, to rename your script so its not blank, right click it and click "Rename"(most of you know that, I just needed to say that Incase some of you didn't.)
-To have the script, do /exec (your config's name) in the console.
Tele script tutorial coming soon.
Script: A script is a set of commands written in the notepad accessory and saved to .cfg. It tells the console what to do, what commands to put in. There are chat scripts, tele scripts, and saber scripts. There might be more, but those are the ones I am most familiar with.Anyway, we want to get to the real stuff.
First, you have to decide what you want in your script. Say you want a script that cycles through things that say yes.
1st thing's first, you need a bind to cycle through the says. Say you wanted G. It would go like this.
bind G "vstr MYES"
Notice how i put Quotation marks in there. and for those who havent scripted before, vstr is a command that goes to something else. So basically, when you hit G, it will vstr MYES. MYES is the whole cycle, pretty much. Anyway, back to this.
set MYES "vstr Y01"
Now, Y01 is one of the says in the script. There can be as many Y's as you want, and they can go higher than 9, if youre worred about that. Now, we're going to set Y01 to vstr the next one in the cycle, Y02, and tell it to say something through the semicolon (;) Let's say you wanted to say Yes.
seta Y01 "set MYES vstr Y02; say Yes.
Now, as I mentioned before, vstr is going to reach out to something. You're basically setting MYES (the whole cycle) to connect to the next one, Y02.Now, before we go on to the cycle, I need to show you how to comment on things, say, if you were writing a script for someone else.
//(Insert comment here)
This will in no way hurt or mess up the script. This is just a comment to whoever's going to be writing and saving the script. If you'd like an example, look on the next line.
//This is your key to assign to the say commands:
bind G "vstr MYES"
Kay. you can add comments throughout all your script. Now, back to telling you how to write a script.
Now, lets show you how to cycle back through to the first say.
seta Y02 "set MYES vstr Y01; say Yeah."
as you can see, it vstr's back to Y01 so it loops. DO NOT FORGET THIS, THIS IS THE MOST IMPORTANT PART Kay. got that out. anyway, let's show you how to add something else to the script.
seta Y02 "set MYES vstr Y03; say Yeah."
See how the vstr changed so it cycles to another say? You can add things all the way throughout your script. You use the same method to make it cycle back to the 1st one again.
seta Y03 "set MYES vstr Y01; say Yesh."
Now, I'm going to give you what a whole cycle looks like.
//These are you keys to assign to the say commands:
bind G "vstr MYES"
//These are the set commands to vstr the say commands:
set MYES "vstr Y01"
//These are the say commands:
seta Y01 "set MYES vstr Y02; say Yes."
seta Y02 "set MYES vstr Y03; say Yeah."
seta Y03 "set MYES vstr Y04; say Mhm."
seta Y04 "set MYES vstr Y05; say Yesh."
seta Y05 "set MYES vstr Y06; say Yup yup."
seta Y06 "set MYES vstr Y01; say Yep."
These are say commands from my Winscripts, except Y05 (Forgot what it was lol) Anyway, here are some handy helpful hints incase you have any questions.
-'MYES' can be anything, MHI, MNO, MLOL, etc.
-'MYES' doesnt have to have an M infront of it I don't think, and the M can be anything in a different cycle. You can't change the 'MYES' in anyway throughout the script, or it wont work.
-You can add something to say in the script when you /exec it in the console, just put it in the first line of the script. Example:
Say "Executing Delev's chat script."
//These are your keys to assign to the say commands:
bind g "vstr MYES"
-To save your script, it needs to be a config. When you're done writing your script in the notepad, X it out and it will say "The text in the untitled file has changed. Do you wish to save the changes?"
Say yes and when it comes up to where you want to save it, save it as .cfg
and you'll be able to move it to the japlus folder in your gamedata directory (C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\Gamedata)
-To access your script to change it or edit it, Left click it twice and it will come up. Also, to rename your script so its not blank, right click it and click "Rename"(most of you know that, I just needed to say that Incase some of you didn't.)
-To have the script, do /exec (your config's name) in the console.
Tele script tutorial coming soon.