stage_enemy_faction_id
Global of Himegari Dungeon Meister: the cell G:0xe7799, of type int[30], data-table, values the slot's army: 0 gray, 2 blue, 3 green (current_faction_id's colours); 1, the player's red, is never written.
Per-spawn faction. FIELD and ADDEN copy it into the runtime unit's entity_faction_ids (FIELD@0x93c-0x94a) and choose the entity band by it: 2 and 3 take entities faction * 10 - 9 on (11..20, 21..30), 0 takes 31 on (FIELD@0x8c8-0x926); the player's units are 1..10. Every army is hostile to every other: an offensive action and the AI's targeting take a unit whose faction differs from the actor's (SETMVWORK@0x66-0x89, RTN_M051@0x80-0x95), so no slot is the player's ally, and the rout victory rule (STINIT's 0xe7308 = -1) waits while factions 0, 2 or 3 have a unit left (FIELD@0x8f1c-0x8f31). Each army moves in its own phase: current_faction_id runs 1, 2, 3, 0. Over STINIT's stages faction 2 has 1,065 slots and is the stage's main enemy (stage 1's orcs), 0 has 242 and mostly holds the dungeon's stray monsters, and 3 has 71, a third side such as stage 104's knights and angels beside the demon lord's army.
OME’s registry gives it with high confidence, from investigation. The base mod himegari-base exports the name, so Lua and an event’s fields can use it.
Record tables
It is a field of the table stage_enemy, as stage_enemy.id.faction_id.
Scripts that use it
The game’s scripts whose instructions read, write or index (take as an array’s base) the cell, with how many of their operands do each, from OME’s script index.
| Script | Reads | Writes | Indexes |
|---|---|---|---|
STINIT | 0 | 1136 | 1 |
FIELD | 0 | 0 | 19 |
$1$STINIT | 0 | 15 | 1 |
ADDEN | 0 | 0 | 5 |