Type | Meaning | |
R | Identifies the variable as a "Game Variable"/"Register" | |
P | Identifies the variable as a "Player Variable" | |
O | Identifies the variable as an "Object Variable" | |
C | Identifies the value as a "Constant Value" (an explicit number value) |
~Eval _TempReg = _Player_X_Pos + 160 ~Eval _TempReg = 32 ~Eval _TempReg += _Object_X_Pos ~Eval _TempReg++ ~Eval -_TempRegThe following illustrates the same usage, with Variable Type Overrides and Identifiers:
~Eval(RPC) U_TempReg = A_Player_X_Pos + 160 ~Eval(RC) U_TempReg = 32 ~Eval(RO) U_TempReg += _Object_X_Pos ~Eval(R) U_TempReg++Remember that standard Player Fetching and Object Fetching rules apply when using Player and/or Object Variables.
Operator | Meaning | |
= | Assignment- The result of the operation on the right will be placed into the variable on the left | |
+ | Addition- The values to the left and right of this operator are added together | |
- | Subtraction- The value to the right of this operator is subtracted from the value to the left of this operator | |
* | Multiplication- The values to the left and right of this operator are multiplied together | |
/ | Division- The value to the left of this operator is divided by the value to the right of this operator | |
<< | Arithmetic Left Shift- The bits of the value to the left of this operator are shifted left the number of times described by the value to the right of this operator. This is a signed operation | |
>> | Arithmetic Right Shift- The bits of the value to the left of this operator are shifted right the number of times described by the value to the right of this operator. This is a signed operation | |
& | Logical AND- The value to the left of this operator is ANDed by the value to the right of this operator | |
| | Logical OR- The value to the left of this operator is ORed by the value to the right of this operator | |
^ | Logical XOR- The value to the left of this operator is XORed by the value to the right of this operator | |
% | Modulus- The result of this operation is the remainder of division of the value to the left of this operator by the value to the right of this operator | |
POW | Raise to Power- The value of the variable to the left of this operator is raised to the power of the value of the variable to the right of this operator | |
+= | Addition Assignment- The value of the variable to the left of this operator is increased by the value to the right of this operator | |
-= | Subtraction Assignment- The value of the variable to the left of this operator is increased by the value to the right of this operator | |
*= | Multiplication Assignment- The value of the variable to the left of this operator is multiplied by the value to the right of this operator | |
/= | Division Assignment- The value of the variable to the left of this operator is divided by the value to the right of this operator | |
<<= | Arithmetic Left Shift Assignment- The bits of the value of the variable to the left of this operator are shifted left the number of times described by the value to the right of this operator. This is a signed operation | |
>>= | Arithmetic Right Shift Assignment- The bits of the value of the variable to the left of this operator are shifted right the number of times described by the value to the right of this operator. This is a signed operation | |
&= | Logical AND Assignment- The value of the variable to the left of this operator is ANDed by the value to the right of this operator | |
|= | Lorical OR Assignment- The value of the variable to the left of this operator is ORed by the value to the right of this operator | |
^= | Logical XOR Assignment- The value of the variable to the left of this operator is XORed by the value to the right of this operator | |
%= | Modulus Assignment- The value of the variable to the left of this operator is made equal to the remainder of division of itself by the value to the right of this operator | |
POW= | Raise to Power Assignment- The value of the variable to the left of this operator is raised to the power of the value of the variable to the right of this operator | |
++ | Increment- The value of the variable to the left of this operator is increased by 1 | |
-- | Decrement- The value of the variable to the left of this operator is decreased by 1 |
~Eval _TempReg = +_OtherReg ;Find the absolute value of "OtherReg" and store it in "TempReg" ~Eval +_TempReg ;Convert the value of "TempReg" to its absolute value
~Eval _TempReg = -_OtherReg ;Store the negation of the value of "OtherReg" into "TempReg" ~Eval -_TempReg ;Directly negate the value of "TempReg"
~If _TempReg <= 512The following illustrates the same usage, with Variable Type Overrides and Identifiers:
~If(RC) U_TempReg <= 512Remember that standard Player Fetching and Object Fetching rules apply when using Player and/or Object Variables.
Operator | Meaning | |
< | Less Than- This condition is considered true if the value to the left of this operator is less than the value to the right of this operator | |
> | Greater Than- This condition is considered true if the value to the left of this operator is greater than the value to the right of this operator | |
<= | Less Than or Equal To- This condition is considered true if the value to the left of this operator is either less than or equal to the value to the right of this operator | |
>= | Greater Than or Equal To- This condition is considered true if the value to the left of this operator is greater less than or equal to the value to the right of this operator | |
== | Equal To- This condition is considered true if the values to the left and right of this operator are equal | |
!= | Not Equal To- This condition is considered true if the values to the left and right of this operator are not equal |
~Else
~EndIf
~Do
~While _TempReg <= 512The following illustrates the same usage, with Variable Type Overrides and Identifiers:
~While(RC) U_TempReg <= 512Remember that standard Player Fetching and Object Fetching rules apply when using Player and/or Object Variables.
Operator | Meaning | |
< | Less Than- This condition is considered true if the value to the left of this operator is less than the value to the right of this operator | |
> | Greater Than- This condition is considered true if the value to the left of this operator is greater than the value to the right of this operator | |
<= | Less Than or Equal To- This condition is considered true if the value to the left of this operator is either less than or equal to the value to the right of this operator | |
>= | Greater Than or Equal To- This condition is considered true if the value to the left of this operator is greater less than or equal to the value to the right of this operator | |
== | Equal To- This condition is considered true if the values to the left and right of this operator are equal | |
!= | Not Equal To- This condition is considered true if the values to the left and right of this operator are not equal |
~Forever
~BreakDo
~IfFlag _Bits[0] == _On ~IfFlag _Bits[_RegID] == _OffThe following illustrates the same usage, with Variable Type Overrides and Identifiers. Note that only two overrides are used, as the type of the "state" value cannot be overridden:
~IfFlag(RC) U_Bits[0] == _On ~IfFlag(RR) U_Bits[U_RegID] == _OffRemember that standard Player Fetching and Object Fetching rules apply when using Player and/or Object Variables.
~Flag _Bits[2] = _On ~Flag _Bits[_RegID] = _Off ~Flag _Bits[1] = _FlipThe following illustrates the same usage, with Variable Type Overrides and Identifiers. Note that only two overrides are used, as the type of the "state" value cannot be overridden:
~Flag(RC) U_Bits[2] = _On ~Flag(RR) U_Bits[U_RegID] = _Off ~Flag(RC) U_Bits[1] = _FlipRemember that standard Player Fetching and Object Fetching rules apply when using Player and/or Object Variables.
~Array _ArrayStart[_IndexCtr] = 5 ~Array _ArrayStart[_IndexCtr] = _TempReg ~Array _TempReg = _ArrayStart[_IndexCtr]The following illustrates the same usage, with Variable Type Overrides and Identifiers:
~Array(RRC) U_ArrayStart[U_IndexCtr] = 5 ~Array(RRR) U_ArrayStart[U_IndexCtr] = U_TempReg ~Array(RRR) U_TempReg = U_ArrayStart[U_IndexCtr]Remember that standard Player Fetching and Object Fetching rules apply when using Player and/or Object Variables.
~Table _TempReg = 5[_IndexCtr] ~Table _TempReg = Z1[_IndexCtr] ~Table _TempReg = _TableID[_IndexCtr]The following illustrates the same usage, with Variable Type Overrides and Identifiers:
~Table(RCR) U_TempReg = 5[U_IndexCtr] ~Table(RCR) U_TempReg = Z1[U_IndexCtr] ~Table(RRR) U_TempReg = U_TableID[U_IndexCtr]Remember that standard Player Fetching and Object Fetching rules apply when using Player and/or Object Variables.
;=================================================================================== ;===================== ;Function 0 - Example= ;===================== ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;The code within this Function does nothing particularly useful, and only serves ;to illustrate proper formatting for usage of each of the available Keywords. ; ;Assume that the following Alias Names have already been defined globally: ; ; Bits (Game Register, Player Variable, or Object Variable) ; Flop (Constant ID value representing an index from 0-31 within a bitfield) ; That (Game Register, Player Variable, or Object Variable) ; Values (Game Register, Player Variable, or Object Variable, which marks the ; beginning of a series of variables to be used as an array) ; SomeTable (Constant ID value representing one of several loaded "Tables" ; ;The following Alias names are HCGE Standard (although their file must be loaded): ; ; On (1) ; Flip (2) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .Alias Counter ;Create a local Alias Name "Counter" and auto-associate it with a reserved-space Register variable ;Will be used as a loop counter .Alias Temp ;Create a local Alias Name "Temp" and auto-associate it with a reserved-space Register variable ;Will be used as a temporary value holder .Alias ID ;Create a local Alias Name "ID" and auto-associate it with a reserved-space Register variable ;Will be used as an Array/Table entry index number ~IfFlag _Bits[_Flop] == _On ;If the bit at position "Flop" within the bitfield "Bits" is "On" (1), process the code between this Keyword and its corresponding "EndIf" ~Eval _Counter = 0 ;Ensure that the value stored in "Counter" starts at 0 ~Do ;This code will be processed at least once. The next "While" will loop back to here if its condition is satisfied ~Eval _ID = _That & $FC ;Perform a logical AND operation on the value of "That", and store the result in "ID" ~Array _Temp = _Values[_ID] ;From within the array "Values", take the value of the element at position "ID" and place it into "Temp" ~Eval _Temp -= 4 ;Subtract 4 from the value stored in "Temp" ~Array _Values[_ID] = _Temp ;Place the current value of "Temp" into the array "Values" at the position of element "ID" ~If _Temp == 0 ;If the value stored in "Temp" is 0, process the code between this Keyword and the following "Else" ~BreakDo ;The value stored in "Temp" is 0. "Break" (exit) this "Do" loop and immediately jump to the code imediately following "While _Counter < 8" ~Else ;If the value stored in "Temp is not 0, process the code between this Keyword and the following "EndIf" ~TableB _That = _SomeTable[_ID] ;Retrieve the value of the element at BYTE position "ID" within the table "SomeTable", and place it into "That" ~EndIf ;This is the end of the "If _Temp == 0" condition ~Eval _Counter++ ;Increase the value stored in "Counter" by 1 ~While _Counter < 8 ;Repeat the enclosed code if the value of "Counter" is less than 8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Function Processing continues here if the "While" condition becomes untrue, or if the "BreakDo" is processed ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ~EndIf ;This is the end of the "IfFlag _Bits[_Flop] == _On" condition ~Flag _Bits[_Flop] = _Flip ;Reverse the value of the bit at position "Flop" within the bitfield "Bits" #End ;Mark the end of this Function