Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
field_map.h File Reference

What the stage overlays and the executable use of FIELDSTG (fieldstg.h has the rest): its layers and task ids, the map and the functions that read it, the records of the tables that each stage gives FIELDSTG, the field's state, and the functions the stages and the executable call. More...

#include "engine/game.h"
Include dependency graph for field_map.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FieldMap
 
struct  ActorImage
 Where an actor's frames go in VRAM: one of the records after the FieldImage (Actor.image) More...
 
struct  FieldImage
 The image of the field's effects (FieldState.images), then the actors' ActorImages. More...
 
struct  FieldEvent
 An event of the table FieldState.events, up to the first id -1, which FIELDSTG_startEvent starts. More...
 
struct  FieldTalk
 What a character says (FIELDSTG_runActorAction): the first whose conditions hold, or the last, which has none. More...
 
struct  FieldActorEntry
 A character of the field (FieldState.actors, a list of pointers up to NULL), which FIELDSTG_updateField creates unless its conditions fail; the player's other characters (FIELD_CHARACTER_PLAYER) lead the party instead. More...
 
struct  StageTile
 An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects, which ends with margin = 0. More...
 
struct  Lift
 
struct  StageSlot
 What the player can trigger on a map (FIELDSTG_updateTriggers): a record of the table at FieldState.slots, which ends with type 0, where the points are copied to. More...
 
struct  SlotDest
 Where a slot leads: a StageSlot from its arg on, as the warps (FieldTask.warp) and the launches (Launch.dest) read it. More...
 
struct  Actor
 A character on the field (FIELDSTG_createActor): the player (kind 0) and the other characters. More...
 
struct  AreaBattle
 A battle of an area's BattleList, which can start on the field (see FIELDSTG_startEncounter); FIGHTSTG's Battle is the battle itself. More...
 
struct  BattleList
 The battles of an area of the map (its cells' value at FieldMap.files[4]), one picked at random. More...
 
struct  FieldBattles
 The battles of a place (FieldState.battles), by area of the map: the fourth area's are also the ones that events start (FIELDSTG_startEventBattle5, FIELDSTG_startEventBattle). More...
 
struct  FieldState
 The field's state (FIELDSTG_state): what a stage tells FIELDSTG about itself, filled by its setup function (stageFuncs[0], FIELDSTG_setupField for the field's own), then what FIELDSTG keeps of the field. More...
 
struct  ChoiceChildren
 The children of a yes/no question at the bottom of the screen: FIELDSTG's ChoiceTask and the stages' copies of it (StageMenu) More...
 
struct  FieldBattleFuncs
 

Macros

#define FIELD_LAYER_BACK   0x1000
 The field's drawing layers, by their ids (GFX.funcs.createLayer), as FIELDSTG_updateField creates them.
 
#define FIELD_LAYER_COVER   0x1001
 the cover that fades the screen (FIELDSTG_drawCover)
 
#define FIELD_LAYER_MAP   0x1002
 the map, its objects and characters, and the menus
 
#define FIELD_LAYER_BANNER   0x1003
 the area name banner
 
#define FIELD_LAYER_TEXT   0x1004
 the message and talk boxes
 
#define FIELD_TASK_MAP   4
 The ids of the field's tasks (createTaskWithId, TASK_REGISTRY.funcs.find)
 
#define FIELD_TASK_ACTOR   5
 every character (FIELDSTG_createActor)
 
#define FIELD_TASK_FIELD   7
 the field's main task (FIELDSTG_createField)
 
#define FIELD_TASK_BANNER   9
 the area name banner
 
#define FIELD_TASK_HIDDEN_SPOTS   0xB
 
#define FIELD_TASK_CAMERA   0x10
 
#define FIELD_TASK_ICON   0x16
 the icon over the player's head
 
#define FIELD_TASK_LAUNCHER   0x17
 a stage's launchers (FIELDSTG_runLaunch)
 
#define FIELD_TASK_COMMANDS   0x32D
 script command 813 (FIELDSTG_startCommandTask): the field commands
 
#define FIELD_COMMAND_HALT_PARTNERS   0x337
 The field commands, which an event script hands FIELD_TASK_COMMANDS as the first argument of a pose command (FIELDSTG_handleFieldCommand).
 
#define FIELD_COMMAND_ICON1   0x338
 the player icon's substate 1, with ITEM_GET
 
#define FIELD_COMMAND_ICON2   0x339
 its substate 2
 
#define FIELD_COMMAND_ICON3   0x34A
 its substate 3, with ITEM_GET
 
#define FIELD_COMMAND_HIDE_OBJECTS(n)   (0x34D + (n))
 hides the map objects of group n
 
#define FIELD_COMMAND_SHOW_OBJECTS(n)   (0x353 + (n))
 shows them
 
#define FIELD_OBJECT_GROUPS   6
 
#define FIELD_OBJECT_GROUP_ANIM   100
 the StageTile.anim of group 0; group n has 100 + n
 
#define FIELD_COMMAND_PLAY_INFO_SIG   0x365
 
#define FIELD_COMMAND_PLAY_GAYALOOP   0x366
 
#define FIELD_COMMAND_STOP_GAYALOOP   0x367
 
#define FIELD_COMMAND_PLAY_WEAR_OFF   0x368
 
#define FIELD_COMMAND_PLAY_DEMO_BGM   0x369
 
#define FIELD_COMMAND_PLAY_SE000002   0x36A
 
