Some lines of tutorials and useful lists/tables
8 posts
• Page 1 of 1
Some lines of tutorials and useful lists/tables
Hey, i made some small how-2 of ET scripting in the past and hope it will help some people who are interested in scripting. I also arranged some popular lists: Color codes, NQ variables, list of vsay commands.
Hope this is welcome'd here
Criticism and additions requested..
--snip--
Chapter 1: Basics
ET has the ability to execute a config-file located in the etmain (or noquarter) folder.
This works with the simple ingame command:
You can write everything in such a file like ingame, every /command ingame. Only difference: you dont need a / in the file (You just need to add ingame the "/" because ET has to vary between commands and simple chat.).
Essential for ET scripting are binds, allocated commands on a key.
We will start with the chat commands:
say (main chat)
say_team (team chat)
say_buddy (fireteam chat)
vsay (main chat)
vsay_team (team chat)
vsay_buddy (fireteam chat)
The syntax for a working bind is really easy:
say (and say_team, say_buddy) has only one variable: The text.
Example:
This will bind the chat text "Hello together!" on the key g.
vsay (and vsay_team, vsay_buddy) work same way, only difference: you have to choose a voicefile first:
This will bind the voices "Jawohl, Yes,etc" with the chat text Yes Mister! on key h.
A list of all voicefiles is at the end.
You can bind more than one event, just separate them with a semicolon (;).
You can unbind a key on two ways: bind something other on it or use unbind key on it.
Chapter 2: Colors
You can colorize your text with ^ and a color or letter, its exact the same like colorizing nicknames.
You have the choice of the following:
^0 = Black, ^1 = Red, ^2 = Green, ^3 = Yellow, ^4 = Blue, ^5 = Light Blue, ^6 = Violet, ^7 = White, ^8 = Orange, ^9 = Grey.
Remember that this number will not be displayed in a chat or your nickname!
A list of all possibilities at the end of this post.
Chapter 3: Loops
Loops:
There is only one way to implemet loops in your script:
The example:
This code will bind the content of the variable "quota" on the keypad key "8" (kp_pgup).
The 2nd line set the state of this variable to "quota1", which is defined in the line below.
Each press on keypad 8 will now "execute" the actual content of "quota", starting with quota 1: a quote of Frank L. Wright. Past of the variable state is "set quota vstr quota2" with happens right after the say command is done. If you press keypad key 8 now again, the state of "quota" changed to "quota2" and its conent. And so on.
This was a pretty easy to understand, but also pretty useless example.
A better one: A loop that changes only 2 different states, like changing the field of view.
You only need to know the commands for this, it is
Normal is 90 or so, with the following code you can switch between 2 values:
This will allow you to switch between with MOUSE3 (your scroll wheel).
Chapter 4: Other stuff
If is possible to bind the execution of a file on a key, too!
This will bind the /exec autoexec.cfg ingame on your PAGE DOWN key and prevents the annoying typing of this.
You can use the following variables only with the noquarter mod, not in etpro (afaik):
// [A] - Last person who gave you ammo.
// [D] - Last person who killed you.
// [H] - Last person who gave you health.
// [K] - Last person you killed.
// [L] - Your current location. (Coordenates in where u are)
// [N] - Your nickname.
// [R] - Last person who revived you.
// [P] - Teammate you are pointing at.
// [s] - Your health (HP).
// [W] - Weapon you are currently holding.
// [T] - Ammo u have in current weapon.
NQ 1.2.7:
You have to add this in/at your binds to give the value out.
Example:
This binds the sound Need a medic + the chat "heal me! only X hp left" ! Colorized and with your current hp. "The _team" prevents that you tell your foes that you have low hp.
You can comment your code with a "//" before the comment. This will comment out the rest of the line. I recommend this very much,b ecause you will fast loose the overview of the code.
Another example:
Press Cursor Up to show your weapon and Down to make it disappear.
_____________________________________________________________
Thanks for reading, feel free to post constructive criticism or addendum's
If you have questions about your own config or any problems please make your own thread next to this.
regards, Rainbow
The vsay commands listed!
The names of all keyboard keys!
Fist half is for german keyboard layout only, the english one just take the symbols on the keys of course
If you have special keys on your keyboard like Volume-up/down, ET cannot access them (afaik!, again).
And a "colorizer", for nicknames and binds.
http://enemy-territory.4players.de/page.php?4
Cause we have so much topics about colors. There are no more then 32 colors in ET, all are here:
Regards Rapido - the one who already read the ET sources
edit,melanie:
ty rapid for this wild edit, now show me difference between my link and ur big copypaste?
Hope this is welcome'd here
Criticism and additions requested..
--snip--
Chapter 1: Basics
ET has the ability to execute a config-file located in the etmain (or noquarter) folder.
This works with the simple ingame command:
- Code: Select all
/exec filename.cfg
You can write everything in such a file like ingame, every /command ingame. Only difference: you dont need a / in the file (You just need to add ingame the "/" because ET has to vary between commands and simple chat.).
Essential for ET scripting are binds, allocated commands on a key.
We will start with the chat commands:
say (main chat)
say_team (team chat)
say_buddy (fireteam chat)
vsay (main chat)
vsay_team (team chat)
vsay_buddy (fireteam chat)
The syntax for a working bind is really easy:
- Code: Select all
bind key command "variable;another variable; a 3rd;and so on"
say (and say_team, say_buddy) has only one variable: The text.
Example:
- Code: Select all
bind g say "Hello together!"
This will bind the chat text "Hello together!" on the key g.
vsay (and vsay_team, vsay_buddy) work same way, only difference: you have to choose a voicefile first:
- Code: Select all
bind h vsay Affirmative "Yes Mister!"
This will bind the voices "Jawohl, Yes,etc" with the chat text Yes Mister! on key h.
A list of all voicefiles is at the end.
You can bind more than one event, just separate them with a semicolon (;).
You can unbind a key on two ways: bind something other on it or use unbind key on it.
Chapter 2: Colors
You can colorize your text with ^ and a color or letter, its exact the same like colorizing nicknames.
You have the choice of the following:
^0 = Black, ^1 = Red, ^2 = Green, ^3 = Yellow, ^4 = Blue, ^5 = Light Blue, ^6 = Violet, ^7 = White, ^8 = Orange, ^9 = Grey.
Remember that this number will not be displayed in a chat or your nickname!
A list of all possibilities at the end of this post.
Chapter 3: Loops
Loops:
There is only one way to implemet loops in your script:
The example:
- Code: Select all
bind kp_pgup "vstr quota"
set quota "vstr quota1"
set quota1 "say ^3Frank Lloyd Wright ^2'^7The truth is more important than the facts.^2';set quota vstr quota2"
set quota2 "say ^3William Shakespeare ^2'^7Love all, trust a few.^2';set quota vstr quota3"
set quota3 "say ^3Aristotle ^2'^7The gods too are fond of a joke.^2';set quota vstr quota1"
This code will bind the content of the variable "quota" on the keypad key "8" (kp_pgup).
The 2nd line set the state of this variable to "quota1", which is defined in the line below.
Each press on keypad 8 will now "execute" the actual content of "quota", starting with quota 1: a quote of Frank L. Wright. Past of the variable state is "set quota vstr quota2" with happens right after the say command is done. If you press keypad key 8 now again, the state of "quota" changed to "quota2" and its conent. And so on.
This was a pretty easy to understand, but also pretty useless example.
A better one: A loop that changes only 2 different states, like changing the field of view.
You only need to know the commands for this, it is
- Code: Select all
set cg_fov value
Normal is 90 or so, with the following code you can switch between 2 values:
- Code: Select all
bind MOUSE3 "vstr fov"
set fov1 "set cg_fov 90; set fov vstr fov2"
set fov2 "set cg_fov 112; set fov vstr fov1"
This will allow you to switch between with MOUSE3 (your scroll wheel).
Chapter 4: Other stuff
If is possible to bind the execution of a file on a key, too!
- Code: Select all
bind PGDN "exec autoexec.cfg"
This will bind the /exec autoexec.cfg ingame on your PAGE DOWN key and prevents the annoying typing of this.
You can use the following variables only with the noquarter mod, not in etpro (afaik):
// [A] - Last person who gave you ammo.
// [D] - Last person who killed you.
// [H] - Last person who gave you health.
// [K] - Last person you killed.
// [L] - Your current location. (Coordenates in where u are)
// [N] - Your nickname.
// [R] - Last person who revived you.
// [P] - Teammate you are pointing at.
// [s] - Your health (HP).
// [W] - Weapon you are currently holding.
// [T] - Ammo u have in current weapon.
NQ 1.2.7:
- Code: Select all
** [p] is working for spectators again
** [b] added: last teammate who damaged you
** [c] added: the damage the last teammate did to you
** [x] added: the last (non-bot) client that connected
** [m] added: the last teammate who called for a medic
** [f] added: the last teammate who called for a fieldops (ammo)
You have to add this in/at your binds to give the value out.
Example:
- Code: Select all
bind 1 "vsay_team Medic "^d|^6Heal ^dme! ^6Only [s] ^dhp ^6left^d|"
This binds the sound Need a medic + the chat "heal me! only X hp left" ! Colorized and with your current hp. "The _team" prevents that you tell your foes that you have low hp.
You can comment your code with a "//" before the comment. This will comment out the rest of the line. I recommend this very much,b ecause you will fast loose the overview of the code.
Another example:
- Code: Select all
bind uparrow "set cg_drawGun 1; echo drawgun ON"
bind downarrow "set cg_drawGun 0; echo drawgun OFF"
Press Cursor Up to show your weapon and Down to make it disappear.
_____________________________________________________________
Thanks for reading, feel free to post constructive criticism or addendum's
If you have questions about your own config or any problems please make your own thread next to this.
regards, Rainbow
The vsay commands listed!
1.Statements
1.1 - Path cleared. - PathCleared
1.2 - The enemy is weakened. - EnemyWeak
1.3 - All clear. - AllClear
1.4 - Incoming! - Incoming
1.5 - Fire in the hole! - FireInTheHole
1.6 - I'm defending. - OnDefense
1.7 - I'm attacking. - OnOffense
1.8 - Taking fire! - TakingFire
1.9 - Mines cleared. - MinesCleared
1.0 - Enemy in disguise. - EnemyDisguised
2. Requests
2.1 - Medic! - Medic
2.2 - I need ammo! - NeedAmmo
2.3 - I need backup! - NeedBackup
2.4 - We need an engineer! - NeedEngineer
2.5 - Cover me! - CoverMe
2.6 - Hold fire! - HoldFire
2.7 - Where to? - WhereTo
2.8 - We need Covert Ops! - NeedOps
3. Commands
3.1 - Follow me! - FollowMe
3.2 - Let's go! - LetsGo
3.3 - Move! - Move
3.4 - Clear the path! - ClearPath
3.5 - Defend our objective! - DefendObjective
3.6 - Disarm the dynamite! - DisarmDynamite
3.7 - Clear the mines! - ClearMines
3.8 - Reinforce the offense! - ReinforceOffense
3.9 - Reinforce the defense! - ReinforceDefense
4. Talk
4.1 - Yes! - Affirmative
4.2 - No! - Negative
4.3 - Thanks a lot! - Thanks
4.4 - You're welcome. - Welcome
4.5 - Sorry! - Sorry
4.6 - Oops! - Oops
5. Global
5.1 - Yes! - Affirmative
5.2 - No! - Negative
5.3 - The enemy is weakened. - EnemyWeak
5.4 - Hi! - Hi
5.5 - Bye. - Bye
5.6 - Great shot! - GreatShot
5.7 - Yeah! - Cheer
5.8.1 - Thanks a lot! - Thanks
5.8.2 - You're welcome. - Welcome
5.8.3 - Oops! - Oops
5.8.4 - Sorry! - Sorry
5.8.5 - Hold your fire! - HoldFire
5.8.6 - Good game! - GoodGame
6. Function
6.1 - I'm a soldier. - IamSoldier
6.2 - I'm a medic. - IamMedic
6.3 - I'm an engineer. - IamEngineer
6.4 - I'm a field ops. - IamFieldOps
6.5 - I'm a covert ops. - IamCovertOps
7. Objectives
7.1 - Command acknowledged! - CommandAcknowledged
7.2 - Command declined! - CommandDeclined
7.3 - Command completed! - CommandCompleted
7.4 - Destroy the primary objective! - DestroyPrimary
7.5 - Destroy the secondary objective! - DestroySecondary
7.6 - Destroy the construction! - DestroyConstruction
7.7 - Construction underway! - ConstructionCommencing
7.8 - Repair the vehicle! - RepairVehicle
7.9 - Destroy the vehicle! - DestroyVehicle
7.0 - Escort the vehicle! - EscortVehicle
other:
Attack! - FTAttack
Fall back! - FTFallBack
Cover me! - FTCoverMe
Disarm the dynamite! - FTDisarmDynamite
Fall back! - FTFallBack
Soldier, covering fire! - FTCoveringFire
Deploy mortar! - FTMortar
Heal the squad! - FTHealSquad
Heal me! - FTHealMe
Revive team mate! - FTReviveTeamMate
Revive me! - FTReviveMe
Destroy objective! - FTDestroyObjective
Repair objective! - FTRepairObjective
Construct the objective! - FTConstructObjective
Deploy landmines! - FTDeployLandmines
Disarm landmines! - FTDisarmLandmines
Call airstrike! - FTCallAirStrike
Call artillery! - FTCallArtillery
Resupply squad! - FTResupplySquad
Resupply me! - FTResupplyMe
Explore area! - FTExploreArea
Check for land mines! - FTCheckLandMines
Destroy satchel objective! - FTSatchelObjective
Infiltrate! - FTInfiltrate
Go undercover! - FTGoUndercover
Provide sniper cover! - FTProvideSniperCover
The names of all keyboard keys!
Fist half is for german keyboard layout only, the english one just take the symbols on the keys of course
1st row, next to '0':
ß (Hyphen) --> -
' (Equal) --> =
Löschen (Backspace) --> backspace
2nd row, next to 'P':
Ü (Left Bracket) --> [
+ (Right Bracket) --> ]
^ (~) --> ~
3rd row, next to 'L':
Ö (Semicolon) --> semicolon
Ä (Single Quote) --> '
# (Backslash) --> \
4th row, next to 'M':
, (Comma) --> ,
. (Period) --> .
- (Forward Slash) --> /
6-Block:
Einfügen (Insert) --> ins
Pos1 (Home) --> home
Bild rauf (Page Up) --> pgup
Entfernen (Delete) --> del
Ende (End) --> end
Bild runter (Page Down) --> pgdn
Cursor:
Rauf (Up Arrow) --> uparrow
Runter (Down Arrow) --> downarrow
Links (Left Arrow) --> leftarrow
Rechts (Right Arrow) --> rightarrow
KeyPad:
0 (Ins) --> kp_ins
1 (End) --> kp_end
2 (down arrow) --> kp_downarrow
3 (PgDn) --> bind kp_pgdn
4 (left arrow) --> kp_leftarrow
5 --> kp_5
6 (right arrow) --> kp_rightarrow
7 (Home) --> kp_home
8 (up arrow) --> kp_uparrow
9 (PgUp) --> kp_pgup
, (Del) --> kp_del
Enter --> kp_enter
+ --> kp_plus
- --> kp_minus
/ --> kp_slash
* --> *
Other keys:
Space --> space
Pause --> Pause
Alt --> alt
Strg (Ctrl) --> ctrl
SHIFT --> shift
CAPSLOCK --> capslock
Tabulator --> tab
Escape --> esc
Return --> enter
If you have special keys on your keyboard like Volume-up/down, ET cannot access them (afaik!, again).
And a "colorizer", for nicknames and binds.
http://enemy-territory.4players.de/page.php?4
Cause we have so much topics about colors. There are no more then 32 colors in ET, all are here:
- Enemy Territory Code: Select all
01 1: ##########
02 2: ##########
03 3: ##########
04 4: ##########
05 5: ##########
06 6: ##########
07 7: ##########
08 8: ##########
09 9: ##########
10 0: ##########
11 :: ##########
12 ;: ##########
13 <: ##########
14 =: ##########
15 >: ##########
16 ?: ##########
17 @: ##########
18 A: ##########
19 B: ##########
20 C: ##########
21 D: ##########
22 E: ##########
23 F: ##########
24 G: ##########
25 H: ##########
26 I: ##########
27 J: ##########
28 K: ##########
29 L: ##########
30 M: ##########
31 N: ##########
32 O: ##########
Regards Rapido - the one who already read the ET sources
edit,melanie:
ty rapid for this wild edit, now show me difference between my link and ur big copypaste?
Last edited by Rainbow on Sun Mar 21, 2010 13:54, edited 4 times in total.
yay i believe we had allready some kind of list like that somewhere in the past, but yea... why not, since it's allways helpfull.
/sticky
/sticky
"Some people believe football is a matter of life and death.
I am very disappointed with that attitude.
I can assure you it is much, much more important than that."
I am very disappointed with that attitude.
I can assure you it is much, much more important than that."
Sorry for opening this but here you got all
http://download.hirntot.org/misc/et_col ... _guide.pdf
Hope somebody will take it
http://download.hirntot.org/misc/et_col ... _guide.pdf
Hope somebody will take it
I can't let you scream
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest