Alchemy
Loading...
Searching...
No Matches

ScriptOperands Struct Reference

The whole 0x70-byte slot as SC_SET, SC_ADD and SC_CMP see it: each field is one work value (enum ScriptWork in objcmd.h), reached through gScript_OperandHandlerTable, and named for what the engine keeps there. More...

#include <field/script.h>

Data Fields

u32 scriptAddress
 SW_SCRIPT; an add steps it by whole words.
u16 cursor
 SW_CURSOR, compared as signed.
u16 facing
 SW_FACING, and work values 2 and 4.
u32 x
 SW_X, 16.16 fixed-point pixels.
u32 y
 SW_Y.
u32 z
 SW_Z.
u32 terrainHeight
 SW_GROUND.
u32 scaleX
 SW_SCALE_X, 16.16 fixed point.
u32 scaleY
 SW_SCALE_Y, and work value 0x0b.
u16 radius
 SW_RADIUS, in pixels; compared as signed.
u8 padding22 [2]
 the layer and priority flags; no work value
u32 velocityX
 SW_VELOCITY_X, 16.16 fixed-point pixels per frame.
u32 velocityY
 SW_VELOCITY_Y.
u32 velocityZ
 SW_VELOCITY_Z.
u32 speedLimit
 SW_SPEED.
u32 acceleration
 SW_ACCEL.
u32 targetX
 SW_TARGET_X; 0x80000000 when unset.
u32 targetY
 SW_TARGET_Y.
u32 targetZ
 SW_TARGET_Z.
u32 bounce
 SW_BOUNCE, or a floating object's phase.
u32 gravity
 SW_GRAVITY.
u32 sceneWord
 Work value 0x17: the word FieldObject_Create zeroes and only scene code reads.
u32 sprite
 work value 0x18: the sprite, or its list of four
u8 spriteStorageKind
 work value 0x19: 0 hidden, 1 one, 2 a group
u8 motionFlags
 SW_MOTION, ActorMotionFlag bits.
u8 arrivalAxis
 SW_ARRIVAL.
u8 conditionResult
 SW_RESULT, the last test; every compare sets it.
u8 snapToTarget
 SW_SNAP.
u8 collisionFlags
 SW_COLLISION.
u8 steeringFlags
 SW_STEERING.
u8 paused
 SW_PAUSED.
u8 byte5c
 keeps the sprite's VRAM; no work value
u8 repeatCount
 SW_REPEAT, SC_LOOP's count.
u16 wait
 SW_WAIT, compared as signed.
u8 refused
 ScriptInterpreter.refused; no work value.
u8 frozen
 ScriptMotionObject.frozen; no work value.
u8 sceneByte62
 work value 0x27, kept by scene code
u8 sceneByte63
 work value 0x28, kept by scene code
s16 actionParameter
 work value 0x23, what its action script reads
s16 footprintSide
 work value 0x24, or scene scratch
u32 linkedObject
 work value 0x25, the object it follows or faces
u32 hook
 SW_HOOK, the routine run each frame.

Detailed Description

The whole 0x70-byte slot as SC_SET, SC_ADD and SC_CMP see it: each field is one work value (enum ScriptWork in objcmd.h), reached through gScript_OperandHandlerTable, and named for what the engine keeps there.

The types are the widths the handlers read, not the engine's own.

Definition at line 49 of file script.h.

Field Documentation

◆ scriptAddress

u32 ScriptOperands::scriptAddress

SW_SCRIPT; an add steps it by whole words.

Definition at line 50 of file script.h.

◆ cursor

u16 ScriptOperands::cursor

SW_CURSOR, compared as signed.

Definition at line 51 of file script.h.

◆ facing

u16 ScriptOperands::facing

SW_FACING, and work values 2 and 4.

Definition at line 52 of file script.h.

◆ x

u32 ScriptOperands::x

SW_X, 16.16 fixed-point pixels.

Definition at line 53 of file script.h.

◆ y

u32 ScriptOperands::y

SW_Y.

Definition at line 54 of file script.h.

◆ z

u32 ScriptOperands::z

SW_Z.

Definition at line 55 of file script.h.

◆ terrainHeight

u32 ScriptOperands::terrainHeight

SW_GROUND.

Definition at line 56 of file script.h.

◆ scaleX

u32 ScriptOperands::scaleX

SW_SCALE_X, 16.16 fixed point.

Definition at line 57 of file script.h.

◆ scaleY

u32 ScriptOperands::scaleY

SW_SCALE_Y, and work value 0x0b.

Definition at line 58 of file script.h.

◆ radius

u16 ScriptOperands::radius

