Headcannon Game Engine Script Commands - Objects
Index:
Object Spawning:
(D) (E) | _SpawnObject |
(D) (E) | _Debug_PlaceObject |
Object Priority:
(D) (E) | _Object_ChangePriority(Fetched) |
(D) (E) | _Object_ChangePriority(Curr) |
Object Destruction:
Object Fetching:
(D) (E) | _FetchObject_ByID |
(D) (E) | _FetchObject_Current |
(D) (E) | _FetchObject_LastSpawned |
(D) (E) | _FetchObject_CurrentProjectile |
(D) (E) | _FetchObject_CurrentParent |
(D) (E) | _FetchObject_CurrentChild |
(D) (E) | _FetchObject_FetchedParent |
(D) (E) | _FetchObject_FetchedChild |
(D) (E) | _FetchObject_Reg |
(D) (E) | _FetchObject_CurrChr |
(D) (E) | _FetchObject_CurrObj |
(D) (E) | _FetchObject_FetchedChr |
(D) (E) | _FetchObject_FetchedObj |
(D) (E) | _CopyFetch_Object |
(D) (E) | _SwapFetch_Object |
Parent/Child Relation:
(D) (E) | _Object_SetParent_Fetched |
(D) (E) | _Object_SetChild_Fetched |
(D) (E) | _Object_SetParent_Curr |
(D) (E) | _Object_SetChild_Curr |
(D) (E) | _Object_Fetched_DetachFromParent |
(D) (E) | _Object_Current_DetachFromParent |
Projectile Collision Testing:
(D) (E) | _TestCollisions(CurrentProjectile) |
(D) (E) | _TestCollisions(FetchedProjectile) |
Function Control:
(D) (E) | _CallFunc_CurrObject_Const |
(D) (E) | _CallFunc_CurrObject_Obj |
(D) (E) | _CallFunc_CurrObject_OConst |
(D) (E) | _RunFunc_CurrObject_Const |
(D) (E) | _RunFunc_CurrObject_Obj |
(D) (E) | _RunFunc_CurrObject_OConst |
(D) (E) | _StopFunc_CurrObject_Const |
(D) (E) | _StopFunc_CurrObject_Obj |
(D) (E) | _StopFunc_CurrObject_OConst |
(D) (E) | _CallFunc_FetchedObject_Const |
(D) (E) | _CallFunc_FetchedObject_Obj |
(D) (E) | _CallFunc_FetchedObject_OConst |
(D) (E) | _RunFunc_FetchedObject_Const |
(D) (E) | _RunFunc_FetchedObject_Obj |
(D) (E) | _RunFunc_FetchedObject_OConst |
(D) (E) | _StopFunc_FetchedObject_Const |
(D) (E) | _StopFunc_FetchedObject_Obj |
(D) (E) | _StopFunc_FetchedObject_OConst |
Object Pointers:
(D) (E) | _Reg=Ptr(CurrObj) |
(D) (E) | _Chr=Ptr(CurrObj) |
(D) (E) | _Obj=Ptr(CurrObj) |
(D) (E) | _Reg=Ptr(FetchedObj) |
(D) (E) | _Chr=Ptr(FetchedObj) |
(D) (E) | _Obj=Ptr(FetchedObj) |
Object Suspension:
(D) (E) | _Object_StopCurrent |
(D) (E) | _Object_StopFetched |
Collision Area:
(D) (E) | _Reg=Object_CollisionArea |
Setting the "Current Object":
(D) (E) | _Set_CurrObj(Reg) |
(D) (E) | _Set_CurrObj(Chr) |
(D) (E) | _Set_CurrObj(Obj) |
Setting the "Current Projectile":
(D) (E) | _Set_CurrProjectile(Reg) |
(D) (E) | _Set_CurrProjectile(Chr) |
(D) (E) | _Set_CurrProjectile(Obj) |
Collision Box Offsets:
(D) (E) | _Chr=Object_Boundary_Offset |
(D) (E) | _Obj=Object_Boundary_Offset |
Drawing:
Descriptions:
Object Spawning:
_SpawnObject
(ALL) (REG) (Example)
Spawns a "Game Object" that was defined by an
"Object Def", or a Built-in Object. Register values may be used in any field
except "Num Parameters" and "Param" by use of the r and R flags
Parameters:
- Object Type
This is the Type ID of the desired Object, which is
the desired Type's entry position in the "Object Def". The "G", "Z", and "A" tags may be used to reference
an Object Type from the "Object Def" loaded for game-global, the "Object Def" loaded for the current "Zone",
or the "Object Def" loaded for the current "Act", respectively
- X
- Y
- Priority
- Tag
This is the "Tag ID" to apply to the Object
- Flags
This value sets the Object's "Flags"
- Num Parameters
This is the number of "Parameters" that will be passed
when spawning the Object, which are used by the Object Type's
"SpawnValues"
in the "Object Def".
Each Parameter is listed below:
- Param
The values entered here form the list that is referenced
by certain "SpawnValues" settings
_Debug_PlaceObject
(ALL) (Example)
Object Priority:
_Object_ChangePriority(Fetched)
_Object_ChangePriority(Curr)
(OBJ) (REG) (Example)
Changes the "Priority" of the given Object, and causes the Object to be moved to a new location within
the active Objects list based on the given "Priority" value
The "Fetched" version will affect the Object that is currently "Fetched" to "Reference 2"
The "Current" version will affect the "Current Object", the Object that is currently being processed
Parameters:
- Priority:
The new "Priority" value to assign to the Object, which will determine how it is processed and drawn in relation to other currently-active Objects
Object Destruction:
_Object_Destroy
(OBJ) (Example)
"Destroys" the current "Game Object". This command is safe to use in any
Function at any time, assuming that any Script Function that doesn't belong to that Object will no longer attempt to access it after destruction
Parameters:
None
Object Fetching:
_FetchObject_ByID
(ALL) (REG) (Example)
"Fetches" an Object by "Object ID", its position
in the active Game Objects list.
This ID is highly prone to change as the Object moves around the
list due to Spawning and
Destruction of other Objects, so this method is unreliable
unless the Object's list ID has just been obtained before the use of this Command, or the
Object is given a higher "Priority" than any other
Object that is dynamically Spawned or Destroyed, causing it to remain in the same place throughout gameplay
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
- Object ID:
List ID number of the Object to Fetch to this "Reference". The "R" and "r" tags may
be used to obtain an Object ID from a Register
_FetchObject_Current
(OBJ) (Example)
"Fetches" the "Current Object", the Object that is currently being processed
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
_FetchObject_LastSpawned
(ALL) (Example)
"Fetches" the last Object that was Spawned
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
_FetchObject_CurrentProjectile
(COL) (Example)
"Fetches" the "Current Projectile", the
"Projectile Object" that is currently testing
for Collisions (The Object is not considered to be the "Current Projectile" at any
other time, unless it is set that way manually)
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
_FetchObject_CurrentParent
(OBJ) (Example)
"Fetches" the "Parent Object" of the "Current Object"
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
_FetchObject_CurrentChild
(OBJ) (REG) (Example)
"Fetches" a Child Object of the "Current Object"
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
- Child ID
The ID number of the desired Child Object within the "Current Object"'s Child listing. The "R" and "r" tags may
be used to obtain an Object ID from a Register
_FetchObject_FetchedParent
(ALL) (Example)
"Fetches" the "Parent Object" of the Object "Fetched" to "Reference 0"
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
_FetchObject_FetchedChild
(ALL) (REG) (Example)
"Fetches" a "Child Object" of the Object "Fetched" to "Reference 0"
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
- Child ID
The ID number of the desired Child Object within the Child listing of the Object "Fetched" to "Reference 0". The "R" and "r" tags may
be used to obtain an Object ID from a Register
_FetchObject_Reg
_FetchObject_CurrChr
_FetchObject_CurrObj
_FetchObject_FetchedChr
_FetchObject_FetchedObj
(ALL) (Example)
"Fetches" an Object pointer that was stored in a Register, Player Variable, or Object Variable
For "_Curr" versions, The given variable is read from the "Current Player" or "Current Object"
For "_Fetched" versions, The given variable is read from the Player or Object that was already Fetched to Reference 0
Parameters:
- Reference:
ID number of the "Reference" that the Object should be "Fetched" to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
- Var ID
In the case of "Registers", "Var ID" is the ID of the "Register" that contains the pointer. 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 contains the pointer. 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 contains the pointer. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
_CopyFetch_Object
(ALL) (Example)
Copies a "Fetched" Object from one Reference to another
Parameters:
- Src Reference:
ID number of the "Reference" to copy
- Dest Reference:
ID number of the "Reference" that the Object should be copied to:
0 | - | _Ref_Src0 | - | Fetch this Object to Reference 0 |
1 | - | _Ref_Src0 | - | Fetch this Object to Reference 1 |
2 | - | _Ref_Dest | - | Fetch this Object to Reference 2 |
3 | - | _Ref_Src0_Src0 | - | Fetch this Object to Reference 0 and 1 |
4 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 1 and 2 |
5 | - | _Ref_Src0_Dest | - | Fetch this Object to Reference 0 and 2 |
6 | - | _Ref_All | - | Fetch this Object to Reference 0, 1, and 2 |
_SwapFetch_Object
(ALL) (Example)
Swaps "Fetched" Objects between two References
Parameters:
- References
Specifies which two References should be swapped:
0 | - | _Swap_Src0_Src0 | - | Swap References 0 and 1 |
1 | - | _Swap_Src0_Dest | - | Swap References 1 and 2 |
2 | - | _Swap_Src0_Dest | - | Swap References 0 and 2 |
Parent/Child Relation:
_Object_SetParent_Fetched
(ALL) (Example)
Sets the Object currently "Fetched" to "Reference 0" as the "Parent" of the Object currently "Fetched" to "Reference 2"
Parameters:
None
_Object_SetChild_Fetched
(ALL) (Example)
Sets the Object currently "Fetched" to "Reference 0" as a "Child" of the Object currently "Fetched" to "Reference 2"
Parameters:
- Child ID
The ID number to assign to this Child Object, the position it will occupy in its
Parent's Child listing
_Object_SetParent_Curr
(OBJ) (Example)
Sets the Object currently "Fetched" to "Reference 0" as the "Parent" of the "Current Object
Parameters:
None
_Object_SetChild_Curr
(OBJ) (Example)
Sets the Object currently "Fetched" to "Reference 0" as a "Child" of the "Current Object"
Parameters:
- Child ID
The ID number to assign to this Child Object, the position it will occupy in its
Parent's Child listing
_Object_Fetched_DetachFromParent
_Object_Current_DetachFromParent
(OBJ) (Example)
Removes the Object from the "Child" list of its current "Parent", and removes the Object's "Parent" setting.
The "_Fetched" variant affects the Object "Fetched" to "Reference 2", while the "_Current" variant affects the "Current Object".
This is useful for such effects as an Object that initially must be destroyed along with its parent, but is later launched and should become entirely independent (destroying the old Parent no longer destroys this Object), or when the old Parent should otherwise no longer have any particular control over the Object.
Parameters:
None
Projectile Collision Testing:
_TestCollisions(CurrentProjectile)
(ALL) (Example)
Causes the "Current Object" to become the "Current Projectile" and test for collision against Objects.
This runs the Built-in and Scripted "Projectile Collision" functions associated with all Objects within
"Activity Range".
Because some "Projectile Collision" Script Commands test the
direction of the Projectile's movement, the
Projectile's "Object_XCount" and "Object_YCount" must be set to the
proper values for accurate results. An "XCount" greater than 255 signifies right motion,
while a value less than -255 signifies left motion. Similarly, a "YCount" greater than 255
signifies downward motion, while a value less than -255 signifies upward motion. Collision
must be tested on only one axis (X or Y) at a time, and as such, when using "XCount",
"YCount" must be between -255 and 255, and when using "YCount", "XCount" must be between
-255 and 255
Parameters:
None
_TestCollisions(FetchedProjectile)
(ALL) (Example)
Causes the Object "Fetched" to "Reference 2" to become the "Current Projectile" and test for collision against Objects.
This runs the Built-in and Scripted "Projectile Collision" functions associated with all Objects within
"Activity Range".
Because some "Projectile Collision" Script Commands test the
direction of the Projectile's movement, the
Projectile's "Object_XCount" and "Object_YCount" must be set to the
proper values for accurate results. An "XCount" greater than 255 signifies right motion,
while a value less than -255 signifies left motion. Similarly, a "YCount" greater than 255
signifies downward motion, while a value less than -255 signifies upward motion. Collision
must be tested on only one axis (X or Y) at a time, and as such, when using "XCount",
"YCount" must be between -255 and 255, and when using "YCount", "XCount" must be between
-255 and 255
Parameters:
None
Function Control:
_CallFunc_CurrObject_Const
_CallFunc_CurrObject_Obj
_RunFunc_CurrObject_Const
_RunFunc_CurrObject_Obj
_StopFunc_CurrObject_Const
_StopFunc_CurrObject_Obj
_CallFunc_FetchedObject_Const
_CallFunc_FetchedObject_Obj
_RunFunc_FetchedObject_Const
_RunFunc_FetchedObject_Obj
_StopFunc_FetchedObject_Const
_StopFunc_FetchedObject_Obj
(ALL) (Example)
Calls, Runs, or Stops the Scripted Object Movement Function given
by the specified variable as a "Movement/Sentry Function"
For the "_CurrObject" versions, the "Current Object" is used for obtaining the variable value in the case of Object Variables, and will be the Object whose Functions are affected
For the "_FetchedObject" versions, the Object "Fetched" to "Reference 2" is used for obtaining the variable value in the case of Object Variables, and will be the Object whose Functions are affected
Parameters:
- Var ID
In the case of a Constant Value, the ID of the Scripted Object Movement Function should be entered as the "Var ID"
parameter rather than any actual variable ID. The "G", "Z", and "A" tags may be used to reference Object Movement Functions loaded as Game-global, "Zone"-Specific, or "Act"-Specific, respectively. The "R" or "r" tags
may be used to obtain the ID from a Register
In the case of Object Variables, "Var ID" is the ID of the Object Variable that contains the Function ID. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
_CallFunc_CurrObject_OConst
_RunFunc_CurrObject_OConst
_StopFunc_CurrObject_OConst
_CallFunc_FetchedObject_OConst
_RunFunc_FetchedObject_OConst
_StopFunc_FetchedObject_OConst
(ALL) (Example)
Calls, Runs, or Stops the Scripted Object Movement Function given
by the specified "Object Constant" as a "Movement/Sentry Function"
For the "_CurrObject" versions, the "Current Object" is used for obtaining the variable value in the case of Object Variables, and will be the Object whose Functions are affected
For the "_FetchedObject" versions, the Object "Fetched" to "Reference 2" is used for obtaining the variable value in the case of Object Variables, and will be the Object whose Functions are affected
Parameters:
- List ID
ID number of the "Constant List" within the Object's Type entry in the Object Def that contains the desired "Constant"
- Const ID
ID number of the "Constant" within the given list that contains the Function ID
Object Pointers:
_Reg=Ptr(CurrObj)
_Chr=Ptr(CurrObj)
_Obj=Ptr(CurrObj)
_Reg=Ptr(FetchedObj)
_Chr=Ptr(FetchedObj)
_Obj=Ptr(FetchedObj)
(ALL) (Example)
Obtain a pointer to the Object, and place it in the given variable for later retrieval by special Fetch Commands
For "_Curr" versions, a pointer to the "Current Object" will be retrieved
For "_Fetched" versions, a pointer to the Object that was "Fetched" to "Reference 0" will be retrieved
Parameters:
- Var ID
In the case of "Registers", "Var ID" is the ID of the "Register" into which to place the pointer. 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 into which to place the pointer. 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 into which to place the pointer. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
Object Suspension:
_Object_StopCurrent
_Object_StopFetched
(ALL) (Example)
Immediately stops all Functions and Animations that are running for the Object,
and changes the Object's Type value to the given Type ID. Also destroys the Object's Children
if its original Type's Object Def entry has the "Destroy Children" flag set
The "_Current" version will affect the "Current Object"
The "_Fetched" version will affect the Object that is currently "Fetched" to "Reference 2"
This Command is primarily used for "destroying" Objects that must reset
when the Player exits and re-enters the area. An Object that is destroyed
completely cannot be reset, so the Object is suspended and masked as an Object that has no tangible properties (it is not visible, has no collision, and performs no actions)
Parameters:
- Type ID
New Game-global Object Type ID that should be given to the Object.
This should generally be an Object Type that has no Hard-Coded or Scripted Function settings, and which
is flagged to reset
Collision Area:
_Reg=Object_CollisionArea
(ALL) (Example)
Setting the "Current Object":
_Set_CurrObj(Reg)
_Set_CurrObj(Chr)
_Set_CurrObj(Obj)
(ALL) (Example)
Sets the the Object whose pointer is stored in the given variable as the "Current Object"
This Command is meant to be used in Functions that are not a part of normal Object processing,
so that Commands that read or manipulate the "Current Object" can still be used as desired.
This Command can be used to switch the "Current Object" during Object processing Functions such
as Object movement, animation, and collision Functions, but in
these cases, the original "Current Object" must be restored when finished
Parameters:
- Var ID
In the case of "Registers", "Var ID" is the ID of the "Register" that contains the pointer. 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 contains the pointer. 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 contains the pointer. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
Setting the "Current Projectile":
_Set_CurrProjectile(Reg)
_Set_CurrProjectile(Chr)
_Set_CurrProjectile(Obj)
(ALL) (Example)
Sets the Object whose pointer is stored in the given variable as the "Current Projectile"
This Command is meant to be used in Functions that are not a part of normal Object processing,
so that Commands that read or manipulate the "Current Object" can still be used as desired.
This Command can be used to switch the "Current Object" during Object processing Functions such
as Object movement, animation, and collision Functions, but in
these cases, the original "Current Object" must be restored when finished
Parameters:
- Var ID
In the case of "Registers", "Var ID" is the ID of the "Register" that contains the pointer. 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 contains the pointer. 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 contains the pointer. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
Collision Box Offsets:
_Chr=Object_Boundary_Offset
_Obj=Object_Boundary_Offset
(ALL) (Example)
Obtains the distance between a certain part of the "Current Object" and a certain
part of the "Current Player" or "Current Projectile", and places it in the given Player Variable or Object Variable
Parameters:
- Player/Projectile Boundary
The part of the Player/Projectile that will be tested:
0 | - | _BoxOff_Top | - | Top of the Player's MainBounds Box |
1 | - | _BoxOff_Bottom | - | Bottom of the Player's MainBounds Box |
2 | - | _BoxOff_Left | - | Left of the Player's MainBounds Box |
3 | - | _BoxOff_Right | - | Right of the Player's MainBounds Box |
4 | - | _BoxOff_HCenter | - | Horizontal Center of the Player's MainBounds Box |
5 | - | _BoxOff_VCenter | - | Vertical Center of the Player's MainBounds Box |
6 | - | _BoxOff_XPos | - | Player's X Position |
7 | - | _BoxOff_YPos | - | Player's Y Position |
- Object Boundary
The part of the Object that will be tested (depends on the "Player/Projectile Boundary" setting):
0 | - | _BoundTest_Top _BoundTest_Left | - | Top or Left of the Object's MainBounds Box |
1 | - | _BoundTest_Bottom _BoundTest_Right | - | Bottom or right of the Object's MainBounds Box |
2 | - | _BoundTest_HCenter _BoundTest_VCenter | - | Horizontal or Vertical center of the Object's MainBounds Box |
3 | - | _BoundTest_XPos _BoundTest_YPos | - | Object's X or Y Position |
- Var ID
In the case of Players, "Var ID" is the ID of the Player Variable within the "Current Player" that should recieve the distance value. 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 Projectiles, "Var ID" is the ID of the Object Variable within the "Current Projectile" that should recieve the distance value. The "E" tag may
be used to specify an "Extra" variable. Otherwise, the ID will refer to one of the
Object's standard variables
Drawing:
_Debug_Draw
(ALL) (Example)
Draws the "Current Object" to the screen, based on the given Parameters
Parameters:
- Sprite Set ID
- Sprite Frame ID
ID of the desired Sprite Frame within the given Sprite Set
- XOff
- YOff
X and Y offsets from the "Current Object"'s X/Y Position at which to draw the given Sprite Frame
- Draw Dir
The direction in which to draw the given Sprite Frame:
0 | - | _Draw_Normal | - | Normal |
1 | - | _Draw_HFlip | - | Horizontally Mirrored |
2 | - | _Draw_VFlip | - | Vertically Flipped |
3 | - | _Draw_HVFlip | - | Both Flipped and Mirrored |
Examples:
_Debug_PlaceObject
(Description)
#_Debug_PlaceObject ;Run the Built-in and Scripted Object Debug Placement Functions for the Object Type whose ID is stored in "Active Variable" 35 [Player_DebugNum] of the "Current Player"
Object Priority:
_Object_ChangePriority(Fetched)
_Object_ChangePriority(Curr)
(Description)
#_Object_ChangePriority(Fetched) ;Change the Priority of the Object currently "Fetched" to "Reference 2" to 32
: 32 ;(Priority) New Priority value should be 32
; ----------
#_Object_ChangePriority(Curr) ;Change the Priority of the "Current Object" to the value stored in user register 9
: R9 ;(Priority) Value stored in User Register 9
Object Destruction:
#_Object_Destroy ;"Destroy" the "Current Object"
Object Fetching:
#_FetchObject_ByID ;"Fetch" the first Object in the active Objects list to Reference 2
:_Ref_Dest
: 0 ;Object at entry 0 in the active Objects list
; ----------
#_FetchObject_ByID ;"Fetch" the Object whose entry ID in the active Objects list is stored in User Register 4 to References 0, 1, and 2
:_Ref_All
: R4 ;Value stored in User Register 4
_FetchObject_Current
(Description)
#_FetchObject_Current ;"Fetch" the "Current Object" to Reference 0
:_Ref_Src0
; ----------
#_FetchObject_Current ;"Fetch" the "Current Object" to References 0 and 2
:_Ref_Src0_Dest
_FetchObject_LastSpawned
(Description)
#_FetchObject_LastSpawned ;"Fetch" the Object that was last Spawned to Reference 2
:_Ref_Dest
; ----------
#_FetchObject_LastSpawned ;"Fetch" the Object that was last Spawned to References 0, 1, and 2
:_Ref_All
_FetchObject_CurrentProjectile
(Description)
#_FetchObject_CurrentProjectile ;"Fetch" the "Current Projectile" to Reference 0
:_Ref_Src0
; ----------
#_FetchObject_CurrentProjectile ;"Fetch" the "Current Projectile" to References 0 and 2
:_Ref_Src0_Dest
_FetchObject_CurrentParent
(Description)
#_FetchObject_CurrentParent ;"Fetch" the "Parent Object" of the "Current Object" to Reference 2
:_Ref_Dest
; ----------
#_FetchObject_CurrentParent ;"Fetch" the "Parent Object" of the "Current Object" to References 0, 1, and 2
:_Ref_All
_FetchObject_CurrentChild
(Description)
#_FetchObject_CurrentChild ;"Fetch" "Child Object" 0 of the "Current Object" to References 0 and 2
:_Ref_Src0_Dest
: 0 ;Child Object 0
; ----------
#_FetchObject_CurrentChild ;"Fetch" the "Child Object" of the "Current Object" whose Entry ID in that Object's "Child List" is stored in User Register 1 to References 0, 1, and 2
:_Ref_All
: R1 ;Value of User Register 1
_FetchObject_FetchedParent
(Description)
#_FetchObject_FetchedParent ;"Fetch" the "Parent Object" of the Object currently "Fetched" to "Reference 0" to Reference 2
:_Ref_Dest
; ----------
#_FetchObject_FetchedParent ;"Fetch" the "Parent Object" of the Object currently "Fetched" to "Reference 0" to References 0, 1, and 2
:_Ref_All
_FetchObject_FetchedChild
(Description)
#_FetchObject_FetchedChild ;"Fetch" "Child Object" 0 of the Object currently "Fetched" to "Reference 0" to References 0 and 2
:_Ref_Src0_Dest
: 0 ;Child Object 0
; ----------
#_FetchObject_FetchedChild ;"Fetch" the "Child Object" of the Object currently "Fetched" to "Reference 0" whose Entry ID in that Object's "Child List" is stored in User Register 1 to References 0, 1, and 2
:_Ref_All
: R1 ;Value of User Register 1
_FetchObject_Reg
_FetchObject_CurrChr
_FetchObject_CurrObj
_FetchObject_FetchedChr
_FetchObject_FetchedObj
(Description)
#_FetchObject_Reg ;Fetch the Object whose pointer is stored in User Register 4 to Reference 0, Reference 1, and Reference 2
:_Ref_All
: U4 ;User Register 4
; ----------
#_FetchObject_CurrChr ;Fetch the Object whose pointer is stored in User-created "Active Variable" 32 of the "Current Player" to Reference 2
:_Ref_Dest
: a32 ;User-created "Active Variable" 32 of the "Current Player"
; ----------
#_FetchObject_FetchedObj ;Fetch the Object whose pointer is stored in "Extra Variable" 8 of the Object "Fetched" to Reference 0 to Reference 1 and Reference 2
:_Ref_Src1_Dest
: E8 ;"Extra Variable" 8 of the Object "Fetched" to Reference 0
_CopyFetch_Object
(Description)
#_CopyFetch_Object ;Fetch the Object Fetched to Reference 1 to Reference 2 [Both will reference the Object originally referenced by Reference 1]
:_Ref_Src1 ;(Src)
:_Ref_Dest ;(Dest)
; ----------
#_CopyFetch_Object ;Fetch the Object Fetched to Reference 2 to both Reference 0 and Reference 1 [All three will reference the Object originally referenced by Reference 2]
:_Ref_Dest ;(Src)
:Ref_Src0_Src1 ;(Dest)
_SwapFetch_Object
(Description)
#_SwapFetch_Object ;Swap the Objects that were Fetched to References 0 and 2 [Ex: If Reference 0 previously referenced Object 1, and Reference 2 previously referenced Object 2, then Reference 0 will now reference Object 2, and Reference 2 will now reference Object 1]
:_Swap_Src0_Dest ;
Parent/Child Relation:
#_Object_SetParent_Fetched ;Set the Object "Fetched" to "Reference 0" as the "Parent Object" of the Object "Fetched" to "Reference 2"
_Object_SetChild_Fetched
(Description)
#_Object_SetChild_Fetched ;Set the Object "Fetched" to "Reference 0" as the 5th "Child Object" of the Object "Fetched" to "Reference 2"
: 5 ;Child Object Entry 5
; ----------
#_Object_SetChild_Fetched ;Set the Object "Fetched" to "Reference 0" as a"Child Object" of the Object "Fetched" to "Reference 2", entered into that Object's "Child List" at the position specified by the value of User Register 7
: U7 ;Value stored in User Register 7
_Object_SetParent_Curr
(Description)
#_Object_SetParent_Curr ;Set the Object "Fetched" to "Reference 0" as the "Parent Object" of the "Current Object"
_Object_SetChild_Curr
(Description)
#_Object_SetChild_Curr ;Set the Object "Fetched" to "Reference 0" as the 2nd "Child Object" of the "Current Object"
: 2 ;Child Object Entry 2
; ----------
#_Object_SetChild_Curr ;Set the Object "Fetched" to "Reference 0" as a"Child Object" of the "Current Object", entered into that Object's "Child List" at the position specified by the value of User Register 8
: U8 ;Value stored in User Register 8
_Object_Fetched_DetachFromParent
_Object_Current_DetachFromParent
(Description)
#_Object_Fetched_DetachFromParent ;Remove the relationship between the Object "Fetched" to "Reference 0" and its current "Parent" from both Objects
; ----------
#_Object_Current_DetachFromParent ;Remove the relationship between the "Current Object" and its current "Parent" from both Objects
Projectile Collision Testing:
#_TestCollisions(CurrentProjectile) ;Cause the "Current Object" to become the "Current Projectile" and test for Collisions with all Objects within "Activity Range"
_TestCollisions(FetchedProjectile)
(Description)
#_TestCollisions(FetchedProjectile) ;Cause the Object "Fetched" to "Reference 2" to become the "Current Projectile" and test for Collisions with all Objects within "Activity Range"
Function Control:
_CallFunc_CurrObject_Const
_CallFunc_CurrObject_Obj
_RunFunc_CurrObject_Const
_RunFunc_CurrObject_Obj
_StopFunc_CurrObject_Const
_StopFunc_CurrObject_Obj
_CallFunc_FetchedObject_Const
_CallFunc_FetchedObject_Obj
_RunFunc_FetchedObject_Const
_RunFunc_FetchedObject_Obj
_StopFunc_FetchedObject_Const
_StopFunc_FetchedObject_Obj
(Description)
#_CallFunc_CurrObject_Const ;Cause the "Current Object" to queue Game-global Object Movement Function 10
: G10 ;Game-global Object MovementFunction 10
; ----------
#_RunFunc_CurrObject_Const ;Cause the "Current Object" to queue and immediately process the Object Movement Function whose "Full List ID" value is stored in User Register 2
: R2 ;Value stored in User Register 2"
; ----------
#_StopFunc_FetchedObject_Obj ;Cause the Object "Fetched" to "Reference 2" to remove from its queue the Object Movement Function whose "Full List ID" value is stored in "Extra Variable" 9 of the Object "Fetched" to "Reference 2"
: E9 ;"Extra Variable" 9 of the Object "Fetched" to "Reference 2"
_CallFunc_CurrObject_OConst
_RunFunc_CurrObject_OConst
_StopFunc_CurrObject_OConst
_CallFunc_FetchedObject_OConst
_RunFunc_FetchedObject_OConst
_StopFunc_FetchedObject_OConst
(Description)
#_CallFunc_CurrObject_OConst ;Cause the "Current Object" to queue the Object Movement Function whose ID is listed for "Constant" 10 of the Object Type's "Constant List" 0
: 0 ;(List ID) Object Type's "Constant List" 0
: 10 ;(Const ID) "Constant" 10 from the Object Type's "Constant List" 0
; ----------
#_RunFunc_CurrObject_OConst ;Cause the "Current Object" to queue and immediately process the Object Movement Function whose ID is listed for "Constant" 4 of the Object Type's "Constant List" 7
: 4 ;(List ID) Object Type's "Constant List" 4
: 7 ;(Const ID) "Constant" 7 from the Object Type's "Constant List" 4
; ----------
#_StopFunc_FetchedObject_OConst ;Cause the Object "Fetched" to "Reference 2" to remove from its queue the Object Movement Function whose ID is listed for "Constant" 2 of the Object Type's "Constant List" 1
: 2 ;(List ID) Object Type's "Constant List" 2
: 1 ;(Const ID) "Constant" 1 from the Object Type's "Constant List" 2
Object Pointers:
_Reg=Ptr(CurrObj)
_Chr=Ptr(CurrObj)
_Obj=Ptr(CurrObj)
_Reg=Ptr(FetchedObj)
_Chr=Ptr(FetchedObj)
_Obj=Ptr(FetchedObj)
(Description)
#_Reg=Ptr(CurrObj) ;Store a pointer to the "Current Object" in User Register 7
: U7 ;User Register 7
; ----------
#_Chr=Ptr(FetchedObj) ;Store a pointer to the Object "Fetched" to "Reference 0" in User-created "Active Variable" 11 of the Player "Fetched" to "Reference 2"
: a11 ;User-created "Active Variable" 11 of the Player "Fetched" to "Reference 2"
; ----------
#_Obj=Ptr(FetchedObj) ;Store a pointer to the Object "Fetched" to "Reference 0" in "Extra Variable" 0 of the Object "Fetched" to "Reference 2"
: E0 ;"Extra Variable" 0 of the Object "Fetched" to "Reference 2"
Object Suspension:
#_Object_StopCurrent ;"Destroy" the "Current Object" by stopping all of its Functions and Animations, and turning it into an intangible dummy that can still reset when out of activity range
: 20 ;Game-global Object Type 20 (Assumed to use no Built-in or Scripted Functions or Animations, and to be set to reset when outside of "Activity Range")
; ----------
#_Object_StopFetched ;"Destroy" the Object "Fetched" to "Reference 2) by stopping all of its Functions and Animations, and turning it into an intangible dummy that can still reset when out of activity range
: 15 ;Game-global Object Type 15 (Assumed to use no Built-in or Scripted Functions or Animations, and to be set to reset when outside of "Activity Range")
Collision Area:
#_Reg=Object_CollisionArea ;Obtain the "Collision Area" of the "Current Object" in relation to Player 1's screen, and store it in User Register 14
:_Player1 ;Player 1; the top/single screen
: U14 ;User Register 14
_Set_CurrObj(Reg)
_Set_CurrObj(Chr)
_Set_CurrObj(Obj)
(Description)
#>_Set_CurrObj(Reg) ;Set the Object whose pointer is stored in User Register 20 as the "Current Object"
: U20 ;User Register 20
; ----------
#_Set_CurrObj(Chr) ;Set the Object whose pointer is stored in User-created "Active Variable" 1 of the Player "Fetched" to "Reference 0" as the "Current Object"
: a1 ;User-created "Active Variable" 1 of the Player "Fetched" to "Reference 0"
; ----------
#_Set_CurrObj(Obj) ;Set the Object whose pointer is stored in "Extra Variable" 8 of the Object "Fetched" to "Reference 0" as the "Current Object"
: E8 ;"Extra Variable" 8 of the Object "Fetched" to "Reference 0"
Setting the "Current Projectile":
_Set_CurrProjectile(Reg)
_Set_CurrProjectile(Chr)
_Set_CurrProjectile(Obj)
(Description)
#_Set_CurrProjectile(Reg) ;Set the Object whose pointer is stored in User Register 20 as the "Current Projectile"
: U20 ;User Register 20
; ----------
#_Set_CurrProjectile(Chr) ;Set the Object whose pointer is stored in User-created "Active Variable" 1 of the Player "Fetched" to "Reference 0" as the "Current Projectile"
: a1 ;User-created "Active Variable" 1 of the Player "Fetched" to "Reference 0"
; ----------
#_Set_CurrProjectile(Obj) ;Set the Object whose pointer is stored in "Extra Variable" 8 of the Object "Fetched" to "Reference 0" as the "Current Projectile"
: E8 ;"Extra Variable" 8 of the Object "Fetched" to "Reference 0"
Collision Box Offsets:
_Chr=Object_Boundary_Offset
_Obj=Object_Boundary_Offset
(Description)
#_Chr=Object_Boundary_Offset ;Objtain the distance between the Right Side of the MainBounds Box of the "Current Player" and the Left Side of the MainBounds Box of the "Current Object", and place the value in User-created "Active Variable" 25 of the "Current Player"
:_BoxOff_Right ;(Chr)
:_BoxOff_Left ;(Obj)
: a25 ;(Dest) User-created "Active Variable" 25 of the "Current Player"
; ----------
#_Obj=Object_Boundary_Offset ;Objtain the distance between the Top Side of the MainBounds Box of the "Current Projectile" and the Top Side of the MainBounds Box of the "Current Object", and place the value in "Extra Variable" 10 of the "Current Projectile
:_BoxOff_Top ;(Chr)
:_BoxOff_Top ;(Obj)
: E10 ;(Dest) "Extra Variable" 10 of the "Current Projectile"
Drawing:
#_Debug_Draw ;Draw Sprite Frame 0 of Sprite Set 0 of the "Current Object" at an offset of -16,-8 from the Object's current X/Y Position, with normal orientation
: 0 ;(Set)
: 0 ;(Frame)
: -16 ;(XOff)
: -8 ;(YOff)
:_Draw_Normal ;(Dir) Normal
; ----------
#_Debug_Draw ;Using the Sprite Frame whose ID is stored in User Register 5, and the Sprite Set whose ID is stored in User Register 6, draw a Sprite from the "Current Object" using the values of User Registers 7 and 8 as X and Y offsets from the Object's current X/Y Position, with flipped and mirrored orientation
: R5 ;(Set) Value of User Register 5
: R6 ;(Frame) Value of User Register 6
: R7 ;(XOff) Value of User Register 7
: R8 ;(YOff) Value of User Register 8
:_Draw_HVFlip ;(Dir) Flipped and Mirrored