Load-time dependency graph
_main.cfg
├── [binary_path] campaign images and sounds
├── {utils/}
│ ├── bigmap.cfg
│ ├── trow-abilities.cfg
│ ├── trow-ai.cfg
│ ├── trow-deaths.cfg
│ ├── trow-macros.cfg
│ └── trow-nlmsg.cfg
├── [units] {units/} [/units]
├── {scenarios/}
└── Scenario 15 → ai/ca_aggressive_attack_no_suicide.lua
Campaign-defined macro call sites
| Definition | Confirmed call sites | Contract |
|---|---|---|
TROW_GI_TRACK / Green Isle journey macros | Opening through the ocean departure sequence | Builds the completed and current journey on green_isle.webp. |
TROW_GC_TRACK / Great Continent journey macros | 15–23 and all Scenario 17 branches | Builds hub-aware routes on great_continent.webp. |
TROW_DEATHS | Most tactical chapters; omitted from pure cutscenes | Standard Haldric/Jessene defeat and companion death behavior. |
HERO | 03, 05, 08, 12, 15, 16, 21 and other named-allied staging | Creates loyal named heroes with stable IDs and portraits. |
GUARD_UNIT | 02, 03, 05, 06, 17c | Creates fixed loyal guardian units with guardian AI. |
UNDEAD_INTEL | 09, 12, 17d, 20, 22 | Creates named undead story/intelligence units. |
LIVING_INTEL | 12, 15, 20, 22 | Creates named living or Familiar-style scripted units. |
RISE_UP_RISE_UP | 06 and 22 | Turns allied casualties into hostile corpses. |
ABILITY_DISTRACT | Wesfolk Outcast/Lady/Leader unit definitions | Adjacent allies ignore enemy Zones of Control. |
AI helper usage
| Helper family | Primary scenarios | Use |
|---|---|---|
GOAL_LOCATION, RESET_SIDE_AI, attack toggles | 08 — Clearwater Port | Stateful forward defense, retreat, wall holding, and offensive support. |
RESET_SIDE_AI, weighted goals, leader move limits | 12 — A Final Spring | Recomputed northern-castle, riverbank, and city-wall defense. |
| Candidate-action add/delete core macros | 15 — A New Land | Installs the custom no-suicide Lua attack selector. |
Direct includes outside the root loader
| Dependency | Call sites | Reason |
|---|---|---|
utils/trow-nlmsg.cfg | 17a, 17b, 17c, 17d | Injects branch-order reminder events into each quest scenario. |
ai/ca_aggressive_attack_no_suicide.lua | 15, once for each continental AI side | Replaces only the incompatible attack-selection candidate action. |
Core OBJ_POTION_HOLY_ALT | 06 and 17d | Reusable holy-water pickup. |
Core OBJ_TRIDENT_STORM | 13 | Reusable permanent merfolk weapon pickup. |
Local macro lifecycle
| Scenario | Local definitions | Cleanup |
|---|---|---|
| 02 | NORTH_GUARD | Scenario-local preprocessing scope. |
| 03 | ESCAPE_VICTORY | Scenario-local preprocessing scope. |
| 08 | BOARDING_EVENT | Used for three ship windows. |
| 09 | PETRIFIED, PETRIFIED_UNIT | Visible dormant undead faction. |
| 14 | POSSIBLE_SERPENT_SPAWN_LOCS_SLF | Shared location filter for check and storage. |
| 16 | Seven hub option/rendering macros | All explicitly #undef after the scenario. |
| 17a | GOLD_TO_BADDIES | Explicitly undefined. |
| 17c | SPIDER_TRAIT | Explicitly undefined after random setup. |
| 17d | TEMP_LOOT, TEMP_QUEEN, TEMP_EMPTY | Explicitly undefined. |
Maintenance rules demonstrated
Small shared surface, rich local composition. Stable cross-campaign behavior lives in six utilities. Scenario-specific repetition is refactored locally and, where appropriate, explicitly undefined. One specialized behavior crosses into Lua only because ordinary WML AI configuration cannot express the required combat simulation gate.
Root loader · Utilities · Lua candidate action · Scenario call sites
Machine-resolved custom-unit graph
The Core Dependency Closure resolves 31 transitive symbols with zero unresolved definitions and supplies a reusable local-checkout audit script.