Headcannon Game Engine Script Commands - Math Operations (Negation)
Index:
Negation - Overwrite original values:
(D) (E) | _Neg(Reg) |
(D) (E) | _Neg(Chr) |
(D) (E) | _Neg(Obj) |
Negation - Preserve Original Values:
(D) (E) | _Reg=Neg(Reg) |
(D) (E) | _Reg=Neg(Chr) |
(D) (E) | _Reg=Neg(Obj) |
(D) (E) | _Chr=Neg(Reg) |
(D) (E) | _Chr=Neg(Chr) |
(D) (E) | _Chr=Neg(Obj) |
(D) (E) | _Obj=Neg(Reg) |
(D) (E) | _Obj=Neg(Chr) |
(D) (E) | _Obj=Neg(Obj) |
Descriptions:
Negation - Overwrite original values:
_Neg(Reg)
_Neg(Chr)
_Neg(Obj)
(ALL) (Example)
These Commands negate the value of a Variable. Negative values become positive, and
positive values become negative.
Parameters:
- Var ID
This is the ID of the variable to negate
In the case of "Registers", "Var ID" is the ID of the "Register" whose value should be increased. 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 for the Player that is "Fetched" to "Reference 2" whose value should be increased. 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 for the Object that is "Fetched" to "Reference 2" whose value should be increased. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
Negation - Preserve Original Values:
_Reg=Neg(Reg)
_Reg=Neg(Chr)
_Reg=Neg(Obj)
_Chr=Neg(Reg)
_Chr=Neg(Chr)
_Chr=Neg(Obj)
_Obj=Neg(Reg)
_Obj=Neg(Chr)
_Obj=Neg(Obj)
(ALL) (Example)
These Commands negate the value of a Variable. Negative values become positive, and
positive values become negative. This Value is given to the Destination Variable, and the
Source Variable remains untouched.
The Source variable is always considered to be from the Object or Player "Fetched" to "Reference 0"
The Destination variable is always considered to be from the Object or Player "Fetched" to "Reference 2"
Parameters:
- Src Var ID
- Dest Var ID
The first Parameter is the ID of the Variable whose value should be used, and the second
is the ID of the Variable in which to store the result
In the case of "Registers", "Var ID" is the ID of the "Register" that should be read/written. 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 that should be read/written. 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 that should be read/written. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
Examples:
Negation - Overwrite original values:
#_Neg(Reg) ;Negate the value of "User Register" 3
: U3 ;(Reg) "User Register" 3
; ----------
#_Neg(Chr) ;Negate the value of User-created "Active Variable" 6 of the Player "Fetched" to "Reference 2"
: a6 ;(Chr2) User-created "Active Variable" 6 of the Player "Fetched" to "Reference 2"
; ----------
#_Neg(Obj) ;Negate the value of "Extra Variable" 8 of the Object "Fetched" to "Reference 2"
: E8 ;(Obj2) "Extra Variable" 8 of the Object "Fetched" to "Reference 2"
Negation - Preserve Original Values:
#_Reg=Neg(Obj) ;Obtain the negated version of the value stored in "Extra Variable" 1 of the Object "Fetched" to "Reference 0" and place the result in "User Register" 7
: E1 ;(Src) "Extra Variable" 1 of the Object "Fetched" to "Reference 0"
: U7 ;(Dest) "User Register" 7
; ----------
#_Chr=Neg(Chr) ;Obtain the negated version of the value stored in User-created "Active Variable" 13 of the Player "Fetched" to "Reference 0" and place the result in User-created "Active Variable" 2 of the Player "Fetched" to "Reference 2"
: a13 ;(Src) User-created "Active Variable" 13 of the Player "Fetched" to "Reference 0"
: a2 ;(Dest) User-created "Active Variable" 2 of the Player "Fetched" to "Reference 2"
; ----------
#_Obj=Neg(Reg) ;Obtain the negated version of the value stored in "User Register" 24 and place the result in "Extra Variable" 8 of the Object "Fetched" to "Reference 2"
: U24 ;(Src) "User Register" 24
: E8 ;(Dest) "Extra Variable" 8 of the Object "Fetched" to "Reference 2"