Macro catalogue through Scenario 03

Macro / constructOriginPurpose in these scenarios
TROW_GI_TRACK + journey macroCampaign utilityUpdates the Green Isle journey presentation for each stage.
TROW_DEATHSCampaign utilityInjects shared last-breath and defeat/vanish behavior for recurring heroes.
TURNS, GOLD, INCOME, ON_DIFFICULTYCoreDifficulty-dependent balance values.
NO_SCOUTSCoreModifies AI recruitment behavior.
STARTING_VILLAGESCoreAssigns initial village control.
LOYAL_UNIT, GUARD_UNIT, GUARDIANCoreCreates fixed, loyal, or stationary supporting units.
LOOT, FULL_HEAL, NEW_GOLD_CARRYOVERCoreRewards, escape handling, and campaign economy.
NORTH_GUARDScenario 02 localCreates three named, difficulty-scaled loyal defenders.
ESCAPE_VICTORYScenario 03 localPackages route-choice dialogue, state, and next-scenario overrides.

Event-pattern catalogue

PatternExampleReusable purpose
prestart setupObjectives, recalls, fixed units, imagesPrepare state before the player sees the map.
start expositionAll three scenariosExplain the immediate tactical situation after setup.
Turn reminder01 turn 5/20; 02 turn 14Teach or reinforce urgency without changing objectives.
last breath decisionWesfolk leader in 02Run dialogue and choice before death resolution.
Filtered killerOrc leader loot; Wesfolk killed by orcsMake result depend on who caused the death.
Map-area movement triggerOrcs enter Stormvale; Haldric finds BurinBind narrative to geography.
First boss death escalation03 reinforcement waveKeep a multi-leader scenario challenging.
Victory-time route menu03 ESCAPE_VICTORYSelect a branch after tactical success.
allow_undo flavor trigger03 signpostsPermit reading flavor text without consuming a move.

Shared death utility behavior

TROW_DEATHS is not just a list of defeat conditions. Different heroes receive different semantics: Haldric, Eldaric, Jessene, and Lord Typhon can cause defeat; Lady Outlaw vanishes and updates stored state; Burin and several later companions receive character-specific final lines.

Architecture lesson. Centralizing recurring hero-death logic keeps scenario files focused and ensures consistent consequences across the campaign.

TROW_DEATHS source · Utility directory

Scenario 04 macro and event patterns

ConstructRoutePurpose
TEMPLE_HELP, TEMPLE_TRAP, TEMPLE_LOOTSwampTurn map coordinates into reusable, randomly assigned points of interest.
RANDOM 1..3 plus conditional macro placementSwampProduces three controlled exploration layouts.
Nested new turn event inside movetoSwampDelays an adaptive ambush until the next turn.
filter_vision and adjacent visibility filtersSwampFinds the boundary between visible and hidden map areas.
while search-radius expansionSwampFinds a valid ambush hex without assuming a fixed player route.
Nested new turn event inside attackMidlandsSchedules a leader-specific reserve wave after combat begins.
Leader die event funding the surviving sideMidlandsMaintains multi-front pressure after one chief falls.

Oldwood arc macros and event patterns

ConstructOriginPurpose
GUARD_UNITCampaign utilityCreates named loyal guardian units with ai_special=guardian.
RISE_UP_RISE_UPCampaign utilityRaises a fallen ally as a hostile difficulty-scaled corpse while preserving undead variation.
OBJ_POTION_HOLY_ALTCore item macroPlaces an interactive holy-water pickup that appends arcane to melee attacks for the scenario.
CLEAR_FOG / UNCLEAR_FOGCoreTemporarily reveals the Wose speaker for opening dialogue.
modify_side share_vision=allWML actionSynchronizes allied vision after the battle.
victory_when_enemies_defeated=noScenario keySupports compound objectives and cutscene-only scenarios.
store_unit / unstore_unitWML actionsPreserve a companion through an off-screen scouting interlude.
Reconstruction from stored fieldsScenario 07 local patternTransforms Lady Outlaw into Lady Jessene while retaining intended progression data.

Campaign macro source · Core item source

Scenarios 08–10 macro and event patterns

ConstructScenarioPurpose
BOARDING_EVENT08 localGenerates three consistent Haldric-only boarding interactions.
LIMIT_RECRUITS and set_extra_recruit08Restricts fragile recruits and unlocks advanced units based on gold.
AI reset, goal locations, avoid regions, attack disabling08Implements posture-based allied defense.
time_area with custom schedule08Simulates lighthouse illumination in a local radius.
PETRIFIED and PETRIFIED_UNIT09 localCreates a visible but dormant enemy army.
unpetrify plus upkeep conversion09Activates the lich faction without replacing its units.
Haldric-only exit with temporary item flag09Requires both narrative artifact and protagonist staging.
Twin death counterpart check10Funds the survivor or rewards the player after the second death.
Exit event queries living enemy leaders10Selects standard or bonus victory without extra state variables.
remove_shroud as a combat reward10Turns boss defeat into navigation information.

