1#ifndef ALCHEMY_SCRIPT_MOTION_H
2#define ALCHEMY_SCRIPT_MOTION_H
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
A field object as the motion code sees it: its script, position, motion toward a target,...
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
s32 terrainHeight
16.16 fixed-point pixels
s32 targetX
16.16 fixed-point pixels; 0x80000000 when unset
u8 unk57
the object script's last flag test; not named here
s32 x
16.16 fixed-point pixels
u8 arrivalAxis
the ARRIVAL_AXIS_* that decides arrival
u16 scriptCursor
in words; read signed
s32 velocityY
16.16 fixed-point pixels per frame
s32 speedLimit
16.16 fixed-point pixels per frame
u8 paused
nonzero skips its script and motion, not its hook
void(*) hook(union FieldObject *object)
Called each frame before its script.
u8 collisionFlags
bit 7: a solid object refuses its move
u8 unk23
FieldActor.priorityFlags; not named here.
u8 unk5c[2]
The flag that keeps its sprite's VRAM, and the object script's SC_LOOP count; not named here.
u8 refused
frames in a row a solid object refused its move
s32 velocityX
16.16 fixed-point pixels per frame
s32 targetY
16.16 fixed-point pixels; 0x80000000 when unset
u8 motionFlags
bits: 4 no slowdown on slopes | 3 bigger float | 2 floats | 1 falls | 0 follows the terrain; zero is ...
const ScriptMotionWords * script
null when the object is free
u8 unk62[10]
Two bytes scene code uses, the action parameter, the footprint side and the linked object; not named ...
s32 gravity
Taken off velocityY each frame above the ground, 16.16 fixed-point pixels per frame; also scales a fl...
u8 unk18[0x0a]
the x and y scales and the radius; not named here
union ScriptMotionObject::@251026000204114031114155171320036163006104311101 vertical
u8 terrainId
the map layer whose ground height it follows
u8 steeringFlags
bit 0: turns toward its velocity, 1/16 turn a frame
s16 wait
frames left before its script runs again
u8 frozen
nonzero skips steering, terrain, gravity and floating
u8 snapToTarget
nonzero lands it exactly on its target
s32 y
16.16 fixed-point pixels
s32 z
16.16 fixed-point pixels
s32 targetZ
16.16 fixed-point pixels; 0x80000000 when unset
u8 unk4c[9]
A spare word, the sprite pointer and the sprite kind; not named here.
s32 velocityZ
16.16 fixed-point pixels per frame
The words of an object's script, as its script pointer reads them.
The integer types, TRUE, UNUSED and the fixed-address macros.
An object on the field, read as an actor or as an effect.
s32 phase
A floating object's step along gScriptObject_CycleTable, low six bits.
s32 bounce
The share of the falling speed kept on landing, 16.16 fixed point.