Difference between revisions of "Modding site activities"

From Wildermyth Wiki
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page walks through the process of creating an encounter which appears at a site, such as a treasure map or a request for help..  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 January 2020, early access version 0.12+104 Pixle Masterson.
This page walks through the process of creating an encounter which appears at a site, such as a treasure map or a request for help.  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 January 2020, early access version 0.12+104 Pixle Masterson.


(this page under construction by davea 5-jan-2020)


==Preparation==
# A typical encounter has between 1-3 PCs.  You will need to think of the criteria for selecting the PCs; it helps to browse the existing events to get some ideas of this.  To start with, you can randomly select party members.
# A typical encounter has 3-10 steps, which you can think of as rows of the comic.  Each panel will have 1-2 lines of dialog, which can be chosen depending on the characters' personality.  You should write out at least one line for each panel before you start.  Later, you can add personality variants
# Most encounters have a choice, or there isn't really any point.  Decide what choice you will force the player to make.  If there are three choices, you will need a set of rows for each choice.  Write at least one line for each choice, and write the dialog for the rows following each choice.
# Every row of the comic must be designed.  The comic tool has drag and drop aspects, but you are still in charge of the detailed visual design of each row.  It can help to sketch out how you want each row to look, so that you will spend less time moving and re-moving items in the editor.


==Getting started==
==Seeing the effect in game==
# Select "Tools" at the main game screen, then "Open Editor", then "Content and Comics Editor"
This guide is set up in the opposite order to previous guides in this section.  It will be easier to understand what the mod does, after you see what it looks like.
# At the upper left, click "Mods", click "Create New Mod" in the browser, and fill in the form.  This will pop up a file browser showing the files the tool just created; you can close this for now.
<ol>
# At the upper left, click "effects", then "New", and fill in the form.  In the "Type" dropdown, select "Wilderness Scouting"The name field will fill in with auto-generated textIn this example, the full name is [davea_enc_01]davea_enc_o1_cropsOfStone
<li>Download and install the mod, "Oh No A Dragon" from steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1925402595
<li>In developer mode, start a new game, select "one chapter", enable this mod.  Enable the pick events cheat and objectives cheat.  For this testing I usually also select "Skip progression" and "skip gear" to reduce the number of clicks needed to get to the interesting part.
<li>Use objectives cheat to finish the initial battle.
<li>Scout the nearest adjacent overland tile.  If it is a wilderness scouting event, pick one and go through it, then scout another tile so that you have an assault event (red sword icon).
<li>Perform the assault, and choose the event "Treasure map", which should be first or second on the list.  If you don't see this event, check that you installed and enabled the mod.
<li>The comic panel has a dialog line which names the nearby tile, where the treasure map leads.  You don't need to note it down, but observe that it is there.  Finish the encounter.
<li>On the overland map, you should now see a purple flag, in the overland tile which was named by the comic panel.  This tile is "usually" a scouted tile but not necessarily.
<li>If you click on the site icon (the hut in this case), rather than the overland tile background, you will also see a purple treasure map button, as shown here.
[[File:ModdingMapOverland.PNG]]
<li>Click the button or the flag, to get the popup where you assign participants to the job, as shown here.
[[File:ModdingMapParticipants.PNG]]
<li>The progress bar on the flag should move quickly, and then the dialog "Treasure Map" should appear.
<li>Click through this encounter.
</ol>
The key points of this are: a starting encounter which puts up the flag; the flag, button and dialog for the job; and the encounter itself.
 
==The starting encounter==
This section describes the key parts of the starting encounter, which puts up the flag. Using the in-game editor, open the comic davea_map_start.  This is simple, but you can see the comic dialog reference to <otherSite.name>.  Now open the effect.  For a reason this author doesn't understand, this method currently only works for arriving at a hostile site, and does not work for either mission victory or wilderness scouting.
 