#define FIELD_COMMAND_PLAY_BEAM_SHT   0x36B
 
#define FIELD_COMMAND_PLAY_SWITCH02   0x36C
 
#define FIELD_COMMAND_PLAY_MASK_SET   0x36D
 
#define FIELD_COMMAND_PLAY_BM_ERASE   0x36E
 
#define FIELD_COMMAND_PLAY_LD_ERASE   0x36F
 
#define FIELD_COMMAND_PLAY_PLAYER11   0x370
 
#define FIELD_COMMAND_STOP_PLAYER11   0x371
 
#define FIELD_COMMAND_SHAKE_CAMERA   0x372
 
#define FIELD_COMMAND_STOP_CAMERA_SHAKE   0x373
 
#define FIELD_COMMAND_PLAY_TRAP_OFF   0x374
 
#define FIELD_COMMAND_PLAY_SAVEDEMO   0x375
 
#define FIELD_COMMAND_SEARCH_EVENT_SPOT   0x376
 FIELDSTG_searchEventSpot.
 
#define FIELD_COMMAND_PLAY_SWITCH03   0x377
 
#define FIELD_COMMAND_PLAY_SN_ENTRY   0x378
 
#define FIELD_COMMAND_PLAY_SN_ERASE   0x379
 
#define FIELD_COMMAND_PLAY_TELEPORT   0x37A
 
#define FIELD_COMMAND_PLAY_BULB_003   0x37C
 
#define FIELD_COMMAND_PLAY_GONDRA_S   0x37D
 
#define FIELD_COMMAND_PLAY_PIYOPIYO   0x37E
 
#define FIELD_COMMAND_PLAY_COMCD103   0x37F
 
#define FIELD_COMMAND_PLAY_COMCD201   0x380
 
#define FIELD_COMMAND_PLAY_COMCD111   0x381
 
#define FIELD_COMMAND_PLAY_BEAM_HIT   0x382
 
#define FIELD_COMMAND_PLAY_SWITCH01   0x383
 
#define FIELD_COMMAND_PLAY_COMCD115   0x384
 
#define FIELD_COMMAND_STOP_COMCD115   0x385
 
#define FIELD_COMMAND_STOP_BEAM_HIT   0x386
 
#define FIELD_MAP_FLOOR0   0
 Some of FieldMap's maps (files): those of the floors the player walks on come first, and GAME.mapIndex picks one (FieldMap.setMap, SLOT_MAP)
 
#define FIELD_MAP_FLOOR1   1
 
#define FIELD_MAP_AREAS   4
 a cell's value: its battle area (FieldBattles), or 0
 
#define FIELD_MAP_TRIGGERS   7
 a cell's value: a direction (3 bits) and a StageSlot (5)
 
#define SCRIPT_END   0
 The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind << 8 | variant, then a fixed number of arguments.
 
#define SCRIPT_PLACE(id, x, y)   0x100, id, x, y
 puts a character at (x, y)
 
#define SCRIPT_POSE(id, set, dir)   0x101, id, set, dir
 Actor.setPose: its animation set, facing dir.
 
#define SCRIPT_COMMAND(id, command, arg)   0x101, id, command, arg
 the same word for a script command's id: FIELDSTG_setEventPose creates its task if none runs and hands it the command and the argument (FIELDSTG_handleScriptCommand)
 
#define SCRIPT_WALK(id, x, y, dir)   0x102, id, x, y, dir
 Actor.setGoal: walks to (x, y), then faces dir.
 
#define SCRIPT_TALK(box, entry, id, kind)   0x200, 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 character id, or for kind 4 a message box (FIELDSTG_createSpeech)
 
#define SCRIPT_WAIT(frames)   0x300, frames
 
#define SCRIPT_WAIT_BOX   0x301
 until box 0 closes
 
#define SCRIPT_WAIT_WALK(id)   0x302, id
 until the character gets to its goal
 
#define SCRIPT_WAIT_ANIM(id)   0x303, id
 until its animation ends
 
#define SCRIPT_LEAVE(mode, x, y, dir)   0x304, mode, x, y, dir
 FIELDSTG_leaveField; ends the event.
 
#define SCRIPT_FOLLOW(snap, id)   0x600, snap, id
 FIELDSTG_followWithCamera.
 
#define SCRIPT_LOOK_AT(snap, x, y)   0x601, snap, x, y
 FIELDSTG_pointCamera.
 
#define FIELD_CHARACTER_PLAYER   2
 The characters (Actor.key1, FieldActorEntry.id) that FIELDSTG_updateField creates for the party.
 
#define FIELD_CHARACTER_PARTNERS   3
 
#define FIELD_FLAG_ENCOUNTERED   0xF
 The FLAGS_00 flag that every encounter sets (FIELDSTG_startEncounter); until it is set, the stages' slots run an event before the first battle.
 
#define LIFT_UP   0x348
 The lift: the map objects 3 (always shown) and 2 (shown while it moves), which move 0x7F pixels up or down the screen with the player, shaking before and after, each time a script command sets TASK_DONE: FIELDSTG's (FIELDSTG_createLift, script command 826) and the copies of WSTAG261 and WSTAG934 (common/update_tile_lift.inc.c)
 
#define LIFT_DOWN   0x349
 and back down to the objects' place on the map
 
#define SLOT_EXIT   1
 The kinds of StageSlot (type).
 
#define SLOT_CLIMB_UP   2
 
