Preserves the Wesfolk leader’s unit state, especially experience, across the transition.
Temporary cross-scenario storage.
have_lady
Written in 02; also changed by TROW_DEATHS
Whether Lady Outlaw is currently part of the refugee party.
Persistent campaign decision/state flag.
lady_store
Prepared in 02 when the rejected leader still exists
Converted Lady Outlaw identity and side metadata for later campaign logic.
Persistent stored-unit data.
escape_choice
Written at the end of 03
Records the selected route: 1 for Swamp of Esten, 2 for Midlands.
Persistent branch flag.
State-machine view of Lady Outlaw
Wesfolk Leader stored after Scenario 01
│
▼
experience restored in Scenario 02
│
├── accepted ──► recreated as side-1 Lady Outlaw ──► have_lady = 1
│
└── rejected ──► escapes / stored for later logic ──► have_lady = 0
TROW_DEATHS can later set have_lady = 0 and store her if she vanishes on last breath.
Authoring lessons
Practice
Why it helps
Use explicit scalar flags for major choices
Easy to filter later dialogue, recalls, and branches.
Use stored units when experience and other unit fields matter
A boolean alone cannot preserve advancement state.
The route flag escape_choice chooses which scenario loads; last_done records which route was actually completed after both branches converge.
Oldwood arc state lifecycle
Name
Used in
Purpose
Cleanup
escape_choice
03 → 04 route selection
Loads Swamp or Midlands.
Cleared at Scenario 05 prestart.
last_done
04 victory transition
Labels the branch just completed.
Cleared at Scenario 05 prestart.
Have_Ruby
06 only
Joins the lich-kill and chest objectives.
Cleared at Scenario 06 victory.
lady_store
02/05 → 07
Preserves the Wesfolk companion’s type, experience, facing, and position through absence.
Cleared after Lady Jessene is reconstructed.
have_lady
02 → 07
Controls dialogue and whether outlaw recruitment needs repair.
Cleared after the identity reveal.
State-design contrast. The Ruby uses a temporary boolean because successful scenario completion guarantees later possession. Jessene uses stored-unit state because later code must preserve variable progression data.
Scenarios 08–10 state
Name or query
Scenario
Purpose
Lifecycle
previous_ai_position
08
Tracks allied garrison posture.
Cleared at victory.
First_Ship, Second_Ship, Third_Ship
08
Marks each ship’s boarding window.
Cleared on departure, boarding, or victory.
lich_free
09
Prevents repeat release choices and represents undead activation.
Cleared at scenario end.
have_book
09
Gates the sewer exit.
Cleared at scenario end because victory guarantees possession.
Killed_an_Orc
09
Temporary scenario bookkeeping declared elsewhere in the file.
Cleared at scenario end.
Leader-existence query
10
Determines standard versus bonus exit.
No stored variable required.
State-economy lesson. Scenario 10 derives its reward directly from living leader units. This is preferable to maintaining redundant kill flags when current game state already answers the question.
Southbay departure state design
Mechanic
State approach
Why
Book translation
No new variable in Scenario 11
The dialogue establishes a guaranteed process before Scenario 12.
Ruby possession and attack
Permanent unit object on Haldric
The mechanical fact belongs to the unit, not global campaign state.
Merfolk alliance
Persistent recruit-list modification
Recruit access itself is the required future state.
Addroran’s defensive posture
No variable
Recalculated from current unit positions each side-2 turn.
Optional Storm Trident
Core pickup state plus permanent unit object
Core macro manages one-use interaction and bearer modification.
Bitey coordinates
xx1, yy1
Temporary random spawn coordinates, cleared after creation.
Ka’lian hub state
Name
Initialized
Read by Scenario 16
Final cleanup
num_done
15: 0
Selects initial, intermediate, or final council dialogue.
16 when value reaches 4
the_dragon
15: 0
Shows Dragon description and option while incomplete.
16 final visit
a_beach
15: 0
Shows Lizard Beach description and option while incomplete.
16 final visit
troll_hole
15: 0
Shows Troll Hole description and option while incomplete.
16 final visit
cursed_isle
15: 0
Shows Cursed Isle description and option while incomplete.