Modding encounter choice

From Wildermyth Wiki

This page walks through the process of creating an encounter with a single choice, and then adding a party selector and rewards. The focus is on getting something simple which you can see in the game, and adding more details later. The description and screenshots are current as of November 2019, early access version 0.10+98 Ryvio Wartmarch.

Prerequisite encounter

  1. This is a brief summary of the prerequisite steps. If you have an example event already skip to the next section. For more details see Adding a wilderness encounter
  2. Select "Tools" at the main game screen, then "Open Editor", then "Content and Comics Editor"
  3. At the upper left, click "Mods", click "Create New Mod" in the browser, and fill in the form.
  4. At the upper left, click "effects", then "New", and fill in the form. In the "Type" dropdown, select "Arrive at Hostile Site". The name field will fill in with auto-generated text.
  5. On the targets line, add the default "hero" story role and a second story role "volunteer"
  6. This is the most common mistake, causing a mod to not work! New events are disabled by default. Under abilities, set encounterEnabled to true

Adding the choice in the effect

  1. Expand the choiceTarget line (click the plus sign to its left), hover over the options line, and click the "new target" button. In the "New Choice" dialog, you will see Choice Tag one, Outcome type simple. Leave these choices for now and just click "create".
  2. Create a second new choice, which will be filled in with Choice Tag two. Additional elements in the outcomes list are automatically added. The effect panel should look similar to this. Notice the two options are called one and two, and each one has a "then description" in the outcome section.
ModdingChoiceEffect.PNG

Filling in the comic panels

  1. The rest of the work is done in the comics panel. Select comics in the dropdown at the top left, and open your comic.
  2. Setting up the encounter has created a number of panels for us:
    • Prompt, which displays when the encounter begins. You can add panels under this, before the choice.
    • Choose, the "left choice"
    • Choose, the "right choice"
    • Outcome 1 >> Chose 1. You can add panels under this, which will appear after the player selects the first choice.
    • Outcome 2 >> Chose 2. You can add panels here, for the second choice.
  1. We'll fill in just a little, so that it will make sense when we see it in the game.
  2. In the prompt panel, add the hero and the volunteer, and a question, "The path branches left and right". "Which way should we go?"
  3. In the left choice, add the hero and the answer, "Left". In the right choice comic, add the hero and the answer "Right".
  4. In outcome 1, "Thank goodness we went right". In outcome 2, "Thank goodness we went left".

Seeing the effect in game

  1. If you haven't already done so, enable developer mode. (Save and exit before doing this.) In file explorer, create an empty file under steam\steamapps\common\Wildermyth called devmode.txt.
  2. Start a new one chapter story. Choose your mod in the mod picklist, enable "pick events" so that you can choose your event to trigger, and enable "overland only" to skip all the fights.
  3. When the game starts, you will get the first "pick event" dialog to choose which introductory story to use. Pick random and just click through it. Then choose any nearby territory and move your party to scout it. Most often, when scouting finishes, you will have an "assault" choice. In case you happened to pick a territory with only a station, choose another territory and move to it.
  4. Save the game. Now as you work to refine the choice, you can immediately come back to the point where the mod is about to trigger.
  5. When you click the assault button, you should immediately be able to pick your event.

Adding party selectors

Let's keep going. We will make this encounter one which tries to start up a romance. For the hero role, we will choose any character who does not already have a romance. Then for the volunteer, we will choose a character whose male/female preferences allow for a match. In case the party does not match the criteria, this will cause the event to be unpickable.

  1. In the encounter, open the hero section, and make sure the template value is PICK_BY_SCORE.
  2. Open the section "How many, and how to choose them". Click on scoreFunction and enter: 1-HAS_LOVER. Click on scoreThreshold and enter 1.
  3. Documentation for the functions available in the scoreFunction is currently limited. It is helpful to scan for ideas by looking at the values that show up as suggestions. Once you find an interesting looking function name, search for it in the existing game files to see more of the context.
  4. The HAS_LOVER function returns 0 if the character has a lover, that is, any character in their relationship tab who has a "love" type with a nonzero value. Since scoreThreshold is a "greater than or equal" comparison, giving a scoreFunction of 1-HAS_LOVER and a threshold of 1 means that characters who have a lover are excluded.
  5. In the volunteer "How many" section, enter the scoreFunction "CAN_ROMANCE.hero" and scoreThreshold 1. This is even more obscure, and arguably this syntax is backwards from what you might expect. CAN_ROMANCE is apparently a predefined function which we cannot examine, but it will ensure that both characters are interested (that is, man attracted to woman and vice versa, or one of the other combinations.) It also apparently has a maximum age difference so that very old characters will not be intersted in very young ones.
  6. You can test in-game; it is possible, but unlikely that the event will show up as failed to trigger. For example, it will certainly not trigger on a party of three hetero males. For certain other combinations, the event may or may not trigger, depending on which character is selected. In a group of three males where two are attracted to men, choosing the hetero male first will result in no valid combination, while choosing one of the others will result in a valid combination.
  7. Here is the way the encounter should look now:
ModdingChoiceSelector.PNG

Adding outcomes

Finally, let us add some results for this encounter. So far we have used a "description" outcome which has no effect. For the "one" branch of our encounter, let us change the relationship.

  1. Under outcomes, under "Chose << one >>", there is a button "Add Outcome...". Click this and select RelationshipPoints. This fills in the right side of the "New Outcome" dialog:
    ModdingChoiceOutcome.PNG
  2. Click on party, and change the value to hero.
  3. Hover over "who", add another entry, and change its value to volunteer. This ensures both characters will get the same update.
  4. Change the amount to 2 (or 1 if you prefer a more gradual growth). Change forceChangeRelationship to "lover".
  5. Save the encounter and test. Now when you reach the end of the encounter, you should get an additional dialog indicating the two characters have fallen in love. Success!

For other encounters, you may wish to have other outcomes. Choose different values in the "Add outcome" picklist. To trigger the upgrade gear dialog with a new item, choose UpgradeGear. To add a theme, such as fire, leaf, or crow, choose ApplyTheme.