How to: Add an Event to Wildermyth
How to: Add an Event to Wildermyth
Wildermyth is a mythmaking tactical RPG currently in Early Access. Our philosophy is to put as much storytelling power into your hands as possible, and part of that is exposing our tools so that you can craft your own stories inside the game.

The tools I'm going to show you today are under active development, but they work right now and they're only getting better. Some of this stuff is documented on the wiki, and some needs to be. If you decide to give this a shot, find me on Discord. We have a tools-and-modding channel just for this, and I'll be thrilled to answer your questions and help however I can.
You'll Need:
* Wildermyth
* An idea for an event
Step 1. Make a mod to hold your event(s)
Wildermyth supports mods via steam workshop or direct download. Mods are stored in their own folders, and the folder structure mirrors the structure of the main game. Here are the steps to create your own mod.
From the main menu, select Tools,

then Open Editor

And open up the Comic Editor.

Use the Mods button in the upper left

to open the Mods dialog.

Press 'Create New Mod' and fill in the details. Mod Id is mostly for your use, when you upload it to Steam Workshop it will get a number. You also don't have to worry about load order. It's there in case mod authors ever need to use it to make sure mods load in a particular order - you can leave it as is.

Press CREATE! This creates a new mod folder at [install]/mods/user/[yourModId]. And it should open this folder in your OS file viewer so can see where it is. All of your mod files need to be placed here, which should happen automatically if you tell the editor to place them in your mod. Go back in to the mods dialog and make sure your mod is selected:

Step 2. Plan your event.
Before you start working in the editor, it really helps to have a plan, including a rough script and an outline of your choices and outcomes.
For this article, I want to make a little story called "A Novel Decision." It will center on Bookish and Friend talking about what they're reading, with a side-gag for Volunteer who is lighting the fire for the night. There will be a relationship choice where Bookish and Friend can choose romance, rivalry, or to simply stay friends.
Cast of characters
1. Bookish - bookish is at least 80, no lover.
2. Friend - friend of bookish, no lover, similar age (within 15 years),
3. Volunteer - prefer fire theme, fire chicken, tree theme, vine theme, or wolf theme, then snark.
4. Npc - a famous highbrow author
5. Npc2 - a popular novelist
Prompt:
Bookish, nose in a book, volunteer in the background, sun setting.
Volunteer makes the fire, says something relating to theme/pet if any.
Friend shows up also holding a book.
Bookish: Oh, what, are you reading?
Friend: Oh, it's that new book by ! I really love it, it's about a young [sameGender] that finds out they're really a [prince/princess] and has to choose between their family and their new kingdom. Also, there are dragons. What are you reading?
Bookish: Oh, this, well, this is by , it's a history of . Well sort of history mixed with speculation and theorizing. But I thought it might be useful.
Awkward Turtle - Um. Oh. (Friend feels embarassed at not being serious enough, wanted to impress Bookish but clearly failed.) (personality dependent?)
Volunteer: (skeptical) ? Really? Bookish, what do you think about ? (personality/theme dependent?)
Choice 1:
Bookish: Oh I love ! I didn't realize this was out, can I borrow it when your done? (Romance)
Choice 2:
Bookish: I've heard those are pretty good, I've been meaning to give them a go one of these days (Stay friends)
Choice 3:
Bookish: Please don't read that garbage. I'll lend you a real book. (Rivalry)
Outcome 1:
bookish puts down book
both gush over npc2
allusion to romance in previous novel of npc2 (class/personality variation)
lovey eyes
volunteer disgusted
Outcome 2:
Friend: yeah, I'd be happy to lend it to you when I'm done with it.
Bookish: thanks! (keeps reading)
Friend: (reading)
Volunteer: Anyone hungry? Food's ready.
Outcome 3:
Friend: I thought you'd be happy to see me reading
Bookish: not reading trash. We should be preparing for battle
Friend: Oh I'm prepared for battle all right! (weapons out)
Volunteer: Hey guys dinner's ready. Also keep it down.
Step 3. Create your event
Go to the Effects tab (Control+2) and Press the New... button in the upper left.

This will show the New Event Dialog. Fill in the name of the event you want to create. We're creating an "Arrive at Hostile Site" event, which should already be selected. Make sure to select your mod, instead of Core. If you don't see it listed, check to see that it's being loaded in the mods dialog, (and you might have to restart the tool to make sure it loads?) Fill in the name and the author field.

Press 'create' to create the Event! Now go to the comics view (Control+1) and save your work (Control+S).
Step 4. Create Targets
Now we're going to add targets (story roles) for our cast of characters. We need 3 heroes from the present party. First we'll select Bookish. Press the New Story Role button.

This brings up the New Story Role dialog. We'll select the role "bookish" which auto-selects the bookish stat.

We'll multiply their bookish score by (1-HAS_LOVER), and set a threshold of 80. HAS_LOVER is a special lookup that evaluates to 1 if the hero has a lover, and 0 if they don't. So this score overall targets a hero with a bookish score of at least 80 and no lover.

Go ahead and click create. You can see the new story role is inserted right after foes and before choiceTarget. (ChoiceTarget is where the user will make a choice, and it includes the prompt for the choice. It must be last, because otherwise the prompt would not be able to use the other targets in comic panels. So, the tool inserts new story roles at the end, right before the choice target.)

Next we'll create Friend. Click New Story Role again. Select the friend role. Select Relationship: "is friend" with "bookish", and check "require relationship."

We'll also make sure that friend doesn't already have a lover, like so:

