(→Script variables: this.var) |
No edit summary |
||
Line 4: | Line 4: | ||
Script variables are normally either numbers or text. For example the condition playerIsClose has a single variable, distance, which expects a number value. All variables that expect a number can also substitute an object variable or a global flag. Instead of writing 8 as the distance, you could use player.health to input the distance as the player's current health. You can also use fizz.health for named objects, or 123.health for unnamed objects. And this.health for the script owners health. You can also write the name of any flag from globalflags.ini. |
Script variables are normally either numbers or text. For example the condition playerIsClose has a single variable, distance, which expects a number value. All variables that expect a number can also substitute an object variable or a global flag. Instead of writing 8 as the distance, you could use player.health to input the distance as the player's current health. You can also use fizz.health for named objects, or 123.health for unnamed objects. And this.health for the script owners health. You can also write the name of any flag from globalflags.ini. |
||
+ | Variable special names: |
||
− | |||
+ | {| border="0" cellpadding="1" cellspacing="1" class="article-table" style="width: 500px;" |
||
+ | |this |
||
+ | |script owner's id |
||
+ | |- |
||
+ | |caller |
||
+ | |script caller's id |
||
+ | |- |
||
+ | |player |
||
+ | |player's id |
||
+ | |- |
||
+ | |this.health |
||
+ | |script object's health |
||
+ | |- |
||
+ | |caller.health |
||
+ | |script caller's health |
||
+ | |- |
||
+ | |123.health |
||
+ | | |
||
+ | object number 123's health |
||
+ | |- |
||
+ | |james.health |
||
+ | |health of the object named james |
||
+ | |} |
||
TODO: |
TODO: |
Revision as of 17:08, 21 December 2012
Script variables
Script variables are normally either numbers or text. For example the condition playerIsClose has a single variable, distance, which expects a number value. All variables that expect a number can also substitute an object variable or a global flag. Instead of writing 8 as the distance, you could use player.health to input the distance as the player's current health. You can also use fizz.health for named objects, or 123.health for unnamed objects. And this.health for the script owners health. You can also write the name of any flag from globalflags.ini.
Variable special names:
this | script owner's id |
caller | script caller's id |
player | player's id |
this.health | script object's health |
caller.health | script caller's health |
123.health |
object number 123's health |
james.health | health of the object named james |
TODO:
- scripting with scripts.ini, using IF and ELSE