Recipe 1: insert a linear tactical scenario
- Create
scenarios/NN_New_Scenario.cfgwith a uniqueid. - Point the previous scenario’s
next_scenarioat the new ID. - Point the new scenario at the original destination.
- Add a map only when existing geography cannot carry the story.
- Use
TROW_DEATHSunless the chapter intentionally changes protected-character behavior. - Add journey-map support in
bigmap.cfg. - 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=noonly 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 edit | Why |
|---|---|
| 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
| Decision | Use |
|---|---|
| One existing hero gains one attack or ability | Permanent object |
| The item may be taken by several eligible units | Map pickup macro |
| The bearer becomes a fundamentally new advancement identity | Custom unit type |
| The item is only a local objective gate | Temporary scalar variable |
Recipe 6: add an achievement safely
- Define a stable
achievement_groupand ID in rootachievements.cfg. - Use a full path for its icon because normal binary paths are unavailable there.
- Attach
[set_achievement]to an existing unambiguous victory or boss event. - Test repeated loads and replays; completion actions should be harmless when already complete.
- Never make required campaign progression depend on local achievement state.
Recipe 7: choose between WML events and Lua AI
| Need | Preferred layer | Campaign precedent |
|---|---|---|
| Guaranteed reinforcement timing | WML event director | Scenarios 03, 14, 19, 22 |
| Faction posture at known map locations | AI goals and WML AI helpers | Scenarios 08 and 12 |
| Change objective when a unit appears | WML variables and objective filters | Scenario 17d |
| Evaluate every possible combat and reject risky attacks | Lua candidate action | Scenario 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/orsounds/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.txtwhen a file needs specific attribution or license clarification. - Update the image manifest and run the consistency report.
Pre-merge extension checklist
| Area | Question |
|---|---|
| IDs | Are scenario, unit, object, achievement, and event IDs stable and unique? |
| State | Where is every new variable initialized, consumed, and cleared? |
| Branches | Do all exits converge with equivalent required story state? |
| Difficulty | Does every preprocessor branch validate? |
| Assets | Do paths work from a clean cache and from campaign metadata contexts? |
| Storage | Are XP, traits, variations, overlays, and object modifications preserved? |
| Saves | What happens to a save made immediately before the changed transition? |
| Docs | Are the scenario chapter, flow, state atlas, manifest, and search index updated? |