Finally, we'll create volunteer. I want to do a gag where Volunteer talks about lighting the fire differently depending on their theme, so we'll build a score function to prefer (but not require) someone with one of a few themes. Start out by clicking New Story Role, select the volunteer role and the SNARK stat.

Press create. Now click on the "volunteer" button that was inserted on the left.

This will show the details of the volunteer target. We're going to modify the scoreFunction. (It might be hard to click on, you can expand the edit panel, or check the box to put it on the left if your screen is small.) Click on the value of the scoreFunction (it should say SNARK right now).

I'll enter this score function: SNARK+100*(theme_wolf+theme_tree+theme_vine+theme_fire+theme_petFireChicken) We should get validation that these are all known aspects and the expression is valid:

I'll leave the score function at 0, but if we wanted to guarantee a theme we could set it to 100. But I think the event works fine without a theme so I won't require it. Cool, that's the heroes taken care of!
Step 5. Create NPCs
We also need to create 2 authors, one highbrow, and one popular. For this, we can press the New NPC button. (If the panel editor is obscuring the left-column, press Esc or click close.)

Since these NPCs won't ever show up in panels, and we just need their names, we can use the default setup. Make another one, so we have npc and npc2.
Aside: Though, if you wanted to remember these npcs for a later followup, it might be fun to give them an npcId. If an npcId is specified, the game will first search for an existing npc, and if not found, will create one and give it the id. So it would be possible, for example, to create several events that reference the popular novelist npc2, and as long as they all use the same npcId (e.g. npc_popularNovelist) they will all be consistent. Which is a great way to create persistent characters, running gags, etc. without having to hard-code names.
You should now have two npcs listed under Generated Targets, like so:

Generated Targets means that these will be generated on the fly when the event is fired. Unlike regular targets, they don't have to exist ahead of time. Nice!
Step 6. Create Choices
Now we'll move on to the structure of the event itself. We'll have three choices which lead to a single outcome each. Let's create them. Press the New Choice button.

Put bookish on point for these choices.

This will place them in the panel. Click Create. Do this 2 more times and you should see all the comic panels laid out like so:

Step 7. Make the Panels!
Alright, this is the fun part you guys! Let's make it happen!
I went ahead and recorded this part because there's a ton of little clicks and I think it's easier to just watch someone do it, and I don't want to make a million little screenshots. Part one shows the prompt, including panel splits.
[previewyoutube]Part 1 - prompt[/previewyoutube]
Part two includes the choices and outcomes, including some personality splits and other fun.
[previewyoutube][/previewyoutube]
But basically, use the Add Panel button to add panels, use the Compose (cmp) button to make big panel changes. Lots of things can be edited visually in the panel itself, and everything can be edited in the panel editor.
So now we have a prompt, choices, and outcomes all laid out like this:






Remember to save!
Step 8. Make it do stuff
Let's go back to the Effects view (Control+2) to define what happens when you make these choices. Scroll down in the middle pand and you'll see the outcomes section with three outcomes laid out like this.

Under outcome 1, we'll press the "Add Outcome..." Button to bring up the New Outcome Dialog. Click on the "RelationshipPoints" outcome in the left panel. In the right panel, select bookish and friend for "who", and set forceChangeRelationshipTo to "lover"

Press create and you'll see the relationship outcome right below the Description for outcome 1.

From here we can just copy it and paste it into the other two outcomes. And, in fact we could have found another similar and copied the outcome from there, that's a totally legitimate approach. Press the Copy button on the RelationshipPoints outcome, then press the Add Outcome button under the second outcome. The copied value should be in the middle column, and you can click it.

Create the final relationship outcome under the third choice, and set it to rivals.

We also need to add a fight outcome, since this is an arriveAtSite event! Scroll back up a bit to the "outcomes" row, and click the New Entry btton.

Select the "Mission" outcome. This will create a fight. Click

You'll see a warning in yellow at the bottom that the mission must define a goal, so let's do that. Scroll to the bottom, expand our mission object, and set the goal to liberate.
Step 9. Enable the event
In order for the event to show up in-game, it must be enabled. Scroll to the top and open up the Ability object and set encounterEnabled -> true.

Save your work!
Now, as long as this mod is loaded, the game will try to use this event in the Arrive At Hostile Site rotation.
Step 10. Test it using cheats
Create a (blank) file in your install folder called devMode.txt. This will enable cheats, which will make it much easier to test your event.

Start a new game. A three or five chapter generic story is easiest. In the Campaign Options step, choose Pick Mods and make sure your mod is selected.

And make sure cheats are enabled and the Pick Events is enabled:

For your starting party, make sure you have a bookish character. You can use the personality adjustments to get it right. Start the game. You'll see the pick events dialog come up whenever there's a potentially random event.

You can press the "random" button to let the game pick an event for you. Make sure to leave your bookish hero and a friend without a romance, so you'll have the right heroes to see the event.
Fight or cheat through the first mission, then scout a tile. After you reveal an enemy site, pro tip, save the game. Then click the assault banner and take a look. If all went well, your event should be in the "possible" list.

If you don't see it at the top, scroll down and check to see if it's in the "FAILED" section. If it is, there might be something wrong with the targeting, or your current party simply isn't eligible (need a bookish > 80 with no romances but 1 friend, who also has no romances.) If the event is not in the list AT ALL, then it's most likely you forgot to enable it (see step 9.)
Go ahead and click your event and it should work!

Step 11. Upload your mod
You can use the Steam Workshop lab to upload your mod.

Or share it via nexus or whatever your prefer. (I think I'll probably just go ahead and add this event to the main game, maybe after a bit more tweaking.) Happy storytelling!
