Skip to Content
The Alchemy Project

struct SCRIPT_OPERANDS

The whole 112-byte slot as SC_SET, SC_ADD and SC_CMP see it: each field is one state value (ACTOR_SCRIPT_VALUE in actor_script.h), reached through ActorScriptOperandHandlerTable, and named for what the field keeps there.

Declared in script_operands.h.

Fields

NameDescription
Uint32scriptAddrSW_SCRIPT; an add steps it by whole words
Uint16cursorSW_CURSOR, compared as signed
Uint16facingSW_FACING, and the state values either side
Uint32xSW_X, 16.16 fixed-point pixels
Uint32ySW_Y
Uint32zSW_Z
Uint32groundHeightSW_GROUND
Uint32scaleXSW_SCALE_X, 16.16 fixed point
Uint32scaleYSW_SCALE_Y, and the state value after it
Uint16radiusSW_RADIUS, in pixels; compared as signed
Uint8layerno state value
Uint8priorityFlagsno state value
Uint32velocityXSW_VELOCITY_X, 16.16 fixed-point pixels per tick
Uint32velocityYSW_VELOCITY_Y
Uint32velocityZSW_VELOCITY_Z
Uint32speedLimitSW_SPEED
Uint32accelerationSW_ACCELERATION
Uint32targetXSW_TARGET_X; ACTOR_NO_TARGET when unset
Uint32targetYSW_TARGET_Y
Uint32targetZSW_TARGET_Z
Uint32bounceSW_BOUNCE, or a floating actor's phase
Uint32gravitySW_GRAVITY
Uint32sceneWordSW_SCENE_WORD: word fdActorCreate zeroes; only scene code reads
Uint32spriteSW_SPRITE: the sprite, or its list of four
Uint8spriteStorageKindSW_SPRITE_KIND, an ACTOR_SPR_KIND
Uint8motionFlagsSW_MOTION, ACTOR_MOTION_FLAG bits
Uint8arrivalAxisSW_ARRIVAL
Uint8conditionResultSW_RESULT, the last test; every compare sets it
Uint8snapToTargetSW_SNAP
Uint8collisionFlagsSW_COLLISION
Uint8steeringFlagsSW_STEERING
Uint8pausedSW_PAUSED
Uint8retainSpriteCachekeeps the sprite's VRAM; no state value
Uint8repeatCountSW_REPEAT, SC_LOOP's count
Sint16waitSW_WAIT
Uint8refusedACTOR.refused; no state value
Uint8frozenACTOR_ARM_VIEW.frozen; no state value
Uint8sceneCountSW_SCENE_COUNTER, kept by scene code
Uint8sceneByteSW_SCENE_BYTE, kept by scene code
Sint16timerSW_TIMER, what its actor script reads
Sint16userValueSW_USER_VALUE, or scene scratch
Uint32watchedActorSW_WATCHED_ACTOR, the actor it follows or faces
Uint32updateSW_HOOK, the function run each tick

Description

The whole 112-byte slot as SC_SET, SC_ADD and SC_CMP see it: each field is one state value (ACTOR_SCRIPT_VALUE in actor_script.h), reached through ActorScriptOperandHandlerTable, and named for what the field keeps there.

struct SCRIPT_OPERANDS

Referenced by fdActorScriptApplyOperandAdd(), fdActorScriptApplyOperandCommand(), fdActorScriptApplyOperandCompare(), fdActorScriptApplyOperandSet(), fdActorScriptSetOrCompareCursor() and fdActorScriptSetOrCompareRadius().

Definition at line 20 of file script_operands.h.

Fields in detail

scriptAddr

Uint32 scriptAddr

SW_SCRIPT; an add steps it by whole words

cursor

Uint16 cursor

SW_CURSOR, compared as signed

facing

Uint16 facing

SW_FACING, and the state values either side

x

Uint32 x

SW_X, 16.16 fixed-point pixels

y

Uint32 y

SW_Y

z

Uint32 z

SW_Z

groundHeight

Uint32 groundHeight

SW_GROUND

scaleX

Uint32 scaleX

SW_SCALE_X, 16.16 fixed point

scaleY

Uint32 scaleY

SW_SCALE_Y, and the state value after it

radius

Uint16 radius

SW_RADIUS, in pixels; compared as signed

layer

Uint8 layer

no state value

priorityFlags

Uint8 priorityFlags

no state value

velocityX

Uint32 velocityX

SW_VELOCITY_X, 16.16 fixed-point pixels per tick

velocityY

Uint32 velocityY

SW_VELOCITY_Y

velocityZ

Uint32 velocityZ

SW_VELOCITY_Z

speedLimit

Uint32 speedLimit

SW_SPEED

acceleration

Uint32 acceleration

SW_ACCELERATION

targetX

Uint32 targetX

SW_TARGET_X; ACTOR_NO_TARGET when unset

targetY

Uint32 targetY

SW_TARGET_Y

targetZ

Uint32 targetZ

SW_TARGET_Z

bounce

Uint32 bounce

SW_BOUNCE, or a floating actor's phase

gravity

Uint32 gravity

SW_GRAVITY

sceneWord

Uint32 sceneWord

SW_SCENE_WORD: word fdActorCreate zeroes; only scene code reads

sprite

Uint32 sprite

SW_SPRITE: the sprite, or its list of four

spriteStorageKind

Uint8 spriteStorageKind

SW_SPRITE_KIND, an ACTOR_SPR_KIND

motionFlags

Uint8 motionFlags

SW_MOTION, ACTOR_MOTION_FLAG bits

arrivalAxis

Uint8 arrivalAxis

SW_ARRIVAL

conditionResult

Uint8 conditionResult

SW_RESULT, the last test; every compare sets it

snapToTarget

Uint8 snapToTarget

SW_SNAP

collisionFlags

Uint8 collisionFlags

SW_COLLISION

steeringFlags

Uint8 steeringFlags

SW_STEERING

paused

Uint8 paused

SW_PAUSED

retainSpriteCache

Uint8 retainSpriteCache

keeps the sprite's VRAM; no state value

repeatCount

Uint8 repeatCount

SW_REPEAT, SC_LOOP's count

wait

Sint16 wait

SW_WAIT

refused

Uint8 refused

ACTOR.refused; no state value

frozen

Uint8 frozen

ACTOR_ARM_VIEW.frozen; no state value

sceneCount

Uint8 sceneCount

SW_SCENE_COUNTER, kept by scene code

sceneByte

Uint8 sceneByte

SW_SCENE_BYTE, kept by scene code

timer

Sint16 timer

SW_TIMER, what its actor script reads

userValue

Sint16 userValue

SW_USER_VALUE, or scene scratch

watchedActor

Uint32 watchedActor

SW_WATCHED_ACTOR, the actor it follows or faces

update

Uint32 update

SW_HOOK, the function run each tick