Headcannon Game Engine Script Commands - Math Operations (Multiplication)
Index:
Multiplication - Preserve original values:
(D) (E) | _Reg=Reg*Reg |
(D) (E) | _Reg=Reg*Const |
(D) (E) | _Reg=Chr*Reg |
(D) (E) | _Reg=Chr*Const |
(D) (E) | _Reg=Chr*Obj |
(D) (E) | _Reg=Chr*Chr |
(D) (E) | _Reg=Obj*Obj |
(D) (E) | _Reg=Obj*Reg |
(D) (E) | _Reg=Obj*Const |
(D) (E) | _Chr=Reg*Reg |
(D) (E) | _Chr=Reg*Const |
(D) (E) | _Chr=Chr*Reg |
(D) (E) | _Chr=Chr*Const |
(D) (E) | _Chr=Chr*Obj |
(D) (E) | _Chr=Chr*Chr |
(D) (E) | _Chr=Obj*Obj |
(D) (E) | _Chr=Obj*Reg |
(D) (E) | _Chr=Obj*Const |
(D) (E) | _Obj=Reg*Reg |
(D) (E) | _Obj=Reg*Const |
(D) (E) | _Obj=Chr*Reg |
(D) (E) | _Obj=Chr*Const |
(D) (E) | _Obj=Chr*Obj |
(D) (E) | _Obj=Chr*Chr |
(D) (E) | _Obj=Obj*Obj |
(D) (E) | _Obj=Obj*Reg |
(D) (E) | _Obj=Obj*Const |
Multiplication - Overwrite original values:
(D) (E) | _Reg*=Reg |
(D) (E) | _Reg*=Chr |
(D) (E) | _Reg*=Obj |
(D) (E) | _Reg*=Const |
(D) (E) | _Chr*=Reg |
(D) (E) | _Chr*=Chr |
(D) (E) | _Chr*=Obj |
(D) (E) | _Chr*=Const |
(D) (E) | _Obj*=Reg |
(D) (E) | _Obj*=Chr |
(D) (E) | _Obj*=Obj |
(D) (E) | _Obj*=Const |
Descriptions:
Multiplication - Preserve original values:
_Reg=Reg*Reg
_Reg=Reg*Const
_Reg=Chr*Reg
_Reg=Chr*Const
_Reg=Chr*Obj
_Reg=Chr*Chr
_Reg=Obj*Obj
_Reg=Obj*Reg
_Reg=Obj*Const
_Chr=Reg*Reg
_Chr=Reg*Const
_Chr=Chr*Reg
_Chr=Chr*Const
_Chr=Chr*Obj
_Chr=Chr*Chr
_Chr=Obj*Obj
_Chr=Obj*Reg
_Chr=Obj*Const
_Obj=Reg*Reg
_Obj=Reg*Const
_Obj=Chr*Reg
_Obj=Chr*Const
_Obj=Chr*Obj
_Obj=Chr*Chr
_Obj=Obj*Obj
_Obj=Obj*Reg
_Obj=Obj*Const
(ALL) (Example)
These Commands multiply the value of one variable by another and give the resulting value to
a third variable.
Dest = Var1 * Var2
Commands only exist for unique expressions; expressions for two variables in reverse
order of any of the commands above are not included because they will return the same
result.
In the case of two Players, Var 1 is read from the Player "Fetched" to "Reference 0", and Var 2 is
read from the Player "Fetched" to "Reference 1"
In the case of two Objects, Var 1 is read from the Object "Fetched" to "Reference 0", and Var 2 is
read from the Object "Fetched" to "Reference 1"
In the case that only one Player is used for input, and/or only one Object is used for input, the Player
"Fetched" to "Reference 0" is used, and the Object "Fetched" to "Reference 0" is used.
The Destination variable is always considered to be from the Object or Player "Fetched" to "Reference 2"
Parameters:
- Var ID 1
- Var ID 2
- Dest Var ID
The value of the variable given by "Var ID 1" is multiplied by the value of the variable given by "Var ID 2",
and the result is stored in the variable given by "Dest Var ID".
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
In the case of a Constant Value, "Var ID" is the actual value to be used in the calculation, rather than any variable ID.
Multiplication - Overwrite original values:
_Reg*=Reg
_Reg*=Chr
_Reg*=Obj
_Reg*=Const
_Chr*=Reg
_Chr*=Chr
_Chr*=Obj
_Chr*=Const
_Obj*=Reg
_Obj*=Chr
_Obj*=Obj
_Obj*=Const
(ALL) (Example)
These Commands multiply the value of the given Destination variable by the value of the given Source variable,
and place the result into the given Destination variable, overwriting its previous content.
Dest *= Src
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 value of the variable given by "Dest" is multiplied by the value of the variable given by "Src",
and the result is placed into "Dest"
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
In the case of a Constant Value, "Var ID" is the actual value to be used in the calculation, rather than any variable ID.
Examples:
Multiplication - Preserve original values:
#_Reg=Chr*Const ;Multiply the value of User-created "Active Variable" 18 of the Player "Fetched" to "Reference 0" by 3, and place the result in "User Register" 7
: a18 ;(Chr0) User-created "Active Variable" of the Player "Fetched" to "Reference 0"
: 3 ;(Const) 3
: U7 ;(Dest) "User Register" 7
; ----------
#_Chr=Chr*Chr ;Multiply the value of User-created "Active Variable" 12 of the Player "Fetched" to "Reference 0" by the value of User-created "Active Variable" 13 of the Player "Fetched" to "Reference 1", and place the result in User-created "Active Variable" 2 of the Player "Fetched" to "Reference 2"
: a12 ;(Chr0) User-created "Active Variable" 12 of the Player "Fetched" to "Reference 0"
: a13 ;(Chr1) User-created "Active Variable" 13 of the Player "Fetched" to "Reference 1"
: a2 ;(Dest) User-created "Active Variable" 2 of the Player "Fetched" to "Reference 2"
; ----------
#_Obj=Obj*Reg ;Multiply the value of "Extra Variable" 4 of the Object "Fetched" to "Reference 0" by the value of "User Register" 24, and place the result in "Extra Variable" 8 of the Object "Fetched" to "Reference 2"
: E4 ;(Obj0) "Extra Variable" 4 of the Object "Fetched" to "Reference 0"
: U24 ;(Reg) "User Register" 24
: E8 ;(Dest) "Extra Variable" 8 of the Object "Fetched" to "Reference 2"
Multiplication - Overwrite original values:
#_Reg*=Obj ;Multiply the value of "User Register" 3 by the value of "Extra Variable" 4 of the Object "Fetched" to "Reference 0", and place the result back into "User Register" 3
: E1 ;(Chr0) "Extra Variable" 4 of the Object "Fetched" to "Reference 0"
: U3 ;(Dest) "User Register" 3
; ----------
#_Chr*=Chr ;Multiply the value of User-created "Active Variable" 6 of the Player "Fetched" to "Reference 2" by the value of User-created "Active Variable" 9 of the Player "Fetched" to "Reference 0", and place the result back into User-created "Active Variable" 6 of the Player "Fetched" to "Reference 2"
: a9 ;(Chr0) User-created "Active Variable" 9 of the Player "Fetched" to "Reference 0"
: a6 ;(Dest) User-created "Active Variable" 6 of the Player "Fetched" to "Reference 2"
; ----------
#_Obj*=Const ;Multiply the value of "Extra Variable" 8 of the Object "Fetched" to "Reference 2" by 12, and place the result back into "Extra Variable" 8 of the Object "Fetched" to "Reference 2"
: 12 ;(Const) 12
: E8 ;(Dest) "Extra Variable" 8 of the Object "Fetched" to "Reference 2"