#define SLOT_CLIMB_DOWN   3
 
#define SLOT_DROP   4
 
#define SLOT_DEPTH   5
 the player's depth, arg
 
#define SLOT_MAP   6
 the map the player is on, arg (FieldMap.setMap)
 
#define SLOT_GAUGE   7
 the gauge game
 
#define SLOT_EVENT   8
 starts the event arg
 
#define SLOT_WARP1   9
 a warp (FieldWarp at arg) with effect and cutscene 1
 
#define SLOT_WARP0   10
 the same with effect and cutscene 0
 
#define SLOT_SLIDE   11
 
#define SLOT_STOP_SLIDE   12
 
#define SLOT_LAUNCH   13
 sends the player flying (FIELDSTG_launchActor)
 
#define SLOT_LAUNCH_OUT   14
 the same, then leaves for mode arg
 
#define SLOT_DEST(slot)   ((SlotDest *)&(slot)->arg)
 A slot's destination: its arg on, read as signed halfwords.
 
#define ACTOR_POSED   0
 What an actor is doing, its substate (FIELDSTG_runActorAction)
 
#define ACTOR_STAND   1
 
#define ACTOR_WALK   2
 
#define ACTOR_RUN   3
 
#define ACTOR_STOP   4
 stops after a run
 
#define ACTOR_WALK_OUT   5
 walks off through an exit (FIELDSTG_walkActorInDir)
 
#define ACTOR_CLIMB   0x40
 holds on to a wall (FIELDSTG_controlClimb)
 
#define ACTOR_CLIMB_UP   0x41
 
#define ACTOR_CLIMB_DOWN   0x42
 
#define ACTOR_GET_ON_WALL   0x43
 from below (FIELDSTG_startClimbUp)
 
#define ACTOR_GET_OVER_EDGE   0x44
 onto the wall from above (FIELDSTG_startClimbDown)
 
#define ACTOR_CLIMB_OFF_TOP   0x45
 
#define ACTOR_CLIMB_OFF_BOTTOM   0x46
 
#define ACTOR_DROP   0x47
 FIELDSTG_startDrop.
 
#define ACTOR_GAUGE   0x48
 plays the gauge game (FIELDSTG_startActorGauge)
 
#define ACTOR_SEARCH   0x49
 searches a hidden spot
 
#define ACTOR_TALK   0x4A
 answers the actor that talks to it (talkPartner)
 
#define ACTOR_FLY   0x4B
 flies on, triangle held (FIELDSTG_controlFlight)
 
#define ACTOR_FLOAT   0x4C
 slows down in the air
 
#define ACTOR_USE   0x4D
 works one of the objects 0x148, 0x15F and 0x160
 
#define ACTOR_USED   0x4E
 that object
 
#define ACTOR_SLIDE   0x4F
 FIELDSTG_startActorSlide.
 
#define ACTOR_STOP_SLIDE   0x50
 

Functions

struct EventTask * FIELDSTG_startEvent (s32 id)
 FIELDSTG functions the stages call.
 
StageTile * FIELDSTG_findObject (s32 anim)
 the first map object with that animation
 
StageTile * FIELDSTG_findNextObject (void)
 and the next, or NULL
 
void * FIELDSTG_startEventBattle5 (void)
 starts a battle: the handler of the stages' events 9000
 
void FIELDSTG_leaveField (s32 mode, s32 arg, s32 x, s32 y, s32 dir)
 FIELDSTG's functions and data that the executable calls (game/events.c, system/overlay.c), by these names in its link (config/eu/undefined_syms.txt)
 
void FIELDSTG_startListedEvent (s32 index)
 starts the event FIELDSTG_eventIds[index]
 
void FIELDSTG_openInn (void)
 opens the inn
 

Variables

FieldMap FIELDSTG_map
 
FieldState FIELDSTG_state
 
FieldBattleFuncs FIELDSTG_battleFuncs
 

Detailed Description

What the stage overlays and the executable use of FIELDSTG (fieldstg.h has the rest): its layers and task ids, the map and the functions that read it, the records of the tables that each stage gives FIELDSTG, the field's state, and the functions the stages and the executable call.

The map is a tree of cells: a grid of 128-pixel cells, then levels of 64, 32, 16 and 8 pixels, each cell four of the next level's, then a byte for each pixel of the 8x8 blocks.

Definition in file field_map.h.

Macro Definition Documentation

◆ FIELD_LAYER_BACK

#define FIELD_LAYER_BACK   0x1000

The field's drawing layers, by their ids (GFX.funcs.createLayer), as FIELDSTG_updateField creates them.

the background's color

Definition at line 18 of file field_map.h.

◆ FIELD_LAYER_COVER

#define FIELD_LAYER_COVER   0x1001

the cover that fades the screen (FIELDSTG_drawCover)

Definition at line 19 of file field_map.h.

◆ FIELD_LAYER_MAP

#define FIELD_LAYER_MAP   0x1002

the map, its objects and characters, and the menus

Definition at line 20 of file field_map.h.

◆ FIELD_LAYER_BANNER

#define FIELD_LAYER_BANNER   0x1003

the area name banner

Definition at line 21 of file field_map.h.

◆ FIELD_LAYER_TEXT

#define FIELD_LAYER_TEXT   0x1004

the message and talk boxes

Definition at line 22 of file field_map.h.

◆ FIELD_TASK_MAP

#define FIELD_TASK_MAP   4

