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:
| 66 | (D) (E) | Func_If_Reg_Less_Reg |
| 67 | (D) (E) | Func_If_Reg_Great_Reg |
| 68 | (D) (E) | Func_If_Reg_LessE_Reg |
| 69 | (D) (E) | Func_If_Reg_GreatE_Reg |
| 70 | (D) (E) | Func_If_Reg_Equal_Reg |
| 71 | (D) (E) | Func_If_Reg_NEqual_Reg |
| 72 | (D) (E) | Func_If_Reg_Less_Const |
| 73 | (D) (E) | Func_If_Reg_Great_Const |
| 74 | (D) (E) | Func_If_Reg_LessE_Const |
| 75 | (D) (E) | Func_If_Reg_GreatE_Const |
| 76 | (D) (E) | Func_If_Reg_Equal_Const |
| 77 | (D) (E) | Func_If_Reg_NEqual_Const |
| 95 | (D) (E) | Func_If_Reg_Less_Chr |
| 96 | (D) (E) | Func_If_Reg_Great_Chr |
| 97 | (D) (E) | Func_If_Reg_LessE_Chr |
| 98 | (D) (E) | Func_If_Reg_GreatE_Chr |
| 99 | (D) (E) | Func_If_Reg_Equal_Chr |
| 100 | (D) (E) | Func_If_Reg_NEqual_Chr |
| 101 | (D) (E) | Func_If_Chr_Less_Const |
| 102 | (D) (E) | Func_If_Chr_Great_Const |
| 103 | (D) (E) | Func_If_Chr_LessE_Const |
| 104 | (D) (E) | Func_If_Chr_GreatE_Const |
| 105 | (D) (E) | Func_If_Chr_Equal_Const |
| 106 | (D) (E) | Func_If_Chr_NEqual_Const |
| 107 | (D) (E) | Func_If_Chr_Less_Chr |
| 108 | (D) (E) | Func_If_Chr_Great_Chr |
| 109 | (D) (E) | Func_If_Chr_LessE_Chr |
| 110 | (D) (E) | Func_If_Chr_GreatE_Chr |
| 111 | (D) (E) | Func_If_Chr_Equal_Chr |
| 112 | (D) (E) | Func_If_Chr_NEqual_Chr |
| 113 | (D) (E) | Func_If_Reg_Less_Obj |
| 114 | (D) (E) | Func_If_Reg_Great_Obj |
| 115 | (D) (E) | Func_If_Reg_LessE_Obj |
| 116 | (D) (E) | Func_If_Reg_GreatE_Obj |
| 117 | (D) (E) | Func_If_Reg_Equal_Obj |
| 118 | (D) (E) | Func_If_Reg_NEqual_Obj |
| 119 | (D) (E) | Func_If_Chr_Less_Obj |
| 120 | (D) (E) | Func_If_Chr_Great_Obj |
| 121 | (D) (E) | Func_If_Chr_LessE_Obj |
| 122 | (D) (E) | Func_If_Chr_GreatE_Obj |
| 123 | (D) (E) | Func_If_Chr_Equal_Obj |
| 124 | (D) (E) | Func_If_Chr_NEqual_Obj |
| 125 | (D) (E) | Func_If_Obj_Less_Const |
| 126 | (D) (E) | Func_If_Obj_Great_Const |
| 127 | (D) (E) | Func_If_Obj_LessE_Const |
| 128 | (D) (E) | Func_If_Obj_GreatE_Const |
| 129 | (D) (E) | Func_If_Obj_Equal_Const |
| 130 | (D) (E) | Func_If_Obj_NEqual_Const |
| 131 | (D) (E) | Func_If_Obj_Less_Obj |
| 132 | (D) (E) | Func_If_Obj_Great_Obj |
| 133 | (D) (E) | Func_If_Obj_LessE_Obj |
| 134 | (D) (E) | Func_If_Obj_GreatE_Obj |
| 135 | (D) (E) | Func_If_Obj_Equal_Obj |
| 136 | (D) (E) | Func_If_Obj_NEqual_Obj |
| 356 | (D) (E) | Func_If_Reg_Flag |
Descriptions:
Variable Comparison IFs:
66 - Func_If_Reg_Less_Reg
67 - Func_If_Reg_Great_Reg
68 - Func_If_Reg_LessE_Reg
69 - Func_If_Reg_GreatE_Reg
70 - Func_If_Reg_Equal_Reg
71 - Func_If_Reg_NEqual_Reg
72 - Func_If_Reg_Less_Const
73 - Func_If_Reg_Great_Const
74 - Func_If_Reg_LessE_Const
75 - Func_If_Reg_GreatE_Const
76 - Func_If_Reg_Equal_Const
77 - Func_If_Reg_NEqual_Const
95 - Func_If_Reg_Less_Chr
96 - Func_If_Reg_Great_Chr
97 - Func_If_Reg_LessE_Chr
98 - Func_If_Reg_GreatE_Chr
99 - Func_If_Reg_Equal_Chr
100 - Func_If_Reg_NEqual_Chr
113 - Func_If_Reg_Less_Obj
114 - Func_If_Reg_Great_Obj
115 - Func_If_Reg_LessE_Obj
116 - Func_If_Reg_GreatE_Obj
117 - Func_If_Reg_Equal_Obj
118 - Func_If_Reg_NEqual_Obj
101 - Func_If_Chr_Less_Const
102 - Func_If_Chr_Great_Const
103 - Func_If_Chr_LessE_Const
104 - Func_If_Chr_GreatE_Const
105 - Func_If_Chr_Equal_Const
106 - Func_If_Chr_NEqual_Const
107 - Func_If_Chr_Less_Chr
108 - Func_If_Chr_Great_Chr
109 - Func_If_Chr_LessE_Chr
110 - Func_If_Chr_GreatE_Chr
111 - Func_If_Chr_Equal_Chr
112 - Func_If_Chr_NEqual_Chr
119 - Func_If_Chr_Less_Obj
120 - Func_If_Chr_Great_Obj
121 - Func_If_Chr_LessE_Obj
122 - Func_If_Chr_GreatE_Obj
123 - Func_If_Chr_Equal_Obj
124 - Func_If_Chr_NEqual_Obj
125 - Func_If_Obj_Less_Const
126 - Func_If_Obj_Great_Const
127 - Func_If_Obj_LessE_Const
128 - Func_If_Obj_GreatE_Const
129 - Func_If_Obj_Equal_Const
130 - Func_If_Obj_NEqual_Const
131 - Func_If_Obj_Less_Obj
132 - Func_If_Obj_Great_Obj
133 - Func_If_Obj_LessE_Obj
134 - Func_If_Obj_GreatE_Obj
135 - Func_If_Obj_Equal_Obj
136 - Func_If_Obj_NEqual_Obj
(ALL) (Example)
These "If" condition Commands test the relation between two variables for the following
conditions:
| (Equ) | Equal To |
| (NEqu) | Not Equal To |
| (Great) | Greater Than |
| (Less) | Less Than Less |
| (GreatE) | Greater Than or Equal To |
| (LessE) | 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_LessE_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
66 - Func_If_Reg_Less_Reg
67 - Func_If_Reg_Great_Reg
68 - Func_If_Reg_LessE_Reg
69 - Func_If_Reg_GreatE_Reg
70 - Func_If_Reg_Equal_Reg
71 - Func_If_Reg_NEqual_Reg
72 - Func_If_Reg_Less_Const
73 - Func_If_Reg_Great_Const
74 - Func_If_Reg_LessE_Const
75 - Func_If_Reg_GreatE_Const
76 - Func_If_Reg_Equal_Const
77 - Func_If_Reg_NEqual_Const
95 - Func_If_Reg_Less_Chr
96 - Func_If_Reg_Great_Chr
97 - Func_If_Reg_LessE_Chr
98 - Func_If_Reg_GreatE_Chr
99 - Func_If_Reg_Equal_Chr
100 - Func_If_Reg_NEqual_Chr
113 - Func_If_Reg_Less_Obj
114 - Func_If_Reg_Great_Obj
115 - Func_If_Reg_LessE_Obj
116 - Func_If_Reg_GreatE_Obj
117 - Func_If_Reg_Equal_Obj
118 - Func_If_Reg_NEqual_Obj
101 - Func_If_Chr_Less_Const
102 - Func_If_Chr_Great_Const
103 - Func_If_Chr_LessE_Const
104 - Func_If_Chr_GreatE_Const
105 - Func_If_Chr_Equal_Const
106 - Func_If_Chr_NEqual_Const
107 - Func_If_Chr_Less_Chr
108 - Func_If_Chr_Great_Chr
109 - Func_If_Chr_LessE_Chr
110 - Func_If_Chr_GreatE_Chr
111 - Func_If_Chr_Equal_Chr
112 - Func_If_Chr_NEqual_Chr
119 - Func_If_Chr_Less_Obj
120 - Func_If_Chr_Great_Obj
121 - Func_If_Chr_LessE_Obj
122 - Func_If_Chr_GreatE_Obj
123 - Func_If_Chr_Equal_Obj
124 - Func_If_Chr_NEqual_Obj
125 - Func_If_Obj_Less_Const
126 - Func_If_Obj_Great_Const
127 - Func_If_Obj_LessE_Const
128 - Func_If_Obj_GreatE_Const
129 - Func_If_Obj_Equal_Const
130 - Func_If_Obj_NEqual_Const
131 - Func_If_Obj_Less_Obj
132 - Func_If_Obj_Great_Obj
133 - Func_If_Obj_LessE_Obj
134 - Func_If_Obj_GreatE_Obj
135 - Func_If_Obj_Equal_Obj
136 - Func_If_Obj_NEqual_Obj
(Description)
# 71 ;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
;***
# 64 ;EndIf
; ----------
# 122 ;If Chr0 >= Obj0
: 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
;***
# 63 ;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
;***
# 64 ;EndIf
; ----------
# 105 ;If Chr0 == 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
;***
# 64 ;EndIf
; ----------
# 132 ;If Obj0 > Obj1
: 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
;***
# 63 ;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
;***
# 64 ;EndIf
; ----------
# 129 ;If Obj0 == 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
;***
# 64 ;EndIf