include/field/script_operands.h
The actor script interpreter and the operands its commands read.
Included by field_actors.c and map_grid_data.c.
Structures
| Name | Description | |
|---|---|---|
struct | SCRIPT_OPERANDS | ACTOR as the actor script's SC_SET, SC_ADD and SC_CMP commands reach it, every field a plain number (ACTOR_SCRIPT_VALUE numbers them). |
Typedefs
| Name | Description | |
|---|---|---|
typedef Sint32 (* | SCRIPT_COMMAND )(struct ACTOR *); | An actor script command's handler: it reads its operands at the actor's script cursor, moves the cursor past them and returns 1 to run the next command this tick or 0 to wait. |
typedef void (* | OPERAND_FUNC )(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value); | A work value's handler: operation 0 sets the value, 1 adds to it and 2 compares it, into conditionResult. |
Functions
| Name | Description | |
|---|---|---|
void | fdActorScriptSetOrCompareScriptAddress (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | The work value handlers of ActorScriptOperandHandlerTable, one an SW_ value: each sets, adds to or compares (into conditionResult) the actor field it names; positions, targets, velocities and gravity are 16.16 pixels. |
void | fdActorScriptSetOrCompareCursor (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | Work value SW_CURSOR: sets, adds to or compares the script cursor. |
void | fdActorScriptSetOrCompareFacing (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareX (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareY (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareZ (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareRadius (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | Work value SW_RADIUS: sets, adds to or compares the actor's radius. |
void | fdActorScriptSetOrCompareScaleX (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareScaleY (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareVelocityX (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareVelocityY (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareVelocityZ (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSpeedLimit (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareAcceleration (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareTargetX (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareTargetY (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareTargetZ (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareBounce (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareGravity (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareTerrainHeight (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSceneWord (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSprite (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSpriteStorageKind (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareMotionFlags (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareArrivalAxis (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareConditionResult (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSnapToTarget (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareCollisionFlags (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSteeringFlags (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrComparePaused (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareRepeatCount (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareWait (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareTimer (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareUserValue (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareWatchedActor (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareUpdateAddress (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSceneCount (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
void | fdActorScriptSetOrCompareSceneByte (SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value) | |
Sint32 | fdActorScriptGoto (struct ACTOR *interpreter) | SC_GOTO(script): goes on in script, from its first command, this tick. |
Sint32 | fdActorScriptHideSprites (struct ACTOR *interpreter) | SC_HIDE_SPRITES: clears spriteStorageKind, hiding the sprites, and moves on to the next command. |
Sint32 | fdActorScriptShowSprite (struct ACTOR *interpreter) | SC_SHOW_SPRITE: shows the actor's one sprite again (ACTOR_SPRITE_ONE) and moves on to the next command. |
Variables
| Name | Description | |
|---|---|---|
extern const OPERAND_FUNC | ActorScriptOperandHandlerTable [41] | The handler for each work value number (map_grid_data.c). |
Description
The actor script interpreter and the operands its commands read.
Typedefs in detail
SCRIPT_COMMAND
typedef Sint32 (*SCRIPT_COMMAND)(struct ACTOR *);
An actor script command's handler: it reads its operands at the actor's script cursor, moves the cursor past them and returns 1 to run the next command this tick or 0 to wait.
Referenced by fdActorScriptInvokeCallback().
Definition at line 15 of file script_operands.h.
OPERAND_FUNC
typedef void (*OPERAND_FUNC)(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value);
A work value's handler: operation 0 sets the value, 1 adds to it and 2 compares it, into conditionResult.
Referenced by ActorScriptOperandHandlerTable and fdActorScriptApplyOperandCommand().
Definition at line 84 of file script_operands.h.
Functions in detail
fdActorScriptSetOrCompareScriptAddress
void fdActorScriptSetOrCompareScriptAddress(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
The work value handlers of ActorScriptOperandHandlerTable, one an SW_ value:
each sets, adds to or compares (into conditionResult) the actor field it
names; positions, targets, velocities and gravity are 16.16 pixels.
Referenced by ActorScriptOperandHandlerTable.
Definition at line 94 of file script_operands.h.
fdActorScriptSetOrCompareFacing
void fdActorScriptSetOrCompareFacing(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 100 of file script_operands.h.
fdActorScriptSetOrCompareX
void fdActorScriptSetOrCompareX(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 103 of file script_operands.h.
fdActorScriptSetOrCompareY
void fdActorScriptSetOrCompareY(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 106 of file script_operands.h.
fdActorScriptSetOrCompareZ
void fdActorScriptSetOrCompareZ(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 109 of file script_operands.h.
fdActorScriptSetOrCompareScaleX
void fdActorScriptSetOrCompareScaleX(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 115 of file script_operands.h.
fdActorScriptSetOrCompareScaleY
void fdActorScriptSetOrCompareScaleY(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 118 of file script_operands.h.
fdActorScriptSetOrCompareVelocityX
void fdActorScriptSetOrCompareVelocityX(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 121 of file script_operands.h.
fdActorScriptSetOrCompareVelocityY
void fdActorScriptSetOrCompareVelocityY(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 124 of file script_operands.h.
fdActorScriptSetOrCompareVelocityZ
void fdActorScriptSetOrCompareVelocityZ(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 127 of file script_operands.h.
fdActorScriptSetOrCompareSpeedLimit
void fdActorScriptSetOrCompareSpeedLimit(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 130 of file script_operands.h.
fdActorScriptSetOrCompareAcceleration
void fdActorScriptSetOrCompareAcceleration(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 133 of file script_operands.h.
fdActorScriptSetOrCompareTargetX
void fdActorScriptSetOrCompareTargetX(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 136 of file script_operands.h.
fdActorScriptSetOrCompareTargetY
void fdActorScriptSetOrCompareTargetY(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 139 of file script_operands.h.
fdActorScriptSetOrCompareTargetZ
void fdActorScriptSetOrCompareTargetZ(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 142 of file script_operands.h.
fdActorScriptSetOrCompareBounce
void fdActorScriptSetOrCompareBounce(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 145 of file script_operands.h.
fdActorScriptSetOrCompareGravity
void fdActorScriptSetOrCompareGravity(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 148 of file script_operands.h.
fdActorScriptSetOrCompareTerrainHeight
void fdActorScriptSetOrCompareTerrainHeight(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 151 of file script_operands.h.
fdActorScriptSetOrCompareSceneWord
void fdActorScriptSetOrCompareSceneWord(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 154 of file script_operands.h.
fdActorScriptSetOrCompareSprite
void fdActorScriptSetOrCompareSprite(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 157 of file script_operands.h.
fdActorScriptSetOrCompareSpriteStorageKind
void fdActorScriptSetOrCompareSpriteStorageKind(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 160 of file script_operands.h.
fdActorScriptSetOrCompareMotionFlags
void fdActorScriptSetOrCompareMotionFlags(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 163 of file script_operands.h.
fdActorScriptSetOrCompareArrivalAxis
void fdActorScriptSetOrCompareArrivalAxis(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 166 of file script_operands.h.
fdActorScriptSetOrCompareConditionResult
void fdActorScriptSetOrCompareConditionResult(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 169 of file script_operands.h.
fdActorScriptSetOrCompareSnapToTarget
void fdActorScriptSetOrCompareSnapToTarget(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 172 of file script_operands.h.
fdActorScriptSetOrCompareCollisionFlags
void fdActorScriptSetOrCompareCollisionFlags(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 175 of file script_operands.h.
fdActorScriptSetOrCompareSteeringFlags
void fdActorScriptSetOrCompareSteeringFlags(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 178 of file script_operands.h.
fdActorScriptSetOrComparePaused
void fdActorScriptSetOrComparePaused(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 181 of file script_operands.h.
fdActorScriptSetOrCompareRepeatCount
void fdActorScriptSetOrCompareRepeatCount(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 184 of file script_operands.h.
fdActorScriptSetOrCompareWait
void fdActorScriptSetOrCompareWait(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 187 of file script_operands.h.
fdActorScriptSetOrCompareTimer
void fdActorScriptSetOrCompareTimer(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 190 of file script_operands.h.
fdActorScriptSetOrCompareUserValue
void fdActorScriptSetOrCompareUserValue(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 193 of file script_operands.h.
fdActorScriptSetOrCompareWatchedActor
void fdActorScriptSetOrCompareWatchedActor(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 196 of file script_operands.h.
fdActorScriptSetOrCompareUpdateAddress
void fdActorScriptSetOrCompareUpdateAddress(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 199 of file script_operands.h.
fdActorScriptSetOrCompareSceneCount
void fdActorScriptSetOrCompareSceneCount(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 202 of file script_operands.h.
fdActorScriptSetOrCompareSceneByte
void fdActorScriptSetOrCompareSceneByte(SCRIPT_OPERANDS *operands, Sint32 operation, Sint32 value)
Referenced by ActorScriptOperandHandlerTable.
Definition at line 205 of file script_operands.h.