The ids of the field's tasks (createTaskWithId, TASK_REGISTRY.funcs.find)

FIELDSTG_createMapStreamer's

Definition at line 25 of file field_map.h.

◆ FIELD_TASK_ACTOR

#define FIELD_TASK_ACTOR   5

every character (FIELDSTG_createActor)

Definition at line 26 of file field_map.h.

◆ FIELD_TASK_FIELD

#define FIELD_TASK_FIELD   7

the field's main task (FIELDSTG_createField)

Definition at line 27 of file field_map.h.

◆ FIELD_TASK_BANNER

#define FIELD_TASK_BANNER   9

the area name banner

Definition at line 28 of file field_map.h.

◆ FIELD_TASK_HIDDEN_SPOTS

#define FIELD_TASK_HIDDEN_SPOTS   0xB

Definition at line 29 of file field_map.h.

◆ FIELD_TASK_CAMERA

#define FIELD_TASK_CAMERA   0x10

Definition at line 30 of file field_map.h.

◆ FIELD_TASK_ICON

#define FIELD_TASK_ICON   0x16

the icon over the player's head

Definition at line 31 of file field_map.h.

◆ FIELD_TASK_LAUNCHER

#define FIELD_TASK_LAUNCHER   0x17

a stage's launchers (FIELDSTG_runLaunch)

Definition at line 32 of file field_map.h.

◆ FIELD_TASK_COMMANDS

#define FIELD_TASK_COMMANDS   0x32D

script command 813 (FIELDSTG_startCommandTask): the field commands

Definition at line 33 of file field_map.h.

◆ FIELD_COMMAND_HALT_PARTNERS

#define FIELD_COMMAND_HALT_PARTNERS   0x337

The field commands, which an event script hands FIELD_TASK_COMMANDS as the first argument of a pose command (FIELDSTG_handleFieldCommand).

The PLAY_ commands play the sound of their SOUNDTST name; a STOP_ command keys off the sound its PLAY_ command holds. the partners stop following

Definition at line 41 of file field_map.h.

◆ FIELD_COMMAND_ICON1

#define FIELD_COMMAND_ICON1   0x338

the player icon's substate 1, with ITEM_GET

Definition at line 42 of file field_map.h.

◆ FIELD_COMMAND_ICON2

#define FIELD_COMMAND_ICON2   0x339

its substate 2

Definition at line 43 of file field_map.h.

◆ FIELD_COMMAND_ICON3

#define FIELD_COMMAND_ICON3   0x34A

its substate 3, with ITEM_GET

Definition at line 44 of file field_map.h.

◆ FIELD_COMMAND_HIDE_OBJECTS

#define FIELD_COMMAND_HIDE_OBJECTS (   n)    (0x34D + (n))

hides the map objects of group n

Definition at line 45 of file field_map.h.

◆ FIELD_COMMAND_SHOW_OBJECTS

#define FIELD_COMMAND_SHOW_OBJECTS (   n)    (0x353 + (n))

shows them

Definition at line 46 of file field_map.h.

◆ FIELD_OBJECT_GROUPS

#define FIELD_OBJECT_GROUPS   6

Definition at line 47 of file field_map.h.

◆ FIELD_OBJECT_GROUP_ANIM

#define FIELD_OBJECT_GROUP_ANIM   100

the StageTile.anim of group 0; group n has 100 + n

Definition at line 48 of file field_map.h.

◆ FIELD_COMMAND_PLAY_INFO_SIG

#define FIELD_COMMAND_PLAY_INFO_SIG   0x365

Definition at line 49 of file field_map.h.

◆ FIELD_COMMAND_PLAY_GAYALOOP

#define FIELD_COMMAND_PLAY_GAYALOOP   0x366

Definition at line 50 of file field_map.h.

◆ FIELD_COMMAND_STOP_GAYALOOP

#define FIELD_COMMAND_STOP_GAYALOOP   0x367

Definition at line 51 of file field_map.h.

◆ FIELD_COMMAND_PLAY_WEAR_OFF

#define FIELD_COMMAND_PLAY_WEAR_OFF   0x368

Definition at line 52 of file field_map.h.

◆ FIELD_COMMAND_PLAY_DEMO_BGM

#define FIELD_COMMAND_PLAY_DEMO_BGM   0x369

Definition at line 53 of file field_map.h.

◆ FIELD_COMMAND_PLAY_SE000002

#define FIELD_COMMAND_PLAY_SE000002   0x36A

Definition at line 54 of file field_map.h.

◆ FIELD_COMMAND_PLAY_BEAM_SHT

#define FIELD_COMMAND_PLAY_BEAM_SHT   0x36B

Definition at line 55 of file field_map.h.

◆ FIELD_COMMAND_PLAY_SWITCH02

#define FIELD_COMMAND_PLAY_SWITCH02   0x36C

Definition at line 56 of file field_map.h.

◆ FIELD_COMMAND_PLAY_MASK_SET

#define FIELD_COMMAND_PLAY_MASK_SET   0x36D

Definition at line 57 of file field_map.h.

◆ FIELD_COMMAND_PLAY_BM_ERASE

#define FIELD_COMMAND_PLAY_BM_ERASE   0x36E

Definition at line 58 of file field_map.h.

◆ FIELD_COMMAND_PLAY_LD_ERASE

#define FIELD_COMMAND_PLAY_LD_ERASE   0x36F

Definition at line 59 of file field_map.h.

