10 switch (task->
state) {
29#define STAGE_CHILDREN_SIZE 4
55#if VERSION_US || VERSION_JP
56#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_05)
57#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
58#define STAGE_FILE 0x5FF
60#define STAGE_TEXT TEXT_FILE(TEXT_TALKS_05)
61#define EVENT_TEXT_FILE (TEXT_EVENTS_200 - 1)
62#define STAGE_FILE 0x60F
325#elif VERSION_EU || VERSION_JP
374 { 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
375 { 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
376 { 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
377 { 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
378 { 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
379 { 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
380 { 0x140, 0x100, 0x170, 0x100, 0xC0, 0, 0x170, 0x1FF },
381 { 0x140, 0x100, 0x148, 0x100, 0x20, 0, 0x170, 0x1FE },
382 { 0x140, 0x100, 0x140, 0x100, 0, 0, 0x170, 0x1FD },
383 { 0x140, 0x100, 0x178, 0x100, 0xE0, 0, 0x170, 0x1FC },
384 { 0x140, 0x100, 0x150, 0x100, 0x40, 0, 0x140, 0x1FB },
385 { 0x140, 0x100, 0x158, 0x100, 0x60, 0, 0x150, 0x1FB },
386 { 0x140, 0x100, 0x160, 0x100, 0x80, 0, 0x160, 0x1FB },
387 { 0x140, 0x100, 0x168, 0x100, 0xA0, 0, 0x170, 0x1FB },
388 { 0x140, 0x100, 0x170, 0x120, 0xC0, 0x20, 0x140, 0x1FA },
389 { 0x140, 0x100, 0x148, 0x128, 0x20, 0x28, 0x150, 0x1FA },
390 { 0x140, 0x100, 0x150, 0x128, 0x40, 0x28, 0x160, 0x1FA },
391 { 0x140, 0x100, 0x158, 0x128, 0x60, 0x28, 0x170, 0x1FA },
392 { 0, 0, 0, 0, 0, 0, 0, 0 },
485 { 1, 0, 0x40, 2, 0x34, 2, 0, 3, 4, 0, 320, 53, 0, 0 },
486 { 1, 0, 0x40, 2, 0x34, 2, 0, 3, 4, 0, 384, 85, 0, 0 },
487 { 1, 0, 0x40, 2, 0x34, 2, 0, 3, 4, 0, 424, 104, 0, 0 },
488 { 1, 0, 0x40, 2, 0x34, 2, 0, 3, 4, 0, 455, 145, 0, 0 },
489 { 1, 0, 0x40, 2, 0x34, 2, 0, 3, 4, 0, 480, 180, 0, 0 },
490 { 1, 0, 0x40, 2, 0x34, 2, 0, 3, 4, 0, 528, 205, 0, 0 },
491 { 1, 0, 0x40, 2, 0x35, 2, 0, 3, 4, 0, 104, 68, 0, 0 },
492 { 1, 0, 0x40, 2, 0x35, 2, 0, 3, 4, 0, 140, 69, 0, 0 },
493 { 1, 0, 0x40, 2, 0x36, 2, 0, 3, 4, 0, 104, 131, 0, 0 },
494 { 1, 0, 0x40, 2, 0x36, 2, 0, 3, 4, 0, 198, 84, 0, 0 },
495 { 1, 0, 0x40, 6, 0x32, 2, 0, 3, 4, 0, 382, 161, 0, 0 },
496 { 1, 0, 0x40, 6, 0x33, 2, 0, 3, 6, 0, 403, 168, 0, 0 },
497 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
500 { { {
CODES_END, 0 }, {
CODES_END, 0 } },
SLOT_EXIT, 0x205, 0x70, 0xE4, 7, 0, 0, 0 },
501 { { {
PROGRESS(
STORY_CONTROL_ROOM), 1 }, {
FLAG(0x40, 0x4D), 0 } },
SLOT_EVENT, 0x244, 0, 0, 0, 0, 0, 0 },
502 { { {
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.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
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 SCRIPT_END
The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind...
#define SCRIPT_LOOK_AT(snap, x, y)
FIELDSTG_pointCamera.
#define SCRIPT_LEAVE(mode, x, y, dir)
FIELDSTG_leaveField; ends the event.
#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 SCRIPT_FOLLOW(snap, id)
FIELDSTG_followWithCamera.
#define FIELD_MAP_FLOOR0
Some of FieldMap's maps (files): those of the floors the player walks on come first,...
#define SLOT_EVENT
starts the event arg
#define SCRIPT_WALK(id, x, y, dir)
Actor.setGoal: walks to (x, y), then faces dir.
#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 PROGRESS(n)
GAME.progress is n.
#define FLAG(group, id)
The codes of the (code, value) pairs that FLAGS_00 checks as conditions and applies as actions (event...
#define MUSIC_CITY_CRISIS
BGM_0029: the cities and their streets instead of their music while the story is at a crisis (Knightm...
#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_AMATERASU_PLAN_SEEN
wstag305 event 890: Lisa and Nick plan how to get into Amaterasu City past the Knightmon Guard System...
@ STORY_BULBMON_FOUND
WSTAG520 (Suzaku Hall), event 695: another earthquake; Bulbmon digs the holes.
@ STORY_CONTROL_ROOM
WSTAG325 (Control Room, Asuka City), event 560: a Soldier guards the way.
@ STORY_NETWORK_OFFLINE
WSTAG750, event 886: the news say the Optical Network is offline.
#define SPECIAL_STORY_ASUKA_HEADQUARTERS_TO_OPERATION_SIGMA
GAME.progress is from STORY_ASUKA_HEADQUARTERS to STORY_OPERATION_SIGMA (PROGRESS_RANGES[0x13])
#define SPECIAL_STORY_JUNGLE_SOUND_TO_PRESIDENT_ARRESTED
GAME.progress is from STORY_JUNGLE_SOUND to STORY_PRESIDENT_ARRESTED (PROGRESS_RANGES[0x17])
#define SPECIAL_STORY_KNIGHTMON_REPROGRAMMED_TO_BULBMON_FOUND
GAME.progress is from STORY_KNIGHTMON_REPROGRAMMED to STORY_BULBMON_FOUND (PROGRESS_RANGES[0x11])
#define FLAG_LISA_RESISTANCE_REPORT_SEEN
wstag305 Master Room event 894: the player tells Lisa he met the Resistance; set at its end,...
#define FLAG_DESTROMON_REVEAL_SEEN
wstag295 event 891: the Game Master reveals Destromon, born from Vemmon and the Juggernaut; set at it...
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
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,...
void(* applyAction)(s32 code, s32 value)
s32(* checkCondition)(u16 code, u16 value)
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(* stageFuncs[])(void)
The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a t...
void endEvent892(void)
After event 892, with Game Master, Lisa, Teddy and Nick: lets events 893 and 894 of WSTAG305 start.
FieldActorEntry * stageActors[]
void endEvent580(void)
After event 580, with Teddy, Dr.
void endEvent891(void)
After event 891, with Lisa, Game Master and Teddy: keeps it from playing again.
void setupStage(void)
Sets the stage up: its map, actors and events, playing BGM_0029.
StageTile stageObjects[]
The tables and color setupStage gives FIELDSTG_state (FieldState)