Scenarios 11–13 macro and event patterns

ConstructScenarioPurpose
Cutscene_Minimal + 100% carryover settings11Runs a council scene without gameplay reports or economic loss.
Forever-duration [object] with new_attack12Adds the Ruby attack to Haldric without changing unit type.
SILENTLY_LIMIT_LEADER_MOVES12Keeps Addroran near defensive positions.
MODIFY_AI_DELETE_CANDIDATE_ACTION and repeated RESET_SIDE_AI12Rebuilds the allied defense each turn.
HERO plus appended modifications12Creates Typhon with guaranteed signature equipment.
LIVING_INTEL and UNDEAD_INTEL12–13Stages temporary information-gathering characters and antagonist visits.
OBJ_TRIDENT_STORM13, coreProvides a reusable eligible-unit pickup with a permanent magical attack.
Nested new turn inside item-region moveto13Delays a randomized Sea Serpent spawn until after the pickup turn.

Scenarios 14–16 macro and event patterns

ConstructScenarioPurpose
POSSIBLE_SERPENT_SPAWN_LOCS_SLF14 localReuses a deep-ocean distance-ring filter for both availability and storage.
Nested delayed new turn events14Schedule one serpent per enemy side after its first casualty.
MODIFY_AI_ADD_CANDIDATE_ACTION15Installs the campaign Lua no-suicide attack selector.
MODIFY_AI_DELETE_CANDIDATE_ACTION15Removes competing standard combat actions.
modify_turns value then add15Transforms survived turns into early-finish bonus turns.
DRAGON, BEACH, HOLE, ISLE16 localDefine state-filtered hub destinations.
QUESTS / QUEST_CHOICES16 localRender unfinished descriptions and selectable routes.
GREET16 localRenders return dialogue from last_done.
#undef cleanup16Removes all seven local hub macros after preprocessing the file.

Scenario 17 branch macros and patterns

ConstructBranchPurpose
GOLD_TO_BADDIESDragon localFunds all Saurian sides consistently when the Dragon awakens.
Approach event plus fallback turn eventDragonCreates one boss from either spatial or temporal trigger.
Repeated Giant Mudcrawler death eventDragon / BeachCreates two smaller enemies from every large one.
LIMIT_CONTEMPORANEOUS_RECRUITSBeach / HoleCaps high-impact unit density across one or several sides.
SPIDER_TRAIT with additive tagsHole localAppends difficulty-specific traits to GUARD_UNIT results.
TEMP_LOOT, TEMP_QUEEN, TEMP_EMPTYIsle localAssign random interaction identities to fixed temple coordinates.
Objective show_if by living unitsIsleSwitches displayed victory requirement when the Queen is created.
Boss-death faction cleanupIsleKills remaining undead without firing individual death events.
#undef cleanupDragon / Hole / IsleRemoves local helper macros after the scenario.

Scenarios 18–20 event patterns

ConstructScenarioPurpose
store_unit kill=no then renamed unstore_unit18Creates a temporary duplicate without moving the persistent hero.
remove_object object_id=ruby_of_fire19Physically removes a permanent artifact attack.
Dynamic variable names such as side_$unit.side|_...19Runs one generic proportional-loss handler for three enemy sides.
Nested new turn delayed_variable_substitution=no19Preserves trigger context while evaluating future search variables later.
Expanding-radius location search19Finds a legal front-related reinforcement point exactly 12 hexes from the player.
Objective show_if with have_unit20Displays Jessene’s defeat condition only after her return.
modify_side fog=yes20Changes battlefield visibility during play.
Geographic encounter plus allow_recruit20Creates Saurians and permanently expands current enemy recruit lists.

Endgame event patterns

ConstructPurpose
unit_overlayTurns Aethyr into a visible treaty carrier.
Paired last breath and die with filter_secondDistinguishes valid and invalid Aethyr deaths.
Repeated leader-death queriesEnforces the exact-one-orc-survivor condition.
switch on stored sideSelects one of four boat escape routes.
New-turn bridge condition checksDestroy routes only when player proximity makes the event relevant.
Random future-turn variablesSchedule recurring corpse and skeleton pressure inside bounded windows.
random_placement allow_less=yesPlaces as many legal undead reinforcements as the map state permits.
Conditional companion epilogue blockShows futures only when at least one optional companion survives.