Difference between revisions of "Advanced Scripting"

From Fortress Forever Wiki
Jump to navigationJump to search
(new advances scripting page)
 
Line 51: Line 51:
 
|Alone it does nothing. However when used in conjunction with a command / alias, the "'''-'''" tells the game to de-activate once the specified button has been released.
 
|Alone it does nothing. However when used in conjunction with a command / alias, the "'''-'''" tells the game to de-activate once the specified button has been released.
 
|- style="background-color: #f3f3f3;" |
 
|- style="background-color: #f3f3f3;" |
|''';'''
+
|'''; (colon)'''
 
|
 
|
|The ''';''' is used in advanced binds / scripts to link serveral commands together into one bind.  
+
|The '''; (colon)''' is used in advanced binds / scripts to link serveral commands together into one bind.  
 
|}
 
|}
 
|}
 
|}

Revision as of 15:58, 13 February 2008


Advanced Scripting

For advanced scripting you will need to have some basic knowledge of scripting to begin. If you are new to scripting you may want to review the basic scripting section first. You may also want to consider getting a better text editing program. However, as with basic scripting, any text editor will suffice.


What makes it advanced?

Advanced Scripting generally consists of nothing more then a series of basic scripts combined into one config file.

However as you begin scripting more you will need to use more complex commands and parameters. To begin we will outline these new parameters.

New Commands and Parameters

Below you will find a list of the most commonly used parameters and a brief description of each and how it is used.

This list is by no means meant to be a list of the only commands you can use.

Command Parameter Description
Alias Alias <alias name> "command" Alias a command. An example can be found below.
bind bind <key> "command" binds a key to preform a desired action
bindtoggle bindtoggle <key> "command" binds a key to toggle a specific command
wait Stop command parsing until next frame. One wait command is equal to .01 seconds.
+ (plus) + <command / alias> Alone it does nothing. However when used in conjunction with a command / alias, the "+" tells the game to only activate the bind while the specified button is being pressed.
- (minus) - <command / alias> Alone it does nothing. However when used in conjunction with a command / alias, the "-" tells the game to de-activate once the specified button has been released.
; (colon) The ; (colon) is used in advanced binds / scripts to link serveral commands together into one bind.

Example of an alias

  • Alias - An alias is used in conjunction with a bind. We can think of an alias like making a new command with whatever parameters we want. Remeber we must still call upon the alias within a bind for the game to recognize the alias and preform the desired command. When creating an alias the name can be anything we want, however we need to make sure that we have not already aliased that name in another script / config. The simplest way to do this is to use the find command in the console. Not all situations will require an alias, however if we are making a large script / bind we may want consider using alias' to make things simpler. In the example below we will be aliasing several commands. We will then call on the commands with a bind. Feel free to test the example in game to see it in action!
alias d_1 "bind 1 slot1"
alias d_2 "bind 2 slot2"
alias d_3 "bind 3 slot3"
alias d_4 "bind 4 slot4"
alias d_5 "bind 5 slot5"
alias d_6 "bind 6 slot6"
alias d_7 "bind 7 slot7"
alias d_8 "bind 8 slot8"
alias d_9 "bind 9 slot9"
alias d_0 "bind 0 slot0"
alias default "d_1;d_2;d_3;d_4;d_5;d_6;d_7;d_8
;d_9;d_0"
bind f "default"

File:Note.png NOTE: In this script we have aliased several things: d_2, d_3, d_4, d_5, d_6, d_7, d_8, d_9, d_0, and default. We then use a bind to link them all together.