◆ FIELD_COMMAND_PLAY_PLAYER11

#define FIELD_COMMAND_PLAY_PLAYER11   0x370

Definition at line 60 of file field_map.h.

◆ FIELD_COMMAND_STOP_PLAYER11

#define FIELD_COMMAND_STOP_PLAYER11   0x371

Definition at line 61 of file field_map.h.

◆ FIELD_COMMAND_SHAKE_CAMERA

#define FIELD_COMMAND_SHAKE_CAMERA   0x372

Definition at line 62 of file field_map.h.

◆ FIELD_COMMAND_STOP_CAMERA_SHAKE

#define FIELD_COMMAND_STOP_CAMERA_SHAKE   0x373

Definition at line 63 of file field_map.h.

◆ FIELD_COMMAND_PLAY_TRAP_OFF

#define FIELD_COMMAND_PLAY_TRAP_OFF   0x374

Definition at line 64 of file field_map.h.

◆ FIELD_COMMAND_PLAY_SAVEDEMO

#define FIELD_COMMAND_PLAY_SAVEDEMO   0x375

Definition at line 65 of file field_map.h.

◆ FIELD_COMMAND_SEARCH_EVENT_SPOT

#define FIELD_COMMAND_SEARCH_EVENT_SPOT   0x376

FIELDSTG_searchEventSpot.

Definition at line 66 of file field_map.h.

◆ FIELD_COMMAND_PLAY_SWITCH03

#define FIELD_COMMAND_PLAY_SWITCH03   0x377

Definition at line 67 of file field_map.h.

◆ FIELD_COMMAND_PLAY_SN_ENTRY

#define FIELD_COMMAND_PLAY_SN_ENTRY   0x378

Definition at line 68 of file field_map.h.

◆ FIELD_COMMAND_PLAY_SN_ERASE

#define FIELD_COMMAND_PLAY_SN_ERASE   0x379

Definition at line 69 of file field_map.h.

◆ FIELD_COMMAND_PLAY_TELEPORT

#define FIELD_COMMAND_PLAY_TELEPORT   0x37A

Definition at line 70 of file field_map.h.

◆ FIELD_COMMAND_PLAY_BULB_003

#define FIELD_COMMAND_PLAY_BULB_003   0x37C

Definition at line 71 of file field_map.h.

◆ FIELD_COMMAND_PLAY_GONDRA_S

#define FIELD_COMMAND_PLAY_GONDRA_S   0x37D

Definition at line 72 of file field_map.h.

◆ FIELD_COMMAND_PLAY_PIYOPIYO

#define FIELD_COMMAND_PLAY_PIYOPIYO   0x37E

Definition at line 73 of file field_map.h.

◆ FIELD_COMMAND_PLAY_COMCD103

#define FIELD_COMMAND_PLAY_COMCD103   0x37F

Definition at line 74 of file field_map.h.

◆ FIELD_COMMAND_PLAY_COMCD201

#define FIELD_COMMAND_PLAY_COMCD201   0x380

Definition at line 75 of file field_map.h.

◆ FIELD_COMMAND_PLAY_COMCD111

#define FIELD_COMMAND_PLAY_COMCD111   0x381

Definition at line 76 of file field_map.h.

◆ FIELD_COMMAND_PLAY_BEAM_HIT

#define FIELD_COMMAND_PLAY_BEAM_HIT   0x382

Definition at line 77 of file field_map.h.

◆ FIELD_COMMAND_PLAY_SWITCH01

#define FIELD_COMMAND_PLAY_SWITCH01   0x383

Definition at line 78 of file field_map.h.

◆ FIELD_COMMAND_PLAY_COMCD115

#define FIELD_COMMAND_PLAY_COMCD115   0x384

Definition at line 79 of file field_map.h.

◆ FIELD_COMMAND_STOP_COMCD115

#define FIELD_COMMAND_STOP_COMCD115   0x385

Definition at line 80 of file field_map.h.

◆ FIELD_COMMAND_STOP_BEAM_HIT

#define FIELD_COMMAND_STOP_BEAM_HIT   0x386

Definition at line 81 of file field_map.h.

◆ FIELD_MAP_FLOOR0

#define FIELD_MAP_FLOOR0   0

Some of FieldMap's maps (files): those of the floors the player walks on come first, and GAME.mapIndex picks one (FieldMap.setMap, SLOT_MAP)

Definition at line 85 of file field_map.h.

◆ FIELD_MAP_FLOOR1

#define FIELD_MAP_FLOOR1   1

Definition at line 86 of file field_map.h.

◆ FIELD_MAP_AREAS

#define FIELD_MAP_AREAS   4

a cell's value: its battle area (FieldBattles), or 0

Definition at line 87 of file field_map.h.

◆ FIELD_MAP_TRIGGERS

#define FIELD_MAP_TRIGGERS   7

a cell's value: a direction (3 bits) and a StageSlot (5)

Definition at line 88 of file field_map.h.

◆ SCRIPT_END

#define SCRIPT_END   0

The commands of an event script (FieldEvent.script), as FIELDSTG_runEvent reads them: a halfword kind << 8 | variant, then a fixed number of arguments.

x and y are in pixels, ids are the characters' (Actor.key1) below 0x320 and the script commands' from 0x320 on. ends the event (and any unknown kind)

Definition at line 156 of file field_map.h.

◆ SCRIPT_PLACE

#define SCRIPT_PLACE (   id,
  x,
  y 
)    0x100, id, x, y

