13 for (i = 0; i < 30; i++) {
39 actor->
setPose(actor, set, dir);
44 for (i = 0; i < 10; i++) {
45 if (children->
scripts[i] == 0) {
47 if (children->
scripts[i] != 0) {
65 for (i = 0; i < 30; i++) {
90 switch (task->
state) {
127 actor->
pos.
x = pc[2] << 8;
128 actor->
pos.
y = pc[3] << 8;
138 actor->
setGoal(actor, pc[2], pc[3], pc[4]);
166 if (task->
wait == 0) {
169 if (--task->
wait != 0) {
257 if (entry->
id ==
id) {
268 if (id < 8000 || id >= 9000) {
void FIELDSTG_followWithCamera(s32 snap, s32 id)
Points the camera at the actor id, at once if snap.
void FIELDSTG_pointCamera(s32 snap, s32 x, s32 y)
Points the camera at the spot (x, y), at once if snap.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Actor * FIELDSTG_findEventActor(EventTask *task, s32 id)
The actor of an event's cast with the id, below the script commands' ids (0x320)
void FIELDSTG_runEvent(EventTask *task, EventChildren *children)
Runs an event: in TASK_INIT it waits for the event's text file and the field (FIELD_TASK_FIELD) and h...
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
s32 FIELDSTG_setEventPose(EventTask *task, s16 *op, EventChildren *children)
An event's pose command (SCRIPT_POSE): puts its actor in a pose, or, for an id of the script commands...
static void releaseEventActors(EventTask *task)
Gives the characters the event held their controls back.
void FIELDSTG_leaveField(s32 mode, s32 arg, s32 x, s32 y, s32 dir)
Leaves the field for a mode now (the executable calls it by this name)
#define FIELD_TASK_ACTOR
every character (FIELDSTG_createActor)
#define FIELD_TASK_FIELD
the field's main task (FIELDSTG_createField)
FIELDSTG.PRO: the field mode, where the player walks around the map.
FieldState FIELDSTG_state
FileCache FILE_CACHE
The file cache.
TaskRegistry TASK_REGISTRY
void FIELDSTG_handleScriptCommand(s32 task, s32 id, s32 command, s32 arg)
Hands the task of script command id a command and its argument, through the command's handle.
s32 FIELDSTG_createScriptCommand(s32 id)
Creates the task of script command id, or returns 0.
Speech * FIELDSTG_createSpeech(Actor *actor, s32 entry, s32 type, s32 isMessage)
Creates the speech of an event's text entry: a message box, or a talk box of a type.
A character on the field (FIELDSTG_createActor): the player (kind 0) and the other characters.
void(* setGoal)(struct Actor *, s32, s32, s32)
void(* startWalk)(struct Actor *)
s32(* isAnimDone)(struct Actor *)
s32(* isWalking)(struct Actor *)
void(* resetControl)(struct Actor *)
void(* setPose)(struct Actor *, s32, s32 dir)
The children of an EventTask.
struct Speech * boxes[3]
the script's message boxes
s32 scripts[10]
FIELDSTG_createScriptCommand's tasks.
struct Task * task
start's
An event (FIELDSTG_runEvent, made by FIELDSTG_startEvent): it runs a script of 16-bit words,...
struct EventTask::@13 entries[30]
the characters, held while the event runs
s32 wait
frames left of a wait command
void(* setState)(struct EventTask *task, s32 state)
void(* nextSubstate)(struct EventTask *task)
void(* nextState)(struct EventTask *task)
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
s32 text
a file and index, the file counted from TEXT_FILE(1); or 0
void *(* start)(void)
without a script: the task it starts, or NULL
s16 * script
FIELDSTG_runEvent's, or NULL.
s32 busy
an event, a warp, a launch or a battle has the player
FieldEvent * events
up to the first id -1
s32 eventText
the running event's text file and entry
s32(* isLoading)(s32 file)
void(* request)(s32 file)
void *(* find)(s32 id, s32 key1, s32 key2)
Any task, seen through its header.
void(* setSubstate)(struct Task *task, s32 substate)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find