Skip to Content
The Alchemy Project

struct MOTION_OBJECT

An effect object that moves and draws one sprite: its position, scale, velocity and target, and its per-tick update. More…

Declared in battle_actor.h.

Fields

NameDescription
const Sint32 *scriptThe object script it runs; null when it is free.
Sint16scriptCursorThe script cursor, in words.
Uint16angle1/65536 turns.
FIXEDx16.16 fixed-point pixels.
FIXEDy16.16 fixed-point pixels.
FIXEDz16.16 fixed-point pixels.
FIXEDgroundHeight16.16 fixed-point pixels.
FIXEDscaleX16.16 fixed point, toFIXED(1) full size.
FIXEDscaleY16.16 fixed point, toFIXED(1) full size.
Uint16heightNo code names it through this view.
Uint8layerThe map layer its ground height is read from.
Uint8priorityFlagsACTOR_PRIORITY_FLAG bits.
FIXEDvelocityX16.16 fixed-point pixels per tick.
FIXEDvelocityY16.16 fixed-point pixels per tick.
FIXEDvelocityZ16.16 fixed-point pixels per tick.
FIXEDspeedLimit16.16 fixed-point pixels per tick.
FIXEDaccelerationHorizontal speed gained each tick towards the target, or lost braking without one, in 16.16 fixed-point pixels per tick.
FIXEDtargetX16.16 fixed-point pixels; 0x80000000 for no target.
FIXEDtargetY16.16 fixed-point pixels.
FIXEDtargetZ16.16 fixed-point pixels.
FIXEDverticalMotionPhaseWith motionFlags bit 1, the 16.16 share of velocityY kept on a bounce.
FIXEDverticalMotionStrengthGravity: taken from velocityY each tick above the ground with motionFlags bit 1, in 16.16 fixed-point pixels per tick.
Sint32sceneWordACTOR's; no battle code names it.
void *recordsOne sprite, or a table of them (recordStorageKind).
Uint8recordStorageKindbits: 3..0 how records holds the sprites
Uint8motionFlagsbits: 1 falls under gravity and bounces | 0 follows the terrain
Uint8arrivalAxisThe ARRIVAL_AXIS_* watched for arrival at the target, as ACTOR's.
Uint8conditionResultThe object script's last flag test.
Uint8snapToTargetNonzero: lands exactly on the target.
Uint8collisionFlagsACTOR_COLLISION_FLAG bits.
Uint8autoFaceMotionBit 0 turns the object to face where it moves.
Uint8pausedNonzero: the motion update leaves it where it is.
Uint8retainSpriteCacheKeeps its sprite's VRAM cache entry.
Uint8repeatCountThe object script's loop count.
Sint16waitThe object script's wait, in ticks.
void *callbackACTOR's hook; no battle code names it.
Sint32timerACTOR's timer and userValue; no battle code names it.
struct ACTOR *watchedActor
void (*update )(union FIELD_OBJECT *object)

Description

An effect object that moves and draws one sprite: its position, scale, velocity and target, and its per-tick update. It is one of the object slots the field engine's FIELD_ACTOR also describes.

struct MOTION_OBJECT

Referenced by btActorDetachSpriteScripts(), btActorGetSprite(), btAutoBattleRunAttackOrItem(), btAutoBattleRunPsynergy(), btCameraSetViewAtPairMidpoint(), btEffectRunAnnihilation(), btEffectRunAttackSlash(), btEffectRunAzul(), btEffectRunBackstab(), btEffectRunBind(), btEffectRunBreak(), btEffectRunBurstShower(), btEffectRunCastingImpact(), btEffectRunCriticalHit(), btEffectRunCruelRuin(), btEffectRunCrystal(), btEffectRunCybele(), btEffectRunDjinnBeams(), btEffectRunDjinnHeal(), btEffectRunDjinniCharge(), btEffectRunDjinniEntrance(), btEffectRunDrainMotes(), btEffectRunFire(), btEffectRunFirePuppet(), btEffectRunFlashingStrike(), btEffectRunFlurry(), btEffectRunFroth(), btEffectRunGaspFamily(), btEffectRunGatheringLights(), btEffectRunGround(), btEffectRunHaunt(), btEffectRunHealingMotes(), btEffectRunLeapingStrike(), btEffectRunLightSurge(), btEffectRunLobbedShells(), btEffectRunMegiddo(), btEffectRunMoteFountain(), btEffectRunNereid(), btEffectRunNereidCopy(), btEffectRunNirvana(), btEffectRunOdyssey(), btEffectRunPlumeEdge(), btEffectRunProcne(), btEffectRunProjectileVolley(), btEffectRunQuake(), btEffectRunRadiantFire(), btEffectRunRagnarok(), btEffectRunRisingDragonEnemy(), btEffectRunRushingStrike(), btEffectRunSerac() and 53 more.