puts a character at (x, y)

Definition at line 157 of file field_map.h.

◆ SCRIPT_POSE

#define SCRIPT_POSE (   id,
  set,
  dir 
)    0x101, id, set, dir

Actor.setPose: its animation set, facing dir.

Definition at line 158 of file field_map.h.

◆ SCRIPT_COMMAND

#define SCRIPT_COMMAND (   id,
  command,
  arg 
)    0x101, id, command, arg

the same word for a script command's id: FIELDSTG_setEventPose creates its task if none runs and hands it the command and the argument (FIELDSTG_handleScriptCommand)

Definition at line 161 of file field_map.h.

◆ SCRIPT_WALK

#define SCRIPT_WALK (   id,
  x,
  y,
  dir 
)    0x102, id, x, y, dir

Actor.setGoal: walks to (x, y), then faces dir.

Definition at line 162 of file field_map.h.

◆ SCRIPT_TALK

#define SCRIPT_TALK (   box,
  entry,
  id,
  kind 
)    0x200, 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 character id, or for kind 4 a message box (FIELDSTG_createSpeech)

Definition at line 165 of file field_map.h.

◆ SCRIPT_WAIT

#define SCRIPT_WAIT (   frames)    0x300, frames

Definition at line 166 of file field_map.h.

◆ SCRIPT_WAIT_BOX

#define SCRIPT_WAIT_BOX   0x301

until box 0 closes

Definition at line 167 of file field_map.h.

◆ SCRIPT_WAIT_WALK

#define SCRIPT_WAIT_WALK (   id)    0x302, id

until the character gets to its goal

Definition at line 168 of file field_map.h.

◆ SCRIPT_WAIT_ANIM

#define SCRIPT_WAIT_ANIM (   id)    0x303, id

until its animation ends

Definition at line 169 of file field_map.h.

◆ SCRIPT_LEAVE

#define SCRIPT_LEAVE (   mode,
  x,
  y,
  dir 
)    0x304, mode, x, y, dir

FIELDSTG_leaveField; ends the event.

Definition at line 170 of file field_map.h.

◆ SCRIPT_FOLLOW

#define SCRIPT_FOLLOW (   snap,
  id 
)    0x600, snap, id

FIELDSTG_followWithCamera.

Definition at line 171 of file field_map.h.

◆ SCRIPT_LOOK_AT

#define SCRIPT_LOOK_AT (   snap,
  x,
  y 
)    0x601, snap, x, y

FIELDSTG_pointCamera.

Definition at line 172 of file field_map.h.

◆ FIELD_CHARACTER_PLAYER

#define FIELD_CHARACTER_PLAYER   2

The characters (Actor.key1, FieldActorEntry.id) that FIELDSTG_updateField creates for the party.

A field can list one of the player's other characters, 1, 0x6A, 0x146 or 0x147, to lead instead, without partners.

Definition at line 185 of file field_map.h.

◆ FIELD_CHARACTER_PARTNERS

#define FIELD_CHARACTER_PARTNERS   3
  • the partner (GAME.funcs.getPartyPartner)

Definition at line 186 of file field_map.h.

◆ FIELD_FLAG_ENCOUNTERED

#define FIELD_FLAG_ENCOUNTERED   0xF

The FLAGS_00 flag that every encounter sets (FIELDSTG_startEncounter); until it is set, the stages' slots run an event before the first battle.

Definition at line 190 of file field_map.h.

◆ LIFT_UP

#define LIFT_UP   0x348

The lift: the map objects 3 (always shown) and 2 (shown while it moves), which move 0x7F pixels up or down the screen with the player, shaking before and after, each time a script command sets TASK_DONE: FIELDSTG's (FIELDSTG_createLift, script command 826) and the copies of WSTAG261 and WSTAG934 (common/update_tile_lift.inc.c)

the lift's script commands: up the screen,

Definition at line 235 of file field_map.h.

◆ LIFT_DOWN

#define LIFT_DOWN   0x349

and back down to the objects' place on the map

Definition at line 236 of file field_map.h.

◆ SLOT_EXIT

#define SLOT_EXIT   1

The kinds of StageSlot (type).

SLOT_DEPTH, SLOT_MAP, SLOT_EVENT, the slides and SLOT_LAUNCH act as the player steps on them; the others show a balloon and wait for cross, and those up to SLOT_GAUGE only while the player faces them (FIELDSTG_findTrigger) leaves for mode arg at (x, y), facing dir

Definition at line 255 of file field_map.h.

◆ SLOT_CLIMB_UP

#define SLOT_CLIMB_UP   2

Definition at line 256 of file field_map.h.

◆ SLOT_CLIMB_DOWN

#define SLOT_CLIMB_DOWN   3

Definition at line 257 of file field_map.h.

◆ SLOT_DROP

#define SLOT_DROP   4

Definition at line 258 of file field_map.h.

◆ SLOT_DEPTH

#define SLOT_DEPTH   5

the player's depth, arg

Definition at line 259 of file field_map.h.

◆ SLOT_MAP

#define SLOT_MAP   6

the map the player is on, arg (FieldMap.setMap)

Definition at line 260 of file field_map.h.

◆ SLOT_GAUGE

#define SLOT_GAUGE   7

the gauge game

Definition at line 261 of file field_map.h.

◆ SLOT_EVENT

#define SLOT_EVENT   8

starts the event arg

Definition at line 262 of file field_map.h.

