Alchemy
Loading...
Searching...
No Matches

ScriptInterpreter Struct Reference

The prefix that command handlers read from a field object's 0x70-byte slot. More...

#include <field/script.h>

Data Fields

const s32 * script
 the running script; SC_END sets gScript_MainScript
s16 cursor
 the word index of the next command in script
u8 padding06 [0x4e]
 the object's own fields; not read by the commands
u8 spriteStorageKind
 FieldActor's spriteStorageKind: SC_B54_ON sets 1, one sprite drawn, and SC_B54_OFF sets 0, which hides the object's sprites.
u8 padding55 [2]
 the object's own fields; not read by the commands
u8 conditionResult
 the last flag test, read by SC_IF and SC_IFNOT
u8 padding58 [5]
 the object's own fields; not read by the commands
u8 repeatCount
 SC_LOOP's count of jumps so far.
s16 wait
 Frames left of SC_WAIT (n - 1 when it starts); the update loops count it down, and Script_FindLabel clears it.
u8 refused
 Frames in a row a solid object has refused the object's move (ScriptMotionObject.refused); SC_SYNC stops waiting after 60 and clears it.

Detailed Description

The prefix that command handlers read from a field object's 0x70-byte slot.

Definition at line 16 of file script.h.

Field Documentation

◆ script

◆ cursor

◆ padding06

u8 ScriptInterpreter::padding06[0x4e]

the object's own fields; not read by the commands

Definition at line 19 of file script.h.

◆ spriteStorageKind

u8 ScriptInterpreter::spriteStorageKind

FieldActor's spriteStorageKind: SC_B54_ON sets 1, one sprite drawn, and SC_B54_OFF sets 0, which hides the object's sprites.

Definition at line 22 of file script.h.

Referenced by Script_ClearByte54(), and Script_SetByte54().

◆ padding55

u8 ScriptInterpreter::padding55[2]

the object's own fields; not read by the commands

Definition at line 23 of file script.h.

◆ conditionResult

u8 ScriptInterpreter::conditionResult

the last flag test, read by SC_IF and SC_IFNOT

Definition at line 24 of file script.h.

Referenced by Script_JumpIfFalse(), Script_JumpIfTrue(), and Script_TestFlag().

◆ padding58

u8 ScriptInterpreter::padding58[5]

the object's own fields; not read by the commands

Definition at line 25 of file script.h.

◆ repeatCount

u8 ScriptInterpreter::repeatCount

SC_LOOP's count of jumps so far.

Definition at line 26 of file script.h.

Referenced by Script_RepeatOrJump().

◆ wait

s16 ScriptInterpreter::wait

Frames left of SC_WAIT (n - 1 when it starts); the update loops count it down, and Script_FindLabel clears it.

Definition at line 29 of file script.h.

Referenced by Script_FindLabel(), and Script_Wait().

◆ refused

u8 ScriptInterpreter::refused

Frames in a row a solid object has refused the object's move (ScriptMotionObject.refused); SC_SYNC stops waiting after 60 and clears it.

Definition at line 33 of file script.h.

Referenced by Script_WaitForArrival().