43 switch (task->
state) {
56#define STAGE_CHILDREN_SIZE 4
62#if VERSION_US || VERSION_JP
63#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_03)
64#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
65#define STAGE_FILE 0x517
67#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_03)
68#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
69#define STAGE_FILE 0x527
170 1, 2, 1, 0, -1, -2, -1, 0,
174 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
175 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
176 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
177 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
178 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
179 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
180 { 0, 0, 0, 0, 0, 0, 0, 0 },
210 { 0, 1, 0x44, 2, 0x3A, 2, 0, 1, 4, 0, 312, 282, 0, 0 },
211 { 1, 2, 0x40, 2, 0x32, 1, 0x32, 0x39, 4, 0, 135, 358, 0, 0 },
212 { 1, 0, 0x40, 6, 0x3C, 0, 0, 0, 0, 0, 328, 194, 0, 0 },
213 { 1, 0, 0x40, 6, 1, 0, 0, 0, 0, 0, 192, 417, 0, 0 },
214 { 1, 3, 0xCD, 6, 0, 0, 0, 0, 0, 0, 160, 338, 0, 0 },
215 { 1, 0, 0x40, 0xA, 0x3E, 0, 0, 0, 0, 0, 328, 272, 0, 0 },
216 { 1, 0, 0x48, 0xA, 0x14, 0, 0, 0, 0, 0, 128, 202, 0, 0 },
217 { 1, 0, 0x49, 0xA, 0x15, 0, 0, 0, 0, 0, 200, 183, 0, 0 },
218 { 1, 0, 0x40, 4, 0x3D, 0, 0, 0, 0, 0, 336, 166, 193, 0 },
219 { 1, 0, 0x40, 8, 0x3F, 0, 0, 0, 0, 0, 336, 244, 277, 0 },
220 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
223 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x271, 0x368, 0xF4, 1, 0, 0, 0 },
224 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x281, 0x2FE, 0xA5, 1, 0, 0, 0 },
225 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_MAP, 1, 0, 0, 0, 0, 0, 0 },
226 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_DEPTH, 8, 0, 0, 0, 0, 0, 0 },
227 { { {
CODES_END, 0 }, {
CODES_END, 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
The stage overlays (AAA/PRO/WSTAG###.PRO), loaded at 0x800A4CA4 on top of FIELDSTG.
#define EVENT_TEXT(n)
An entry of the stage's events' text file, for FieldEvent.text.
void updateStage()
The names every stage defines, each its own (config/<version>/stages/<stage>.txt).
#define SCRIPT_WAIT_WALK(id)
until the character gets to its goal
#define FIELD_COMMAND_HALT_PARTNERS
The field commands, which an event script hands FIELD_TASK_COMMANDS as the first argument of a pose c...
#define SLOT_DEPTH
the player's depth, arg
#define SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
#define SLOT_MAP
the map the player is on, arg (FieldMap.setMap)
#define SCRIPT_COMMAND(id, command, arg)
the same word for a script command's id: FIELDSTG_setEventPose creates its task if none runs and hand...
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#define FIELD_COMMAND_PLAY_SWITCH02
#define SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
#define LIFT_DOWN
and back down to the objects' place on the map
#define LIFT_UP
The lift: the map objects 3 (always shown) and 2 (shown while it moves), which move 0x7F pixels up or...
#define SCRIPT_WAIT_BOX
until box 0 closes
#define SLOT_EXIT
The kinds of StageSlot (type).
#define SCRIPT_POSE(id, set, dir)
Actor.setPose: its animation set, facing dir.
#define FIELD_MAP_TRIGGERS
a cell's value: a direction (3 bits) and a StageSlot (5)
#define SCRIPT_WAIT(frames)
#define FIELD_TASK_COMMANDS
script command 813 (FIELDSTG_startCommandTask): the field commands
#define SCRIPT_PLACE(id, x, y)
puts a character at (x, y)
#define SCRIPT_TALK(box, entry, id, kind)
box of the event's boxes shows the event text's entry: a talk box at the corner kind next to the char...
FieldState FIELDSTG_state
#define START_EVENT(index)
action: FIELDSTG_startListedEvent
#define MUSIC_CARGO_TOWER
ENV_0204: the Cargo Tower.
#define MUSIC_BANK(music)
The sound bank of a music, which a stage loads for it (FieldState.soundBank)
FIELDSTG's start of the stage (StageEntry.init in FIELDSTG_stages): the stage's task,...
#define FLAG_LIFT_RAISED
lift.c / wstag261 Cargo Tower: "There's a switch here! Let's push it." sets it, "let's go downstairs"...
Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor....
A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateFie...
An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts.
void(* setFile)(s32 index, s32 file)
FIELDSTG_setMapFile.
void(* setFirstMap)(s32 index)
FIELDSTG_setFirstMap: the map the player starts on (GAME.mapIndex), when the mode is new.
s32 sheetEntry
the stage's sprite sheet, loaded before the field starts, or 0
FieldEvent * events
up to the first id -1
s32 soundBank
SOUND.loadBank's, or 0.
StageTile * objects
the map objects, up to the first margin 0
s32 imageFile
or an image archive file, or 0
Vec2 start
where the player starts
StageSlot * slots
up to the first type 0
ActorImage * actors
then the actors', from actors[2]
s32 mapFile
the file of the map's tiles (FIELDSTG_createMapStreamer)
s32 startDir
and its direction
CVECTOR spriteColor
the field's sprites' color, unless cd is 0
s32 textFile
the stage's text file, for the talks
union FieldState::@12 images
s32 music
SOUND.playSound's, or 0.
What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last,...
s32(* checkCondition)(u16 code, u16 value)
void(* setState)(struct Lift *task, s32 state)
s16 raised
the objects are 0x7F up from their place, and the next move takes them down (LIFT_DOWN; flag 0x1C3D a...
What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState....
The task a stage starts (startStage), updated by its updateStage.
void(* nextState)(struct StageTask *task)
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
void * createTaskWithId(void(*update)(), s32 size, s32 childrenSize, s32 id)
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks.
void updateTileLift(Lift *task)
The lift: moves the map objects of animations 3 and 2 (shown only while it moves) and the player 0x7F...
void(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
u16 actor0Talk0Conditions[]
u16 actor0Talk1Conditions[]
u16 actor1Talk1Conditions[]
const CVECTOR stageColor
the color the setup copies to FIELDSTG_state.spriteColor
FieldActorEntry * stageActors[]
void handleCommand827(Lift *task, s32 id)
Runs a script command of the lift's: moves it up or down.
u16 actor1Talk0Conditions[]
void setupStage(void)
Sets the stage up: its map, actors and events, playing the ambience ENV_0204.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)
Lift * createCommand827(s32 id)
Creates the lift (updateTileLift), raised when flag 0x1C3D is set.
s16 tileLiftShake[]
Defined below, after the code that uses them.