◆ SLOT_WARP1

#define SLOT_WARP1   9

a warp (FieldWarp at arg) with effect and cutscene 1

Definition at line 263 of file field_map.h.

◆ SLOT_WARP0

#define SLOT_WARP0   10

the same with effect and cutscene 0

Definition at line 264 of file field_map.h.

◆ SLOT_SLIDE

#define SLOT_SLIDE   11

Definition at line 265 of file field_map.h.

◆ SLOT_STOP_SLIDE

#define SLOT_STOP_SLIDE   12

Definition at line 266 of file field_map.h.

◆ SLOT_LAUNCH

#define SLOT_LAUNCH   13

sends the player flying (FIELDSTG_launchActor)

Definition at line 267 of file field_map.h.

◆ SLOT_LAUNCH_OUT

#define SLOT_LAUNCH_OUT   14

the same, then leaves for mode arg

Definition at line 268 of file field_map.h.

◆ SLOT_DEST

#define SLOT_DEST (   slot)    ((SlotDest *)&(slot)->arg)

A slot's destination: its arg on, read as signed halfwords.

Definition at line 302 of file field_map.h.

◆ ACTOR_POSED

#define ACTOR_POSED   0

What an actor is doing, its substate (FIELDSTG_runActorAction)

in the pose an event set (FIELDSTG_setActorPose)

Definition at line 305 of file field_map.h.

◆ ACTOR_STAND

#define ACTOR_STAND   1

Definition at line 306 of file field_map.h.

◆ ACTOR_WALK

#define ACTOR_WALK   2

Definition at line 307 of file field_map.h.

◆ ACTOR_RUN

#define ACTOR_RUN   3

Definition at line 308 of file field_map.h.

◆ ACTOR_STOP

#define ACTOR_STOP   4

stops after a run

Definition at line 309 of file field_map.h.

◆ ACTOR_WALK_OUT

#define ACTOR_WALK_OUT   5

walks off through an exit (FIELDSTG_walkActorInDir)

Definition at line 310 of file field_map.h.

◆ ACTOR_CLIMB

#define ACTOR_CLIMB   0x40

holds on to a wall (FIELDSTG_controlClimb)

Definition at line 311 of file field_map.h.

◆ ACTOR_CLIMB_UP

#define ACTOR_CLIMB_UP   0x41

Definition at line 312 of file field_map.h.

◆ ACTOR_CLIMB_DOWN

#define ACTOR_CLIMB_DOWN   0x42

Definition at line 313 of file field_map.h.

◆ ACTOR_GET_ON_WALL

#define ACTOR_GET_ON_WALL   0x43

from below (FIELDSTG_startClimbUp)

Definition at line 314 of file field_map.h.

◆ ACTOR_GET_OVER_EDGE

#define ACTOR_GET_OVER_EDGE   0x44

onto the wall from above (FIELDSTG_startClimbDown)

Definition at line 315 of file field_map.h.

◆ ACTOR_CLIMB_OFF_TOP

#define ACTOR_CLIMB_OFF_TOP   0x45

Definition at line 316 of file field_map.h.

◆ ACTOR_CLIMB_OFF_BOTTOM

#define ACTOR_CLIMB_OFF_BOTTOM   0x46

Definition at line 317 of file field_map.h.

◆ ACTOR_DROP

#define ACTOR_DROP   0x47

FIELDSTG_startDrop.

Definition at line 318 of file field_map.h.

◆ ACTOR_GAUGE

#define ACTOR_GAUGE   0x48

plays the gauge game (FIELDSTG_startActorGauge)

Definition at line 319 of file field_map.h.

◆ ACTOR_SEARCH

#define ACTOR_SEARCH   0x49

searches a hidden spot

Definition at line 320 of file field_map.h.

◆ ACTOR_TALK

#define ACTOR_TALK   0x4A

answers the actor that talks to it (talkPartner)

Definition at line 321 of file field_map.h.

◆ ACTOR_FLY

#define ACTOR_FLY   0x4B

flies on, triangle held (FIELDSTG_controlFlight)

Definition at line 322 of file field_map.h.

◆ ACTOR_FLOAT

#define ACTOR_FLOAT   0x4C

slows down in the air

Definition at line 323 of file field_map.h.

◆ ACTOR_USE

#define ACTOR_USE   0x4D

works one of the objects 0x148, 0x15F and 0x160

Definition at line 324 of file field_map.h.

◆ ACTOR_USED

#define ACTOR_USED   0x4E

that object

Definition at line 325 of file field_map.h.

◆ ACTOR_SLIDE

#define ACTOR_SLIDE   0x4F

FIELDSTG_startActorSlide.

Definition at line 326 of file field_map.h.

◆ ACTOR_STOP_SLIDE

#define ACTOR_STOP_SLIDE   0x50

Definition at line 327 of file field_map.h.

Function Documentation

◆ FIELDSTG_startEvent()

struct EventTask * FIELDSTG_startEvent ( s32  id)

FIELDSTG functions the stages call.

creates the task of an event object

FIELDSTG functions the stages call.

< every character (FIELDSTG_createActor)

Definition at line 250 of file event.c.

Referenced by FIELDSTG_offerTrigger(), FIELDSTG_runChoice(), FIELDSTG_runStoryEvents(), FIELDSTG_startListedEvent(), updateEvent1510(), updateEvent1512(), updateEvent1514(), updateEvent1516(), updateEvent1518(), updateEvent1520(), updateEvent9(), updateMenu(), updateStage(), and updateTimer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FIELDSTG_findObject()

