Recipe 1: insert a linear tactical scenario

  1. Create scenarios/NN_New_Scenario.cfg with a unique id.
  2. Point the previous scenario’s next_scenario at the new ID.
  3. Point the new scenario at the original destination.
  4. Add a map only when existing geography cannot carry the story.
  5. Use TROW_DEATHS unless the chapter intentionally changes protected-character behavior.
  6. Add journey-map support in bigmap.cfg.
  7. Validate EASY, NORMAL, and HARD separately.
Save compatibility. Inserting a scenario changes future transitions for new saves. Existing saves already inside the surrounding scenarios must be tested deliberately.

Recipe 2: add a cutscene that reuses a map

[scenario]
    id=NN_Your_Cutscene
    next_scenario=NN_Next
    map_file=05_The_Oldwood.map
    turns=1
    theme=Cutscene_Minimal
    {AFTERNOON}
[/scenario]
  • Use 100% carryover and suppress the carryover report.
  • Hide or teleport persistent units instead of creating duplicate IDs accidentally.
  • Use store_unit kill=no only when a temporary modified copy is intended.
  • Reuse a known map when the changed meaning of the place matters.

Recipe 3: add a fifth Ka’lian-style quest

Required editWhy
Initialize a new completion flag in Scenario 15.The hub expects all branch state to exist before the first visit.
Add a quest description and state-filtered option macro in Scenario 16.Controls dialogue and route visibility.
Change the final threshold from 4 to 5.Prevents premature land grant.
Create the quest scenario and return to Scenario 16.Maintains hub convergence.
On victory: increment num_done, set the flag, set last_done.Preserves the three-field hub contract.
Add journey-map logic and reminder dialogue if needed.Keeps map presentation and return acknowledgements complete.
Expand final cleanup.Prevents the new flag surviving beyond the hub.

Five quests have 120 possible completion orders. Prefer automated state tests or a carefully designed pairwise matrix rather than hand-playing every permutation.

Recipe 4: add a named persistent hero

{HERO "Core Unit Type" "Stable Internal ID" _"Display Name" 1 x y "portraits/example.webp"}
  • Choose a stable ID before publishing.
  • Give recurring heroes the loyal trait through the macro rather than duplicating unit blocks.
  • Add a shared death event only when the character’s behavior is stable across scenarios.
  • Use stored-unit state when removing the hero temporarily; do not recreate a fresh unit if XP and traits matter.

Recipe 5: add a persistent artifact

acquisition event ↓ [object] id=stable_object_id duration=forever ↓ test advancement and save/load ↓ later story removal, if needed: [remove_object] object_id=stable_object_id
DecisionUse
One existing hero gains one attack or abilityPermanent object
The item may be taken by several eligible unitsMap pickup macro
The bearer becomes a fundamentally new advancement identityCustom unit type
The item is only a local objective gateTemporary scalar variable

Recipe 6: add an achievement safely

  1. Define a stable achievement_group and ID in root achievements.cfg.
  2. Use a full path for its icon because normal binary paths are unavailable there.
  3. Attach [set_achievement] to an existing unambiguous victory or boss event.
  4. Test repeated loads and replays; completion actions should be harmless when already complete.
  5. Never make required campaign progression depend on local achievement state.

Recipe 7: choose between WML events and Lua AI

NeedPreferred layerCampaign precedent
Guaranteed reinforcement timingWML event directorScenarios 03, 14, 19, 22
Faction posture at known map locationsAI goals and WML AI helpersScenarios 08 and 12
Change objective when a unit appearsWML variables and objective filtersScenario 17d
Evaluate every possible combat and reject risky attacksLua candidate actionScenario 15
Escalation rule. Begin with declarative AI and scenario events. Cross into Lua only when the decision requires computation the WML AI configuration cannot express cleanly.

Recipe 8: add or replace campaign-local art

  • Place binary assets under the campaign’s images/ or sounds/ tree.
  • Use campaign-relative paths after the binary path is active.
  • Use full data paths in metadata and achievement definitions, where the normal binary-path context may not exist.
  • Update ART_LICENSE.txt when a file needs specific attribution or license clarification.
  • Update the image manifest and run the consistency report.

Pre-merge extension checklist

AreaQuestion
IDsAre scenario, unit, object, achievement, and event IDs stable and unique?
StateWhere is every new variable initialized, consumed, and cleared?
BranchesDo all exits converge with equivalent required story state?
DifficultyDoes every preprocessor branch validate?
AssetsDo paths work from a clean cache and from campaign metadata contexts?
StorageAre XP, traits, variations, overlays, and object modifications preserved?
SavesWhat happens to a save made immediately before the changed transition?
DocsAre the scenario chapter, flow, state atlas, manifest, and search index updated?