Alchemy
Loading...
Searching...
No Matches

object_script.c File Reference

Field object scripts: the ones the engine starts itself, and the command table. More...

Go to the source code of this file.

Variables

const s32 gObjectDispatch_DefaultScript []
 The script FieldObject_Create gives every new object: it does nothing and returns to the idle script.
const s32 gObjectDispatch_KeyCheckScript []
 Runs SC_KEY_COUNT every frame; started by ObjectDispatch_StartKeyCheck.
const s32 gObjectDispatch_KeysScript []
 Started by ObjectDispatch_StartMoveByKeys.
const s32 gObjectDispatch_PlayerScript []
 Started by ObjectDispatch_StartPlayerControl.
const s32 gObjectDispatch_WorldMapScript []
 Started by ObjectDispatch_StartWorldMapControl.
const s32 gObjectDispatch_CameraScript []
 Started by ObjectDispatch_StartCamera.
const s32 gObjectDispatch_ApproachLinkScript []
 Started by ObjectDispatch_StartApproachLink.
const s32 gObjectDispatch_EndScript []
 The idle script ObjectDispatch_StartIdle gives an object.
const ScriptCommand gScriptObject_CommandTable [47]
 The handler for each script command number; 0x24 onwards act as SC_END.

Detailed Description

Field object scripts: the ones the engine starts itself, and the command table.

Definition in file object_script.c.

Variable Documentation

◆ gObjectDispatch_DefaultScript

const s32 gObjectDispatch_DefaultScript[]
Initial value:
= {
}
#define SC_END
Return to the main script.
Definition objcmd.h:32

The script FieldObject_Create gives every new object: it does nothing and returns to the idle script.

Definition at line 14 of file object_script.c.

Referenced by FieldObject_Create().

◆ gObjectDispatch_KeyCheckScript

const s32 gObjectDispatch_KeyCheckScript[]
Initial value:
= {
SC_WAIT(1),
}
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_FOREVER
Definition objcmd.h:14
#define SC_KEY_COUNT
Definition objcmd.h:51
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13

Runs SC_KEY_COUNT every frame; started by ObjectDispatch_StartKeyCheck.

This and the scripts below each repeat one command every frame.

Definition at line 20 of file object_script.c.

Referenced by ObjectDispatch_StartKeyCheck().

◆ gObjectDispatch_KeysScript

const s32 gObjectDispatch_KeysScript[]
Initial value:
= {
SC_WAIT(1),
}
#define SC_KEYS
Definition objcmd.h:41

Started by ObjectDispatch_StartMoveByKeys.

Definition at line 27 of file object_script.c.

Referenced by ObjectDispatch_StartMoveByKeys().

◆ gObjectDispatch_PlayerScript

const s32 gObjectDispatch_PlayerScript[]
Initial value:
= {
SC_WAIT(1),
}
#define SC_PLAYER
Player input control.
Definition objcmd.h:40

Started by ObjectDispatch_StartPlayerControl.

Definition at line 34 of file object_script.c.

Referenced by ObjectDispatch_StartPlayerControl().

◆ gObjectDispatch_WorldMapScript

const s32 gObjectDispatch_WorldMapScript[]
Initial value:
= {
SC_WAIT(1),
}
#define SC_WORLD
World map control.
Definition objcmd.h:42

Started by ObjectDispatch_StartWorldMapControl.

Definition at line 41 of file object_script.c.

Referenced by ObjectDispatch_StartWorldMapControl().

◆ gObjectDispatch_CameraScript

const s32 gObjectDispatch_CameraScript[]
Initial value:
= {
SC_WAIT(1),
}
#define SC_CAMERA
Follow the leader.
Definition objcmd.h:27

Started by ObjectDispatch_StartCamera.

Definition at line 48 of file object_script.c.

Referenced by ObjectDispatch_StartCamera().

◆ gObjectDispatch_ApproachLinkScript

const s32 gObjectDispatch_ApproachLinkScript[]
Initial value:
= {
SC_WAIT(1),
}
#define SC_APPROACH_LINK
Definition objcmd.h:26

Started by ObjectDispatch_StartApproachLink.

Definition at line 55 of file object_script.c.

Referenced by ObjectDispatch_StartApproachLink().

◆ gObjectDispatch_EndScript

const s32 gObjectDispatch_EndScript[]
Initial value:
= {
}

The idle script ObjectDispatch_StartIdle gives an object.

Definition at line 62 of file object_script.c.

Referenced by ObjectDispatch_StartIdle().

◆ gScriptObject_CommandTable

const ScriptCommand gScriptObject_CommandTable[47]

The handler for each script command number; 0x24 onwards act as SC_END.

Commands receive the object's interpreter view.

Object_UpdateAll (update.c) and Object_UpdateAllThumb (object_motion.c) call through it.

The handler for each script command number; 0x24 onwards act as SC_END.

A nonzero result continues its script this frame; zero yields until the next frame.

Definition at line 69 of file object_script.c.

Referenced by Object_UpdateAll(), and Object_UpdateAllThumb().