Modding quest chains

From Wildermyth Wiki
Jump to navigation Jump to search

This page walks through the process of creating multiple encounters which occur in a chain. That is, one encounter occurs, and only after that a second encounter may occur based on the results of the first one, and then a third, fourth, etc encounters will occur in turn. This type of "quest chain" is less complex than a full campaign, The focus is on getting something simple which you can see in the game, and adding more details later. This guide assumes you have completed some of the earlier guides and does not define all the clicks for each step. The description and screenshots are current as of February 2020, early access version 0.15+114 Lylcon Stormpuck.

Note: setting up quest chains using this method can be complex and a little painful to debug. The dev team has said that the "campaign plot" mechanism may be easier to use, even though these are not full campaigns. However, there is no document or example of using this today, so this guide will not use that method.

(davea says: this topic is kind of important but I can see my description is not so clear. If you are getting stuck on this, please ping me on discord and I'll try again on this guide.)


The reference page Event Types describes different types of events. It is not obvious, but not all events can perform all types of actions. For example, you cannot (successfully) create an NPC in an overland activity, and you cannot add an aspect to an overland site during a mission victory. The following diagram illustrates the restrictions. The colors approximately represent many restrictions the event type has; green has the fewest restrictions, then yellow, then orange.


  • Most quest chains will be triggered by an assault (EHAHS: ENCOUNTER_HEROES_ARRIVE_HOSTILE_SITE) or a wilderness encounter (EWS : ENCOUNTER_WILDERNESS_SCOUTING). These are the most "powerful" encounter types; they can do anything including (a) generating named NPCs, (b) adding aspects to overland sites, (c) presenting a choice.
  • Most quest chains will use a "job" (OA : OVERLAND_ABILITY) to direct the player to send a party to some spot on the map. This encounter type cannot (a) generate named NPCs or (c) present a choice. Named NPCs must be generated in a previous EHAHS or EWS. If a choice is needed, it must be done via a BRANCH.
  • Most quest chains will have some progression of these main types, EWS/EHAHS and OA, shown along the top of the above diagram. This is only an example; each step can be any one of EHAHS, OA, EWS. Within each step, there may be additional events, shown in the collection below each main type. These secondary types also have restrictions.
  • A victory encounter (EMV : ENCOUNTER_MISSION_VICTORY) may be attached to an EHAHS by victoryEncounterId, or it may occur standalone. In either case, it cannot (a) generate named NPCS or (b) add aspects to overland sites. These should be done in advance. It can call a BRANCH, but the branch still cannot create NPCs or add aspects.
  • A mid-mission event (PME : PLOT_MISSION_EVENT) may be attached to an EHAHS. In order to use a PME, the EHAHS must be a scripted mission (with a site and plot) as well. See the separate topic Modding_scripted_missions for details on this. As with EMV, it cannot (a) generate named NPCS or (b) add aspects to overland sites.
  • A BRANCH may be attached to most event types. Normally a branch is used after a choice within its caller, but it also allows (a) generating named NPCs from an OA, whereas the OA cannot itself generate a named NPC.

Here is the reasoning for the above restrictions.

  • EHAHS and EWS occur in the main game loop at the top level, so they can do everything.
  • OA occur at the top level, but they are initiated by a player action (clicking on the banner) rather than within the main game loop. That means they do not execute the "implications" section and cannot generate named NPCs. (This author does not completely understand that description, but it was provided by the dev team.)
  • EMV and PME occur at a lower level, only in the context of the EHAHS which generated them. To reduce the amount of data stored, many actions done during EMV and PME are thrown away, rather than being copied back to the main data store. So, you can create named NPCs and overland aspects during these events, but the results are not copied back, so future actions which depend on those will fail.


Let's take a simple example to show these restrictions in action. Suppose we want the following sequence. (1) An assault (EHAHS), followed by (2) a victory (EMV), which puts up a job banner (3); at the job, (4) a named NPC is introduced, and later a wilderness scouting (EWS) finishes the chain. You may think that it is easiest to create each object just before it is used; for example, you may think you could create the OA (3) during the victory (2), and create the NPC (4) during the OA (3). However, none of that will work; each step will silently fail because it violates the rules given in the previous section. Here is a solution which will work.

During EHAHS (1), create the job banner. You cannot create it during the EMV (2); it will silently fail.

To create the NPC, either create it during EHAHS (1) or by introducing a BRANCH within the OA (3); you cannot create it either during the EMV (2) or the OA (3); it will silently fail.