StageTile * FIELDSTG_findObject ( s32  anim)

the first map object with that animation

the first map object with that animation

Definition at line 171 of file map_objects.c.

Referenced by updateFrameTask(), and updateTileGroup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FIELDSTG_findNextObject()

StageTile * FIELDSTG_findNextObject ( void  )

and the next, or NULL

and the next, or NULL

Definition at line 152 of file map_objects.c.

Referenced by FIELDSTG_findObject().

Here is the caller graph for this function:

◆ FIELDSTG_startEventBattle5()

void * FIELDSTG_startEventBattle5 ( void  )

starts a battle: the handler of the stages' events 9000

starts a battle: the handler of the stages' events 9000

Definition at line 1010 of file field.c.

Here is the call graph for this function:

◆ FIELDSTG_leaveField()

void FIELDSTG_leaveField ( s32  mode,
s32  arg,
s32  x,
s32  y,
s32  dir 
)

FIELDSTG's functions and data that the executable calls (game/events.c, system/overlay.c), by these names in its link (config/eu/undefined_syms.txt)

leaves the field for a mode

FIELDSTG's functions and data that the executable calls (game/events.c, system/overlay.c), by these names in its link (config/eu/undefined_syms.txt)

Definition at line 702 of file field.c.

Referenced by applyAction(), FIELDSTG_runEvent(), FIELDSTG_setOffTrigger(), startCardBattle(), and warpAway().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FIELDSTG_startListedEvent()

void FIELDSTG_startListedEvent ( s32  index)

starts the event FIELDSTG_eventIds[index]

starts the event FIELDSTG_eventIds[index]

< the field's main task (FIELDSTG_createField)

Definition at line 1019 of file field.c.

Referenced by applyAction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FIELDSTG_openInn()

void FIELDSTG_openInn ( void  )

opens the inn

opens the inn

< the field's main task (FIELDSTG_createField)

< the map, its objects and characters, and the menus

Definition at line 1027 of file field.c.

Referenced by applyAction().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ FIELDSTG_map

◆ FIELDSTG_state

FieldState FIELDSTG_state
extern

Definition at line 2641 of file fieldstg.c.

Referenced by createCharacters(), createParty(), drawEffect(), drawEffect(), drawFaller(), drawFloaterPart(), drawPairSprite(), drawStageEffect(), FIELDSTG_controlFlight(), FIELDSTG_controlPlayer(), FIELDSTG_countBattleSteps(), FIELDSTG_createActor(), FIELDSTG_createBanner(), FIELDSTG_createHiddenSpots(), FIELDSTG_createSpeech(), FIELDSTG_createTalk(), FIELDSTG_drawCoverBlock(), FIELDSTG_drawMapObject(), FIELDSTG_drawStream(), FIELDSTG_findObject(), FIELDSTG_launchActor(), FIELDSTG_leaveFieldAfter(), FIELDSTG_loadFieldFiles(), FIELDSTG_moveByPad(), FIELDSTG_openInn(), FIELDSTG_pickStage(), FIELDSTG_requestSlotFiles(), FIELDSTG_runActorAction(), FIELDSTG_runEvent(), FIELDSTG_runLaunch(), FIELDSTG_runStoryEvents(), FIELDSTG_setOffTrigger(), FIELDSTG_setupField(), FIELDSTG_startActorGauge(), FIELDSTG_startAreaBattle(), FIELDSTG_startClimbDown(), FIELDSTG_startClimbUp(), FIELDSTG_startDrop(), FIELDSTG_startEncounter(), FIELDSTG_startEvent(), FIELDSTG_startEventBattle(), FIELDSTG_startEventBattle5(), FIELDSTG_talkToActorAt(), FIELDSTG_updateActor(), FIELDSTG_updateBalloon(), FIELDSTG_updateBanner(), FIELDSTG_updateField(), FIELDSTG_updateHiddenSpots(), FIELDSTG_updateLift(), FIELDSTG_updateMapObjects(), FIELDSTG_updateTriggers(), FIELDSTG_warpActor(), findTileSix(), findTileSixW(), findTileSixW(), openFieldMenu(), runClimbOffBottom(), runClimbOffTop(), runDrop(), runGauge(), runSearch(), runSlide(), runStopSlide(), runTalk(), runUse(), setupStage(), showField(), showObjectGroups(), startEvent9000(), startEvent9001(), startField(), updateClutTile(), updateCommand833(), updateCommand834(), updateMover(), updateRisers(), updateSoundTile(), updateStage(), updateStage(), updateStillTile(), updateTileAnims(), updateTileAt(), updateTileCursors(), updateTileDuo(), updateTileEffect(), updateTileLift(), updateTileLoop2(), updateTileOnce(), updateTilePair(), updateTilePair16(), updateTilePairN(), updateTileQuad(), updateTileSeqs(), updateTileSeqs8(), updateTileSet(), updateTileSolo(), updateTileSwitch(), updateTileTask(), updateTileTimer(), updateTimer(), updateWanderer(), and updateWanderPair().

◆ FIELDSTG_battleFuncs

FieldBattleFuncs FIELDSTG_battleFuncs
extern

Definition at line 3653 of file fieldstg.c.

Referenced by applyAction(), FIELDSTG_runGauge(), and FIELDSTG_updateHiddenSpots().