One of the 64 field objects in the object pool (heap slot 5): its script, position, motion toward a target, animation and update callback. More...
#include <object_runtime.h>
Data Fields | |
| s32 * | script |
| the object script it runs; null when the object is free | |
| s16 | step |
| the script cursor, in words | |
| u16 | angle |
| 1/65536 turns | |
| s32 | x |
| 16.16 fixed-point pixels | |
| s32 | y |
| 16.16 fixed-point pixels | |
| s32 | z |
| 16.16 fixed-point pixels | |
| s32 | terrainHeight |
| 16.16 fixed-point pixels | |
| u8 | unk18 [0x08] |
| the x and y scales, FieldActor.scaleX and scaleY | |
| u16 | radius |
| collision radius in pixels | |
| u8 | terrainId |
| the map layer its ground height is read from | |
| u8 | priorityFlags |
| FieldActor.priorityFlags: 1 for placed actors, 2 for footprints. | |
| s32 | velocityX |
| 16.16 fixed-point pixels per frame | |
| s32 | velocityY |
| 16.16 fixed-point pixels per frame | |
| s32 | velocityZ |
| 16.16 fixed-point pixels per frame | |
| s32 | speedLimit |
| 16.16 fixed-point pixels per frame | |
| s32 | acceleration |
| Added toward the target each frame, or taken off the speed when there is none, in 16.16 fixed-point pixels per frame; 0x10000 when created. | |
| s32 | targetX |
| 16.16 fixed-point pixels; 0x80000000 when unset | |
| s32 | targetY |
| 16.16 fixed-point pixels; 0x80000000 when unset | |
| s32 | targetZ |
| 16.16 fixed-point pixels; 0x80000000 when unset | |
| u8 | unk44 [0x0c] |
| FieldActor's bounce and gravity, and a word FieldObject_Create zeroes. | |
| void * | animation |
| its sprite, or its list of four, by animationKind | |
| u8 | animationKind |
| Low four bits: 0 no sprite, 1 one sprite, 2 a group of up to four. | |
| u8 | flags |
| FieldActor.motionFlags: 3 when created, 4 for a placed actor above the ground; zero is free flight in 3D. | |
| u8 | arrivalAxis |
| the ARRIVAL_AXIS_* that decides arrival | |
| u8 | conditionResult |
| the object script's last flag test | |
| u8 | snapToTarget |
| nonzero lands it exactly on its target | |
| u8 | collisionFlags |
| FieldActor.collisionFlags: bit 0 solid, bit 1 the player pushes it, bits 2 to 4 for talk and Psynergy targets; placed actors take 1. | |
| u8 | actionFlags |
| FieldActor.steeringFlags: bit 0 faces its motion. | |
| u8 | movementState |
| nonzero skips its script and motion (paused) | |
| u8 | unk5c [0x02] |
| Byte 0, when nonzero, keeps its sprite's VRAM cache entry while sprites are suspended or it is off screen; byte 1 is the object script's SC_LOOP count. | |
| u16 | wait |
| the object script's wait, in frames | |
| void * | callback |
| Not named by TBS code through this struct. | |
| s16 | action |
| The parameter its action script reads (a follow distance or an angle), or the player's frames to its next footprint. | |
| s16 | footprintSide |
| the side of the player's next footprint (2 after a stop) | |
| struct ObjectRuntime * | linkedObject |
| The object its action script follows or faces. | |
| u8 | unk6c [0x04] |
| The update hook (FieldActor.update), which the unused ObjectDispatch_SetUpdateValue sets as a word. | |
One of the 64 field objects in the object pool (heap slot 5): its script, position, motion toward a target, animation and update callback.
Definition at line 14 of file object_runtime.h.
| s32* ObjectRuntime::script |
the object script it runs; null when the object is free
Definition at line 15 of file object_runtime.h.
Referenced by Camera_FollowLeaderInBounds(), FieldObject_UpdatePlayerControl(), Object_FindNearestFacingTarget(), Object_SetTargetAndCallback(), ObjectDispatch_ApplyValueToKind200Children(), ObjectDispatch_FindFreeObject(), Scene_TalkToActor(), ScriptObject_CheckOverlap(), and ScriptObject_FindOverlappingEntry().
| s16 ObjectRuntime::step |
the script cursor, in words
Definition at line 16 of file object_runtime.h.
Referenced by Camera_FollowLeaderInBounds(), ObjectMotion_MoveTowardTarget(), and Scene_TalkToActor().
| u16 ObjectRuntime::angle |
1/65536 turns
Definition at line 17 of file object_runtime.h.
Referenced by FacingObject_TurnPairToFaceEachOther(), Field_FindNearbyPsynergyTarget(), Field_FindNearbyTalkTarget(), Field_GetCollisionAheadOfLeader(), Field_TryJumpForward(), FieldObject_UpdatePlayerControl(), ItemDisplay_RaiseAboveLeader(), Object_FindNearestFacingTarget(), Object_MoveOnWorldMap(), ObjectMotion_ArmCallback(), and ObjectMotion_SetAngleToward().
| s32 ObjectRuntime::x |
16.16 fixed-point pixels
Definition at line 18 of file object_runtime.h.
Referenced by Actor_JumpDownLedge(), BattleEffect_ClearOutOfBoundsObjects(), BattleFx_RunCondemn(), BattleFx_RunPlanetDiver(), BattleFx_SteerLiftedTarget(), BattleFx_SteerPushedTarget(), BattleFx_UpdateDriftingFallObject(), BattleFx_UpdateRadialSpread(), BattleFx_UpdateRandomTargetParticle(), Camera_FollowActor(), Camera_FollowLeaderInBounds(), Camera_FollowObject(), Camera_MoveWithinMapBounds(), DisplayTransition_UpdateScanlineTable(), Event_ShowSpeakerMessage(), Event_SpawnObjectTable(), FacingObject_TurnPairToFaceEachOther(), Field_ClimbDown(), Field_ClimbUp(), Field_FindNearbyPsynergyTarget(), Field_FindNearbyTalkTarget(), Field_GetCollisionAheadOfLeader(), Field_ProcessStep(), Field_RequestBattleFromEncounterTable(), Field_RequestDjinnBattle(), Field_TryJumpForward(), Field_UpdateObjectVisibilityBounds(), FieldEffect_SpawnNearbyMarkers(), FieldEffect_WatchLeaderDistance(), FieldFx_CheckCloakTile(), FieldObject_PlaceSceneActors(), FieldObject_UpdatePlayerControl(), ItemDisplay_EmitSparkles(), ItemDisplay_RaiseAboveLeader(), Marker_MoveLeaderAway(), Marker_SetActorPosition(), Motion_LaunchFromFocusedObject(), Motion_SetTargetPositionFromMagnitudeAngle(), Object_ApproachLinkedObject(), Object_FindNearestFacingTarget(), Object_MoveByKeys(), Object_MoveOnWorldMap(), Object_PlaceCurrentWithinCameraBounds(), Object_SetMoveTarget(), Object_Spawn(), ObjectEffect_EndContextEffect(), ObjectMotion_MoveTowardTarget(), ObjectMotion_ResetAndSetPosition(), ObjectMotion_ResetAndSetPositionInMode2(), ObjectMotion_SetAngleToward(), ObjectMotion_SetHorizontalPositionWithTerrain(), ObjectMotion_SetPositionAndCommit(), ObjectMotion_SetPositionAndReset(), ObjectMotion_SetPositionWithTerrain(), ObjectMotion_SnapToTerrain(), ObjectMotion_TurnTowardLinkedTarget(), ObjectTable_ResetForObject(), Scene_TalkToActor(), Script_ApplyPositionCommand(), ScriptObject_CheckOverlap(), ScriptObject_FindOverlappingEntry(), and UiText_OpenMessageAtObject().
| s32 ObjectRuntime::y |
16.16 fixed-point pixels
Definition at line 19 of file object_runtime.h.
Referenced by Actor_JumpDownLedge(), BattleFx_UpdateDriftingFallObject(), BattleFx_UpdateRadialSpread(), BattleFx_UpdateRandomTargetParticle(), Camera_FollowLeaderInBounds(), Camera_FollowObject(), Camera_MoveWithinMapBounds(), DisplayTransition_UpdateScanlineTable(), Event_ShowSpeakerMessage(), Event_SpawnObjectTable(), Field_ClimbDown(), Field_ClimbUp(), Field_FindNearbyPsynergyTarget(), Field_FindNearbyTalkTarget(), Field_GetCollisionAheadOfLeader(), Field_TryJumpForward(), Field_UpdateObjectVisibilityBounds(), FieldEffect_WatchLeaderDistance(), FieldFx_CheckCloakTile(), FieldObject_PlaceSceneActors(), FieldObject_UpdatePlayerControl(), ItemDisplay_EmitSparkles(), ItemDisplay_RaiseAboveLeader(), Motion_SetTargetPositionFromMagnitudeAngle(), Object_ApproachLinkedObject(), Object_FindNearestFacingTarget(), Object_MoveByKeys(), Object_MoveOnWorldMap(), Object_SetMoveTarget(), Object_Spawn(), ObjectEffect_EndContextEffect(), ObjectEffect_RunPendingFlagEvent(), ObjectMotion_MoveTowardTarget(), ObjectMotion_SetPositionWithTerrain(), ObjectMotion_SnapToTerrain(), ObjectTable_ResetForObject(), ObjectTable_Restore(), Scene_TalkToActor(), Script_ApplyPositionCommand(), and UiText_OpenMessageAtObject().
| s32 ObjectRuntime::z |
16.16 fixed-point pixels
Definition at line 20 of file object_runtime.h.
Referenced by BattleEffect_ClearOutOfBoundsObjects(), BattleFx_RunCondemn(), BattleFx_RunPlanetDiver(), BattleFx_SteerLiftedTarget(), BattleFx_SteerPushedTarget(), BattleFx_UpdateRadialSpread(), BattleFx_UpdateRandomTargetParticle(), Camera_FollowLeaderInBounds(), Camera_FollowObject(), Camera_MoveWithinMapBounds(), DisplayTransition_UpdateScanlineTable(), Event_SpawnObjectTable(), FacingObject_TurnPairToFaceEachOther(), Field_ClimbDown(), Field_ClimbUp(), Field_FindNearbyPsynergyTarget(), Field_FindNearbyTalkTarget(), Field_GetCollisionAheadOfLeader(), Field_TryJumpForward(), FieldEffect_SpawnNearbyMarkers(), FieldEffect_WatchLeaderDistance(), FieldFx_CheckCloakTile(), FieldObject_PlaceSceneActors(), FieldObject_UpdatePlayerControl(), ItemDisplay_EmitSparkles(), ItemDisplay_RaiseAboveLeader(), Marker_MoveLeaderAway(), Marker_SetActorPosition(), Motion_LaunchFromFocusedObject(), Motion_SetTargetPositionFromMagnitudeAngle(), Object_ApproachLinkedObject(), Object_FindNearestFacingTarget(), Object_MoveOnWorldMap(), Object_PlaceCurrentWithinCameraBounds(), Object_SetMoveTarget(), Object_Spawn(), ObjectEffect_EndContextEffect(), ObjectMotion_MoveTowardTarget(), ObjectMotion_ResetAndSetPosition(), ObjectMotion_ResetAndSetPositionInMode2(), ObjectMotion_SetAngleToward(), ObjectMotion_SetHorizontalPositionWithTerrain(), ObjectMotion_SetPositionAndCommit(), ObjectMotion_SetPositionAndReset(), ObjectMotion_SetPositionWithTerrain(), ObjectMotion_SnapToTerrain(), ObjectMotion_TurnTowardLinkedTarget(), ObjectTable_ResetForObject(), Scene_TalkToActor(), and Script_ApplyPositionCommand().
| s32 ObjectRuntime::terrainHeight |
16.16 fixed-point pixels
Definition at line 21 of file object_runtime.h.
Referenced by BattleFx_UpdateDriftingFallObject(), Colosso_RestoreCompetitor(), FieldObject_PlaceSceneActors(), FieldObject_UpdatePlayerControl(), Object_Spawn(), ObjectEffect_RunPendingFlagEvent(), ObjectMotion_SetHorizontalPositionWithTerrain(), ObjectMotion_SetPositionWithTerrain(), ObjectMotion_SnapToTerrain(), ObjectTable_ResetForObject(), and ObjectTable_Restore().
| u8 ObjectRuntime::unk18[0x08] |
the x and y scales, FieldActor.scaleX and scaleY
Definition at line 22 of file object_runtime.h.
| u16 ObjectRuntime::radius |
collision radius in pixels
Definition at line 23 of file object_runtime.h.
Referenced by FieldObject_UpdatePlayerControl().
| u8 ObjectRuntime::terrainId |
the map layer its ground height is read from
Definition at line 24 of file object_runtime.h.
Referenced by FieldFx_CheckCloakTile(), Map_CheckObjectStep(), Object_MoveByKeys(), ObjectMotion_SetHorizontalPositionWithTerrain(), and ObjectMotion_SetPositionWithTerrain().
| u8 ObjectRuntime::priorityFlags |
FieldActor.priorityFlags: 1 for placed actors, 2 for footprints.
Definition at line 26 of file object_runtime.h.
| s32 ObjectRuntime::velocityX |
16.16 fixed-point pixels per frame
Definition at line 27 of file object_runtime.h.
Referenced by BattleFx_SteerLiftedTarget(), BattleFx_SteerPushedTarget(), FieldObject_UpdatePlayerControl(), and Object_MoveOnWorldMap().
| s32 ObjectRuntime::velocityY |
16.16 fixed-point pixels per frame
Definition at line 28 of file object_runtime.h.
Referenced by Field_ProcessStep(), Field_TryJumpForward(), ItemDisplay_EmitSparkles(), and ObjectEffect_RunPendingFlagEvent().
| s32 ObjectRuntime::velocityZ |
16.16 fixed-point pixels per frame
Definition at line 29 of file object_runtime.h.
Referenced by BattleFx_SteerLiftedTarget(), BattleFx_SteerPushedTarget(), FieldObject_UpdatePlayerControl(), and Object_MoveOnWorldMap().
| s32 ObjectRuntime::speedLimit |
16.16 fixed-point pixels per frame
Definition at line 30 of file object_runtime.h.
Referenced by Camera_FollowLeaderInBounds(), Camera_SetSpeedParameters(), Field_ProcessStep(), Field_TryJumpForward(), Object_ApproachLinkedObject(), Object_SetMoveTarget(), Object_SetTargetAndCallback(), ObjectEffect_EndContextEffect(), and ObjectMotion_SetSpeedParameters().
| s32 ObjectRuntime::acceleration |
Added toward the target each frame, or taken off the speed when there is none, in 16.16 fixed-point pixels per frame; 0x10000 when created.
Definition at line 33 of file object_runtime.h.
Referenced by BattleFx_SteerLiftedTarget(), BattleFx_SteerPushedTarget(), Camera_SetSpeedParameters(), Field_TryJumpForward(), FieldFx_RunForce(), Object_ApproachLinkedObject(), Object_SetMoveTarget(), Object_SetTargetAndCallback(), ObjectEffect_EndContextEffect(), and ObjectMotion_SetSpeedParameters().
| s32 ObjectRuntime::targetX |
16.16 fixed-point pixels; 0x80000000 when unset
Definition at line 34 of file object_runtime.h.
Referenced by BattleFx_SetCallbackWhenTargetUnset(), Camera_FollowLeaderInBounds(), Field_ProcessStep(), Marker_MoveLeaderAway(), and Scene_TalkToActor().
| s32 ObjectRuntime::targetY |
16.16 fixed-point pixels; 0x80000000 when unset
Definition at line 35 of file object_runtime.h.
Referenced by BattleFx_SetCallbackWhenTargetUnset(), Camera_FollowLeaderInBounds(), Marker_MoveLeaderAway(), and Scene_TalkToActor().
| s32 ObjectRuntime::targetZ |
16.16 fixed-point pixels; 0x80000000 when unset
Definition at line 36 of file object_runtime.h.
Referenced by BattleFx_SetCallbackWhenTargetUnset(), Camera_FollowLeaderInBounds(), Marker_MoveLeaderAway(), Object_IsTargetUnset(), and Scene_TalkToActor().
| u8 ObjectRuntime::unk44[0x0c] |
FieldActor's bounce and gravity, and a word FieldObject_Create zeroes.
Definition at line 38 of file object_runtime.h.
| void* ObjectRuntime::animation |
its sprite, or its list of four, by animationKind
Definition at line 39 of file object_runtime.h.
Referenced by Actor_WaitForAnimationEnd(), BattleFx_SetupObjectPair(), Event_SpawnObjectTable(), Field_TryJumpForward(), FieldFx_EndCloak(), FieldFx_StartCloak(), FieldObject_UpdatePlayerControl(), Object_FindNearestFacingTarget(), Object_GetScreenPosition(), Object_MoveOnWorldMap(), Object_SetModeById(), ObjectEffect_EndContextEffect(), ObjectGroup_ApplyRandomChildValues(), ObjectTable_FindActiveByValue(), ObjectTable_ReadActiveValue(), ObjectTable_ResetForObject(), ObjectTable_Restore(), and ObjectTable_Snapshot().
| u8 ObjectRuntime::animationKind |
Low four bits: 0 no sprite, 1 one sprite, 2 a group of up to four.
Definition at line 41 of file object_runtime.h.
Referenced by Actor_WaitForAnimationEnd(), Event_SpawnObjectTable(), Field_ClimbUp(), Field_TryJumpForward(), Marker_Hide(), Object_FindNearestFacingTarget(), Object_GetScreenPosition(), Object_MoveOnWorldMap(), Object_Spawn(), ObjectGroup_ApplyRandomChildValues(), ObjectMotion_SetActionVariant(), ObjectMotion_WaitForAnimationChange(), ObjectTable_FindActiveByValue(), ObjectTable_ReadActiveValue(), and ObjectTable_Snapshot().
| u8 ObjectRuntime::flags |
FieldActor.motionFlags: 3 when created, 4 for a placed actor above the ground; zero is free flight in 3D.
Definition at line 44 of file object_runtime.h.
Referenced by Actor_JumpDownLedge(), Camera_FollowLeaderInBounds(), EffectRuntime_RunRisingObjectSequence(), Field_TryJumpForward(), FieldObject_PlaceSceneActors(), ItemDisplay_EmitSparkles(), Object_IsTargetUnset(), Object_SetMoveTarget(), and SpawnHeavyImpactEffect().
| u8 ObjectRuntime::arrivalAxis |
the ARRIVAL_AXIS_* that decides arrival
Definition at line 45 of file object_runtime.h.
| u8 ObjectRuntime::conditionResult |
the object script's last flag test
Definition at line 46 of file object_runtime.h.
| u8 ObjectRuntime::snapToTarget |
nonzero lands it exactly on its target
Definition at line 47 of file object_runtime.h.
Referenced by Object_SetMoveTarget().
| u8 ObjectRuntime::collisionFlags |
FieldActor.collisionFlags: bit 0 solid, bit 1 the player pushes it, bits 2 to 4 for talk and Psynergy targets; placed actors take 1.
Definition at line 50 of file object_runtime.h.
Referenced by Field_FindNearbyPsynergyTarget(), Field_FindNearbyTalkTarget(), FieldObject_UpdatePlayerControl(), Object_SetTargetAndCallback(), ScriptObject_CheckOverlap(), and ScriptObject_FindOverlappingEntry().
| u8 ObjectRuntime::actionFlags |
FieldActor.steeringFlags: bit 0 faces its motion.
Definition at line 51 of file object_runtime.h.
Referenced by Scene_TalkToActor().
| u8 ObjectRuntime::movementState |
nonzero skips its script and motion (paused)
Definition at line 52 of file object_runtime.h.
Referenced by BattleFx_ClearChildValueOnMismatch(), BattleFx_DispatchRequestKind(), FieldObject_UpdatePlayerControl(), Map_ShowWorldMap(), Scene_TalkToActor(), WorldMap_BeginEvent(), and WorldMap_EndEvent().
| u8 ObjectRuntime::unk5c[0x02] |
Byte 0, when nonzero, keeps its sprite's VRAM cache entry while sprites are suspended or it is off screen; byte 1 is the object script's SC_LOOP count.
Definition at line 56 of file object_runtime.h.
| u16 ObjectRuntime::wait |
the object script's wait, in frames
Definition at line 57 of file object_runtime.h.
Referenced by Object_LinkPair(), ObjectMotion_ArmCallback(), ObjectMotion_SetAngleToward(), and SpawnHeavyImpactEffect().
| void* ObjectRuntime::callback |
Not named by TBS code through this struct.
Its bytes are the frames a solid object has refused the object's move and the frozen flag (ScriptMotionObject's refused and frozen), then two bytes scene code uses.
Definition at line 62 of file object_runtime.h.
| s16 ObjectRuntime::action |
The parameter its action script reads (a follow distance or an angle), or the player's frames to its next footprint.
Definition at line 65 of file object_runtime.h.
Referenced by Camera_FollowLeaderInBounds(), FieldObject_UpdatePlayerControl(), Motion_LaunchFromFocusedObject(), Object_MoveOnWorldMap(), Object_SetActionCallbackAndRefreshById(), Object_SetTargetAndCallback(), ObjectMotion_EnableActionAndSetCallback(), ObjectMotion_SetActionCallback(), ObjectMotion_StepAngle(), Scene_TalkToActor(), and Shop_Run().
| s16 ObjectRuntime::footprintSide |
the side of the player's next footprint (2 after a stop)
Definition at line 66 of file object_runtime.h.
Referenced by FieldObject_UpdatePlayerControl().
| struct ObjectRuntime* ObjectRuntime::linkedObject |
The object its action script follows or faces.
Definition at line 69 of file object_runtime.h.
Referenced by Camera_FollowLeaderInBounds(), Camera_FollowObject(), Object_ApproachLinkedObject(), Object_SetTargetAndCallback(), ObjectMotion_MoveTowardTarget(), ObjectMotion_TurnTowardLinkedTarget(), and Scene_TalkToActor().
| u8 ObjectRuntime::unk6c[0x04] |
The update hook (FieldActor.update), which the unused ObjectDispatch_SetUpdateValue sets as a word.
Definition at line 72 of file object_runtime.h.
Referenced by ObjectDispatch_SetUpdateValue().