Engine02 Script Commands - Variables
"If Blocks" test for certain conditions, and cause the code within to be processed only if
that condition is true. They start with any available "If" Command to define the condition,
and must be ended with an "_EndIf" command.
If the condition is true,
processing continues through the code within the "If Block", through the "EndIf", and beyond.
If the condition is not true, the code within the Block is skipped, and processing
resumes with the Command that immediately follows that Block's "EndIF".
Also available is the "_Else" Command, which causes code to execute when the
condition is not true. An "IF"/"Else"/"EndIf" Block starts with the desired "IF" Command,
followed by code to execute if the condition is true, and then the "Else" Command, followed by the
code to execute if the condition is not true, and finally, the "EndIf" Command.
Index:
Variable Comparison IFs:
| (D) (E) | _If(Reg<Reg) |
| (D) (E) | _If(Reg>Reg) |
| (D) (E) | _If(Reg<=Reg) |
| (D) (E) | _If(Reg>=Reg) |
| (D) (E) | _If(Reg==Reg) |
| (D) (E) | _If(Reg!=Reg) |
| (D) (E) | _If(Reg<Const) |
| (D) (E) | _If(Reg>Const) |
| (D) (E) | _If(Reg<=Const) |
| (D) (E) | _If(Reg>=Const) |
| (D) (E) | _If(Reg==Const) |
| (D) (E) | _If(Reg!=Const) |
| (D) (E) | _If(Reg<Chr) |
| (D) (E) | _If(Reg>Chr) |
| (D) (E) | _If(Reg<=Chr) |
| (D) (E) | _If(Reg>=Chr) |
| (D) (E) | _If(Reg==Chr) |
| (D) (E) | _If(Reg!=Chr) |
| (D) (E) | _If(Chr<Const) |
| (D) (E) | _If(Chr>Const) |
| (D) (E) | _If(Chr<=Const) |
| (D) (E) | _If(Chr>=Const) |
| (D) (E) | _If(Chr==Const) |
| (D) (E) | _If(Chr!=Const) |
| (D) (E) | _If(Chr<Chr) |
| (D) (E) | _If(Chr>Chr) |
| (D) (E) | _If(Chr<=Chr) |
| (D) (E) | _If(Chr>=Chr) |
| (D) (E) | _If(Chr==Chr) |
| (D) (E) | _If(Chr!=Chr) |
| (D) (E) | _If(Reg<Obj) |
| (D) (E) | _If(Reg>Obj) |
| (D) (E) | _If(Reg<=Obj) |
| (D) (E) | _If(Reg>=Obj) |
| (D) (E) | _If(Reg==Obj) |
| (D) (E) | _If(Reg!=Obj) |
| (D) (E) | _If(Chr<Obj) |
| (D) (E) | _If(Chr>Obj) |
| (D) (E) | _If(Chr<=Obj) |
| (D) (E) | _If(Chr>=Obj) |
| (D) (E) | _If(Chr==Obj) |
| (D) (E) | _If(Chr!=Obj) |
| (D) (E) | _If(Obj<Const) |
| (D) (E) | _If(Obj>Const) |
| (D) (E) | _If(Obj<=Const) |
| (D) (E) | _If(Obj>=Const) |
| (D) (E) | _If(Obj==Const) |
| (D) (E) | _If(Obj!=Const) |
| (D) (E) | _If(Obj<Obj) |
| (D) (E) | _If(Obj>Obj) |
| (D) (E) | _If(Obj<=Obj) |
| (D) (E) | _If(Obj>=Obj) |
| (D) (E) | _If(Obj==Obj) |
| (D) (E) | _If(Obj!=Obj) |
Descriptions:
Variable Comparison IFs:
_If(Reg<Reg)
_If(Reg>Reg)
_If(Reg<=Reg)
_If(Reg>=Reg)
_If(Reg==Reg)
_If(Reg!=Reg)
_If(Reg<Const)
_If(Reg>Const)
_If(Reg<=Const)
_If(Reg>=Const)
_If(Reg==Const)
_If(Reg!=Const)
_If(Reg<Chr)
_If(Reg>Chr)
_If(Reg<=Chr)
_If(Reg>=Chr)
_If(Reg==Chr)
_If(Reg!=Chr)
_If(Reg<Obj)
_If(Reg>Obj)
_If(Reg<=Obj)
_If(Reg>=Obj)
_If(Reg==Obj)
_If(Reg!=Obj)
_If(Chr<Const)
_If(Chr>Const)
_If(Chr<=Const)
_If(Chr>=Const)
_If(Chr==Const)
_If(Chr!=Const)
_If(Chr<Chr)
_If(Chr>Chr)
_If(Chr<=Chr)
_If(Chr>=Chr)
_If(Chr==Chr)
_If(Chr!=Chr)
_If(Chr<Obj)
_If(Chr>Obj)
_If(Chr<=Obj)
_If(Chr>=Obj)
_If(Chr==Obj)
_If(Chr!=Obj)
_If(Obj<Const)
_If(Obj>Const)
_If(Obj<=Const)
_If(Obj>=Const)
_If(Obj==Const)
_If(Obj!=Const)
_If(Obj<Obj)
_If(Obj>Obj)
_If(Obj<=Obj)
_If(Obj>=Obj)
_If(Obj==Obj)
_If(Obj!=Obj)
(ALL) (Example)
These "If" condition Commands test the relation between two variables for the following
conditions:
| (==) | Equal To |
| (!=) | Not Equal To |
| (>) | Greater Than |
| (<) | Less Than Less |
| (>=) | Greater Than or Equal To |
| (<=) | Less than or Equal To |
Commands only exist for unique comparisons. Comparisons for two variable types in reverse
order of any of the commands above are not included because they will return the same
result
One of the "FetchPlayer" Commands and/or one of the "FetchObject" Commands must
be used to select the appropriate Player(s) and/or Object(s) before these Commands are used.
If two Player Variables or two Object Variables are used, the first will use Reference 0, and the second
will use Reference 1. If one Player Variable and/or one Object Variable are used, each will use their respective Reference 0
Parameters:
- Var ID 1
- Var ID 2
These are the two variable IDs required by the condition. Variable IDs should be listed in
the order in which their types are specified by the condition. For example, with an "If_Obj<=Const"
condition, "Var ID 1" would be the ID of an Object Variable (for the Object "Fetched" to Reference 0), and "Var ID 2" would be the constant value
for use in the comparison. Another way to represent the comparison would be "Obj0 <= Const"
In the case of "Registers", "Var ID" is the ID of the "Register" to test. The "U" tag may be used
to specify a user-defined Register. Otherwise, the ID will refer to a Game Register
In the case of Player Variables, "Var ID" is the ID of the Player Variable to test. The capital "A"
tag may be used to specify an "Active" variable, the lower-case "a" to specify a user-
defined "Active" variable, and the lower-case "c" to specify a user-defined Constant.
Otherwise, the ID will refer to one of the Player's required Constants
In the case of Object Variables, "Var ID" is the ID of the Object Variable to test. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
In the case of a Constant Value, the value itself should be entered as the "Var ID" Parameter, rather than any actual Variable ID. Prefixing the
value with an "O" allows the use of the "G", "Z", and "A" tags to reference an Object Type ID from the Game, Zone, or Act Object Def
Examples:
Variable Comparison IFs:
This section lists examples of complete sets of "Do"/"BreakDo"/"Forever"/"While" Commands, because they have no individual use
_If(Reg<Reg)
_If(Reg>Reg)
_If(Reg<=Reg)
_If(Reg>=Reg)
_If(Reg==Reg)
_If(Reg!=Reg)
_If(Reg<Const)
_If(Reg>Const)
_If(Reg<=Const)
_If(Reg>=Const)
_If(Reg==Const)
_If(Reg!=Const)
_If(Reg<Chr)
_If(Reg>Chr)
_If(Reg<=Chr)
_If(Reg>=Chr)
_If(Reg==Chr)
_If(Reg!=Chr)
_If(Reg<Obj)
_If(Reg>Obj)
_If(Reg<=Obj)
_If(Reg>=Obj)
_If(Reg==Obj)
_If(Reg!=Obj)
_If(Chr<Const)
_If(Chr>Const)
_If(Chr<=Const)
_If(Chr>=Const)
_If(Chr==Const)
_If(Chr!=Const)
_If(Chr<Chr)
_If(Chr>Chr)
_If(Chr<=Chr)
_If(Chr>=Chr)
_If(Chr==Chr)
_If(Chr!=Chr)
_If(Chr<Obj)
_If(Chr>Obj)
_If(Chr<=Obj)
_If(Chr>=Obj)
_If(Chr==Obj)
_If(Chr!=Obj)
_If(Obj<Const)
_If(Obj>Const)
_If(Obj<=Const)
_If(Obj>=Const)
_If(Obj==Const)
_If(Obj!=Const)
_If(Obj<Obj)
_If(Obj>Obj)
_If(Obj<=Obj)
_If(Obj>=Obj)
_If(Obj==Obj)
_If(Obj!=Obj)
(Description)
#_If(Reg!=Reg)
: U6 ;(Reg) User Register 6
: U7 ;(Reg) User Register 7
;***
;Code here is processed only if the value of User Register 6 is not equal to the value of User Register 7
;***
#_EndIf
; ----------
#_If(Chr>=Obj)
: a25 ;(Chr0) User-created "Active Variable" 25 of the Player "Fetched" to Reference 0
: E3 ;(Obj0) "Extra Variable" 3 of the Object "Fetched" to Reference 0
;***
;Code here is processed only if the value of User-created "Active Variable" 25 of the Player "Fetched" to Reference 0 is greater than or equal to the value of "Extra Variable" 3 of the Object "Fetched" to Reference 0
;***
#_Else
;***
;Code here is processed only if the value of User-created "Active Variable" 25 of the Player "Fetched" to Reference 0 is less than the value of "Extra Variable" 3 of the Object "Fetched" to Reference 0
;***
#_EndIf
; ----------
#_If(Chr==Const) ;
: a8 ;(Chr0) User-created "Active Variable" 8 of the Player "Fetched" to Reference 0
: 256 ;(Const) 256
;***
;Code here is processed only if the value of User-created "Active Variable" 8 of the Player "Fetched" to Reference 0 is equal to 256
;***
#_EndIf
; ----------
#_If(Obj>Obj) ;
: E3 ;(Obj0) "Extra Variable" 3 of the Object "Fetched" to Reference 0
: E12 ;(Obj1) "Extra Variable" 12 of the Object "Fetched" to Reference 1
;***
;Code here is processed only if the value of "Extra Variable" 3 of the Object "Fetched" to Reference 0 is greater than the value of "Extra Variable" 12 of the Object "Fetched" to Reference 1
;***
#_Else
;***
;Code here is processed only if the value of "Extra Variable" 3 of the Object "Fetched" to Reference 0 is less than or equal to the value of "Extra Variable" 12 of the Object "Fetched" to Reference 1
;***
#_EndIf
; ----------
#_If(Obj==Const) ;
: 0 ;(Obj0) Variable 0 (Object_Type) of the Object "Fetched" to Reference 0
: OZ6 ;(Const) Full Object Type ID of Zone Object Type 6
;***
;Code here is processed only if the value of Variable 0 (Object_Type) of the Object "Fetched" to Reference 0 is equal to the Full Object Type ID of Zone Object Type 6
;***
#_EndIf