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

DefinitionConfirmed call sitesContract
TROW_GI_TRACK / Green Isle journey macrosOpening through the ocean departure sequenceBuilds the completed and current journey on green_isle.webp.
TROW_GC_TRACK / Great Continent journey macros15–23 and all Scenario 17 branchesBuilds hub-aware routes on great_continent.webp.
TROW_DEATHSMost tactical chapters; omitted from pure cutscenesStandard Haldric/Jessene defeat and companion death behavior.
HERO03, 05, 08, 12, 15, 16, 21 and other named-allied stagingCreates loyal named heroes with stable IDs and portraits.
GUARD_UNIT02, 03, 05, 06, 17cCreates fixed loyal guardian units with guardian AI.
UNDEAD_INTEL09, 12, 17d, 20, 22Creates named undead story/intelligence units.
LIVING_INTEL12, 15, 20, 22Creates named living or Familiar-style scripted units.
RISE_UP_RISE_UP06 and 22Turns allied casualties into hostile corpses.
ABILITY_DISTRACTWesfolk Outcast/Lady/Leader unit definitionsAdjacent allies ignore enemy Zones of Control.

AI helper usage

Helper familyPrimary scenariosUse
GOAL_LOCATION, RESET_SIDE_AI, attack toggles08 — Clearwater PortStateful forward defense, retreat, wall holding, and offensive support.
RESET_SIDE_AI, weighted goals, leader move limits12 — A Final SpringRecomputed northern-castle, riverbank, and city-wall defense.
Candidate-action add/delete core macros15 — A New LandInstalls the custom no-suicide Lua attack selector.

Direct includes outside the root loader

DependencyCall sitesReason
utils/trow-nlmsg.cfg17a, 17b, 17c, 17dInjects branch-order reminder events into each quest scenario.
ai/ca_aggressive_attack_no_suicide.lua15, once for each continental AI sideReplaces only the incompatible attack-selection candidate action.
Core OBJ_POTION_HOLY_ALT06 and 17dReusable holy-water pickup.
Core OBJ_TRIDENT_STORM13Reusable permanent merfolk weapon pickup.

Local macro lifecycle

ScenarioLocal definitionsCleanup
02NORTH_GUARDScenario-local preprocessing scope.
03ESCAPE_VICTORYScenario-local preprocessing scope.
08BOARDING_EVENTUsed for three ship windows.
09PETRIFIED, PETRIFIED_UNITVisible dormant undead faction.
14POSSIBLE_SERPENT_SPAWN_LOCS_SLFShared location filter for check and storage.
16Seven hub option/rendering macrosAll explicitly #undef after the scenario.
17aGOLD_TO_BADDIESExplicitly undefined.
17cSPIDER_TRAITExplicitly undefined after random setup.
17dTEMP_LOOT, TEMP_QUEEN, TEMP_EMPTYExplicitly 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.