The first key part is the targets section, shown below.  Target #3 defines the current site, which is generic.  Target #6 controls the party members for the encounter, as described in earlier guides; you must have one named role in order for site selection to work, but you will presumably have several anyway.  There are two magic parts: target #7, otherSite; and outcome #2, Aspects(otherSite).  The magic happens because this target picks nearby site by some rules, and attaching the aspect causes the flag+button to appear on the site.
 
[[File:ModdingMapTargets.PNG]]
 
This shows the detail of the target (screenshot edited to remove uninteresting fields). We are picking one random site called otherSite, which must be of type SITE and must not be the current site.  The canPath section uses one of your roles (target #6) to make sure that there is a path from this role to this site; this prevents selecting a site which is inaccessible due to impassible mountains or rivers.  '''Make sure the role in canPath matches one of the roles in your target''', otherwise this will silently fail.
 
[[File:ModdingMapSite.png]]
 
==Adding the aspect==
The aspect is attached by the starting encounter to the otherSite.  When the game attaches the aspect, it performs the effect listed in the aspect.  In this case, that starts the "job" or treasure map encounter, which makes the flag and button appear.  Make sure that the aspect name given in the encounter matches the name of the aspect, and make sure that the effect name given in the aspect matches the name of the encounterIf either of these pairs contain a typo or wrong name, the job will silently fail to trigger.
 
[[File:ModdingMapAspect.PNG]]
 
==Adding the second encounter==
Using the in-game editor, view the second encounter, davea_map_jobUnfortunately, this author considers most of this file to be "magic words" which work if used properly, but it is not clear which ones are required, or why.  Because the encounter has so many fields, it is easier to show the json code.  See [[Modding_Guide#Where_to_find_installed_mods|Where to find installed mods]] to locate the file davea_map_job.json on your disk.  These two targets appear to rely on hard coded names which are not explained anywhere this author can find.  The promptText appears in the dialog where you select the party.


==Filling out the encounter==
<syntaxhighlight lang="json">
# Add one story role for each PC in the dialog you wrote.  In this example, we will have "hero", "volunteer2" and "volunteer3".
"targets": [
# Hover the mouse over "targets" and a row of buttons will appear.  Click "New Story Role" and the New Story Role dialog will appear.  For the first one, just click the "Create" button at the bottom right.  This will add line 5, "hero".
{
# Add two more story roles using "New Story Role".  For the second one, in the "role" dropdown, select volunteer2, and create.  For the third one, select volunteer3.
"template": "SELF_SITE_THIS_JOB_NOT_ACTIVE",
# At the bottom, you will see text, "Error: target <N> (choiceTarget) defines no choices".  For now, delete the choiceTarget row by hovering over the choiceTarget line and choosing "X" to delete it.
"aspects": [ "THIS_JOB_NOT_ACTIVE", "SELF" ]
# Hover over the outcomes line and click New Entry, then on the right side, click New Entry and select Description (the first entry) in the dropdown.  This links the comic we will create, to this encounter.
},
# '''This is the most common mistake, causing a mod to not work!  New events are disabled by default'''.  This is so that works in progress don't get accidentally selected.  To enable the event, click the plus sign next to  the ability section near the middle to open it; and under that, find the encounterEnabled line which reads "false".  Click the value to change it, and check the checkbox.  (The graphics make this a little hard to read.)  Then it should read "encounterEnabled: true"
{
# Now is a good time to save, using the button at the top of the window.
"template": "JOB_PARTICIPANT",
# The target section of your encounter window should now look like this:
"promptText": "Who will search for the X on the map?",
[[File:ModdingEncounterEffect.PNG]]
"slots": { "preFill": "noJobOrParty" }
}
],
</syntaxhighlight>


==Starting the first comic panel==
A few other details of the job are specified in the encounter, which are easier to explain.  In the below screenshot of the job, the blurb is what appears in the overlap map tooltip when you hover over the flag.  The longName is used for the text of the button.  The icon ("magic") is used to select the icon that appears in the flag and the buttonAs of this writing, it is not possible for modders to add icons; but you can find existing icons and use one of themThe category ("research") is used to select the color of the flag and button.  Research is purple, crafting is blue, and site is orangeI don't think modders can control the colors either but probably it is better to use these standard colors.
# At the top of the screen, select "comics" to open the comic editorIf it is not already selected, select the name of your encounter.
# Designing each panel requires quite a number of steps.  We will go through creating one panel and then test it in-game.
# We will have one NPC with dialogAt the upper left, click the button "New NPC"Your screen should look like this; in particular note the targets section includes hero, volunteer2 and volunteer3, and the generated targets section includes npcIf you do not see those, please review the earlier steps.
[[File:EncounterFirstComic.PNG]]


==Finishing the first comic panel==
[[File:ModdingMapAbility.PNG]]
# We want a full width panel containing the hero character, the npc, and one line of dialog for each.  If you find the right side panel becomes blank, click on the "Outcome 1" box on the left so it turns bright blue.  This causes the right side to refresh.
# On the right side, under "panel", click on "bg", and scroll through the choices of all the backgrounds to find comicBG_hillsYellow
# On the right side, click on "size" and select "full"
# On the right side, near the middle under actorSlots, click "add actor".  This adds the hero, which was the currently selected value in the dropdown, onto the panel.
# The hero drawing has a bunch of small icons that allow you to move and resize the drawing.  Resize so the hero is near the middle of the screen, facing right, vertically filling the panel.  (You can also edit values such as scale and position by clicking on the text on the right side.  For example, it may be easier to change facing by clicking facing on the right and selecting from the dropdown)
# Under actorSlots, select "npc" in the dropdown, add the npc facing left at the right side of the panel.  Select "nameTag" and choose "bottom right" to position their nametag.
# Once the actors are positioned, click the small green "dialog balloon" icon on each actor to add some simple text,  For the npc, write "Hail travelers! Will you help our village?".  For the hero, write "Of course we will help".
# Your screen should now look pretty close to this:
[[File:ModdingEncounterFirstComicDone.PNG]]


==Seeing the effect in game==
==Putting it together==
<ol><li>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.
The best way to create your own encounter like this is to copy the two files for the encounter out of this mod and into your own.  Then edit them, either using a text editor on the json, or with the in-game editorDon't forget to create the aspect, and make sure all the names are matching. Then follow the instructions at the start of this guide to see your encounter in game.
<li>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.
[[File:ModdingEncounterNewStoryDebug.PNG]]
<li>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.  In order for a wilderness encounter to trigger, the territory must be empty; if you get an infestation result and the ambush icon appears, choose another territory and move to itThere doesn't appear to be any faster way to trigger an event.
<li>Once you complete a scouting event with no infestation, the "pick event" dialog will appear, showing your new event! In this case I have named it "Crops of Stone":
[[File:ModdingEncounterPickMe.PNG]]
</ol>


[[Category:Modding]]
[[Category:Modding]]
[[Category:Modding Guides]]
[[Category:Modding Guides]]

Latest revision as of 08:56, 11 January 2020

This page walks through the process of creating an encounter which appears at a site, such as a treasure map or a request for help. 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 January 2020, early access version 0.12+104 Pixle Masterson.


Seeing the effect in game

This guide is set up in the opposite order to previous guides in this section. It will be easier to understand what the mod does, after you see what it looks like.

  1. Download and install the mod, "Oh No A Dragon" from steam: https://steamcommunity.com/sharedfiles/filedetails/?id=1925402595
  2. In developer mode, start a new game, select "one chapter", enable this mod. Enable the pick events cheat and objectives cheat. For this testing I usually also select "Skip progression" and "skip gear" to reduce the number of clicks needed to get to the interesting part.
  3. Use objectives cheat to finish the initial battle.
  4. Scout the nearest adjacent overland tile. If it is a wilderness scouting event, pick one and go through it, then scout another tile so that you have an assault event (red sword icon).
  5. Perform the assault, and choose the event "Treasure map", which should be first or second on the list. If you don't see this event, check that you installed and enabled the mod.
  6. The comic panel has a dialog line which names the nearby tile, where the treasure map leads. You don't need to note it down, but observe that it is there. Finish the encounter.
  7. On the overland map, you should now see a purple flag, in the overland tile which was named by the comic panel. This tile is "usually" a scouted tile but not necessarily.
  8. If you click on the site icon (the hut in this case), rather than the overland tile background, you will also see a purple treasure map button, as shown here. ModdingMapOverland.PNG
  9. Click the button or the flag, to get the popup where you assign participants to the job, as shown here. ModdingMapParticipants.PNG
  10. The progress bar on the flag should move quickly, and then the dialog "Treasure Map" should appear.
  11. Click through this encounter.

The key points of this are: a starting encounter which puts up the flag; the flag, button and dialog for the job; and the encounter itself.

The starting encounter

This section describes the key parts of the starting encounter, which puts up the flag. Using the in-game editor, open the comic davea_map_start. This is simple, but you can see the comic dialog reference to <otherSite.name>. Now open the effect. For a reason this author doesn't understand, this method currently only works for arriving at a hostile site, and does not work for either mission victory or wilderness scouting.

The first key part is the targets section, shown below. Target #3 defines the current site, which is generic. Target #6 controls the party members for the encounter, as described in earlier guides; you must have one named role in order for site selection to work, but you will presumably have several anyway. There are two magic parts: target #7, otherSite; and outcome #2, Aspects(otherSite). The magic happens because this target picks nearby site by some rules, and attaching the aspect causes the flag+button to appear on the site.

ModdingMapTargets.PNG

This shows the detail of the target (screenshot edited to remove uninteresting fields). We are picking one random site called otherSite, which must be of type SITE and must not be the current site. The canPath section uses one of your roles (target #6) to make sure that there is a path from this role to this site; this prevents selecting a site which is inaccessible due to impassible mountains or rivers. Make sure the role in canPath matches one of the roles in your target, otherwise this will silently fail.

ModdingMapSite.png

Adding the aspect

The aspect is attached by the starting encounter to the otherSite. When the game attaches the aspect, it performs the effect listed in the aspect. In this case, that starts the "job" or treasure map encounter, which makes the flag and button appear. Make sure that the aspect name given in the encounter matches the name of the aspect, and make sure that the effect name given in the aspect matches the name of the encounter. If either of these pairs contain a typo or wrong name, the job will silently fail to trigger.

ModdingMapAspect.PNG

Adding the second encounter

Using the in-game editor, view the second encounter, davea_map_job. Unfortunately, this author considers most of this file to be "magic words" which work if used properly, but it is not clear which ones are required, or why. Because the encounter has so many fields, it is easier to show the json code. See Where to find installed mods to locate the file davea_map_job.json on your disk. These two targets appear to rely on hard coded names which are not explained anywhere this author can find. The promptText appears in the dialog where you select the party.

"targets": [
	{
		"template": "SELF_SITE_THIS_JOB_NOT_ACTIVE",
		"aspects": [ "THIS_JOB_NOT_ACTIVE", "SELF" ]
	},
	{
		"template": "JOB_PARTICIPANT",
		"promptText": "Who will search for the X on the map?",
		"slots": { "preFill": "noJobOrParty" }
	}
],

A few other details of the job are specified in the encounter, which are easier to explain. In the below screenshot of the job, the blurb is what appears in the overlap map tooltip when you hover over the flag. The longName is used for the text of the button. The icon ("magic") is used to select the icon that appears in the flag and the button. As of this writing, it is not possible for modders to add icons; but you can find existing icons and use one of them. The category ("research") is used to select the color of the flag and button. Research is purple, crafting is blue, and site is orange. I don't think modders can control the colors either but probably it is better to use these standard colors.

ModdingMapAbility.PNG

Putting it together

The best way to create your own encounter like this is to copy the two files for the encounter out of this mod and into your own. Then edit them, either using a text editor on the json, or with the in-game editor. Don't forget to create the aspect, and make sure all the names are matching. Then follow the instructions at the start of this guide to see your encounter in game.