SW_RADIUS, in pixels; compared as signed.

Definition at line 59 of file script.h.

◆ padding22

u8 ScriptOperands::padding22[2]

the layer and priority flags; no work value

Definition at line 60 of file script.h.

◆ velocityX

u32 ScriptOperands::velocityX

SW_VELOCITY_X, 16.16 fixed-point pixels per frame.

Definition at line 61 of file script.h.

◆ velocityY

u32 ScriptOperands::velocityY

SW_VELOCITY_Y.

Definition at line 62 of file script.h.

◆ velocityZ

u32 ScriptOperands::velocityZ

SW_VELOCITY_Z.

Definition at line 63 of file script.h.

◆ speedLimit

u32 ScriptOperands::speedLimit

SW_SPEED.

Definition at line 64 of file script.h.

◆ acceleration

u32 ScriptOperands::acceleration

SW_ACCEL.

Definition at line 65 of file script.h.

◆ targetX

u32 ScriptOperands::targetX

SW_TARGET_X; 0x80000000 when unset.

Definition at line 66 of file script.h.

◆ targetY

u32 ScriptOperands::targetY

SW_TARGET_Y.

Definition at line 67 of file script.h.

◆ targetZ

u32 ScriptOperands::targetZ

SW_TARGET_Z.

Definition at line 68 of file script.h.

◆ bounce

u32 ScriptOperands::bounce

SW_BOUNCE, or a floating object's phase.

Definition at line 69 of file script.h.

◆ gravity

u32 ScriptOperands::gravity

SW_GRAVITY.

Definition at line 70 of file script.h.

◆ sceneWord

u32 ScriptOperands::sceneWord

Work value 0x17: the word FieldObject_Create zeroes and only scene code reads.

Definition at line 73 of file script.h.

◆ sprite

u32 ScriptOperands::sprite

work value 0x18: the sprite, or its list of four

Definition at line 74 of file script.h.

◆ spriteStorageKind

u8 ScriptOperands::spriteStorageKind

work value 0x19: 0 hidden, 1 one, 2 a group

Definition at line 75 of file script.h.

◆ motionFlags

u8 ScriptOperands::motionFlags

SW_MOTION, ActorMotionFlag bits.

Definition at line 76 of file script.h.

◆ arrivalAxis

u8 ScriptOperands::arrivalAxis

SW_ARRIVAL.

Definition at line 77 of file script.h.

◆ conditionResult

u8 ScriptOperands::conditionResult

SW_RESULT, the last test; every compare sets it.

Definition at line 78 of file script.h.

◆ snapToTarget

u8 ScriptOperands::snapToTarget

SW_SNAP.

Definition at line 79 of file script.h.

◆ collisionFlags

u8 ScriptOperands::collisionFlags

SW_COLLISION.

Definition at line 80 of file script.h.

◆ steeringFlags

u8 ScriptOperands::steeringFlags

SW_STEERING.

Definition at line 81 of file script.h.

◆ paused

u8 ScriptOperands::paused

SW_PAUSED.

Definition at line 82 of file script.h.

◆ byte5c

u8 ScriptOperands::byte5c

keeps the sprite's VRAM; no work value

Definition at line 83 of file script.h.

◆ repeatCount

u8 ScriptOperands::repeatCount

SW_REPEAT, SC_LOOP's count.

Definition at line 84 of file script.h.

◆ wait

u16 ScriptOperands::wait

SW_WAIT, compared as signed.

Definition at line 85 of file script.h.

◆ refused

u8 ScriptOperands::refused

ScriptInterpreter.refused; no work value.

Definition at line 86 of file script.h.

◆ frozen

u8 ScriptOperands::frozen

ScriptMotionObject.frozen; no work value.

Definition at line 87 of file script.h.

◆ sceneByte62

u8 ScriptOperands::sceneByte62

work value 0x27, kept by scene code

Definition at line 88 of file script.h.

◆ sceneByte63

u8 ScriptOperands::sceneByte63

work value 0x28, kept by scene code

Definition at line 89 of file script.h.

◆ actionParameter

s16 ScriptOperands::actionParameter

work value 0x23, what its action script reads

Definition at line 90 of file script.h.

◆ footprintSide

s16 ScriptOperands::footprintSide

work value 0x24, or scene scratch

Definition at line 91 of file script.h.

◆ linkedObject

u32 ScriptOperands::linkedObject

work value 0x25, the object it follows or faces

Definition at line 92 of file script.h.

◆ hook

u32 ScriptOperands::hook

SW_HOOK, the routine run each frame.

Definition at line 93 of file script.h.