Definition at line 19 of file battle_actor.h.

Fields in detail

script

const Sint32 *script

The object script it runs; null when it is free.

scriptCursor

Sint16 scriptCursor

The script cursor, in words.

angle

Uint16 angle

1/65536 turns.

x

FIXED x

16.16 fixed-point pixels.

y

FIXED y

16.16 fixed-point pixels.

z

FIXED z

16.16 fixed-point pixels.

groundHeight

FIXED groundHeight

16.16 fixed-point pixels.

scaleX

FIXED scaleX

16.16 fixed point, toFIXED(1) full size.

scaleY

FIXED scaleY

16.16 fixed point, toFIXED(1) full size.

height

Uint16 height

No code names it through this view.

layer

Uint8 layer

The map layer its ground height is read from.

priorityFlags

Uint8 priorityFlags

ACTOR_PRIORITY_FLAG bits.

velocityX

FIXED velocityX

16.16 fixed-point pixels per tick.

velocityY

FIXED velocityY

16.16 fixed-point pixels per tick.

velocityZ

FIXED velocityZ

16.16 fixed-point pixels per tick.

speedLimit

FIXED speedLimit

16.16 fixed-point pixels per tick.

acceleration

FIXED acceleration

Horizontal speed gained each tick towards the target, or lost braking without one, in 16.16 fixed-point pixels per tick.

targetX

FIXED targetX

16.16 fixed-point pixels; 0x80000000 for no target.

targetY

FIXED targetY

16.16 fixed-point pixels.

targetZ

FIXED targetZ

16.16 fixed-point pixels.

verticalMotionPhase

FIXED verticalMotionPhase

With motionFlags bit 1, the 16.16 share of velocityY kept on a bounce.

verticalMotionStrength

FIXED verticalMotionStrength

Gravity: taken from velocityY each tick above the ground with motionFlags bit 1, in 16.16 fixed-point pixels per tick.

sceneWord

Sint32 sceneWord

ACTOR's; no battle code names it.

records

void *records

One sprite, or a table of them (recordStorageKind).

recordStorageKind

Uint8 recordStorageKind

bits: 3..0 how records holds the sprites

motionFlags

Uint8 motionFlags

bits: 1 falls under gravity and bounces | 0 follows the terrain

arrivalAxis

Uint8 arrivalAxis

The ARRIVAL_AXIS_* watched for arrival at the target, as ACTOR's.

conditionResult

Uint8 conditionResult

The object script's last flag test.

snapToTarget

Uint8 snapToTarget

Nonzero: lands exactly on the target.

collisionFlags

Uint8 collisionFlags

ACTOR_COLLISION_FLAG bits.

autoFaceMotion

Uint8 autoFaceMotion

Bit 0 turns the object to face where it moves.

paused

Uint8 paused

Nonzero: the motion update leaves it where it is.

retainSpriteCache

Uint8 retainSpriteCache

Keeps its sprite's VRAM cache entry.

repeatCount

Uint8 repeatCount

The object script's loop count.

wait

Sint16 wait

The object script's wait, in ticks.

callback

void *callback

ACTOR's hook; no battle code names it.

timer

Sint32 timer

ACTOR's timer and userValue; no battle code names it.

watchedActor

struct ACTOR *watchedActor

update

void (*update)(union FIELD_OBJECT *object)