stage_enemy
Record table of Himegari Dungeon Meister, records 0 to 29, 15 fields.
The current stage's enemy slots. STINIT, the stage loader FIELD calls (FIELD@0x200), zeroes all 30 slots of each array and writes the stage's (no stage gives slot 0 a unit). FIELD places the slots at the stage's start (FIELD@0x7f4), ADDEN places one later when a stage's handler calls it (current_stage_enemy_spawn_slot), and SETEN copies a slot's routines into its entity. A data file reaches it through the stage scope.
The game builds it when a stage loads, so a data file reaches it through the scope stage (ids 1 to 999): record r of stage id is [stage.id.enemy.r], and a field stage.id.enemy.r.field.
The scope stage: A stage, by current_stage_id. STINIT's stages are 1 to 170, and the per-stage arrays hold 1,000 (stage_loader_script_ids). himegari-base applies a scoped table at himegari.stage.loaded, whose stage is the id.
The database lists it: each of the stages lists its enemies.
Fields
Each field is a global, one cell per record, named under the field. The last column is what a data file may write to it, as the base mod himegari-base’s shape says.
| Field and its global | Type | Refers to | In a data file |
|---|---|---|---|
spawn_tile_xstage_enemy_spawn_tile_x | int[30] | — | yes: a whole number |
spawn_tile_ystage_enemy_spawn_tile_y | int[30] | — | yes: a whole number |
spawn_object_slotstage_enemy_spawn_object_slot | int[30] | — | yes: a whole number |
faction_idstage_enemy_faction_id | int[30] | — | yes: a whole number |
difficulty_maskstage_enemy_difficulty_mask | int[30] | — | yes: a whole number |
first_clear_onlystage_enemy_first_clear_only | int[30] | — | yes: a whole number |
random_selection_weightstage_enemy_random_selection_weight | int[30] | — | yes: a whole number |
unit_idstage_enemy_unit_id | int[30] | unit | yes: a whole number |
min_levelstage_enemy_min_level | int[30] | — | yes: a whole number |
max_levelstage_enemy_max_level | int[30] | — | yes: a whole number |
auto_level_scale_divisorstage_enemy_auto_level_scale_divisor | int[30] | — | yes: a whole number |
movement_routine_set_idsstage_enemy_movement_routine_set_ids | int[30][3] | — | yes: a row of 3 columns by name; write movement_routine_set_ids.<column> = ... |
battle_routine_set_idsstage_enemy_battle_routine_set_ids | int[30][3] | — | yes: a row of 3 columns by name; write battle_routine_set_ids.<column> = ... |
required_story_flagsstage_enemy_required_story_flags | int[30][7] | — | yes: a row of 7 columns by name; write required_story_flags.<column> = ... |
forbidden_story_flagsstage_enemy_forbidden_story_flags | int[30][5] | — | yes: a row of 5 columns by name; write forbidden_story_flags.<column> = ... |