Difference between revisions of "Modding replace faction"

From Wildermyth Wiki
(Created page with "This page walks through the process of adding a new ability to a custom monster. The focus is on getting something simple which you can see in the game, and adding more detai...")
 
Line 1: Line 1:
This page walks through the process of adding a new ability to a custom monster.  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 December 2019, early access version 0.12+104 Pixle Masterson.   
This page walks through the process of replacing all the monsters in a faction.  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 July 2020, early access version 0.23+148 Triss Thornfire.   


==Preparation==
==Main concept==
This guide builds on the previous guide [[Modding add monster|Adding a monster]]You can also find the files created during that guide in a learning mod on steam workshop: [https://steamcommunity.com/sharedfiles/filedetails/?id=1925402595 Oh no a dragon].  If it is helpful, you can start from that mod as described in [[Modding Guide#Using an existing mod as a starting point|Using an existing mod as a starting point]].
Today, modders cannot add factions.  The game is hard-coded with five factionsBut, you can replace all the monsters in a faction and change the name. Why would you do this, instead of just adding new monsters without factions? Because of calamities.  In other games, you can make a large "family" of monsters with stronger and stronger abilities, and use an "encounter table" that maps the party's power level against the monster types.  So, low level parties will encounter easy monsters and high level parties will encounter hard monsters.  In Wildermyth, for the most part, low and high level parties encounter the same monsters; but calamities make the monsters stronger or add special effectsHopefully, this makes encounters interesting for parties of all levels automatically.
 
If you want to add one monster for one event, you can do that, but you can't really tune it to be an interesting encounter for both a low level party and high level party.  It's better to redefine a faction, and use the calamity system to make the monsters stronger as the party grows stronger.
 
Here are the steps to replacing a faction.
<ol>
<li>Add monsters.  The basics of adding monsters are described in this tutorial: [[Modding add monster|Adding a monster]]. Most factions have 5-9 different monsters.</li>
<li>Change the faction name.  This has some limitations; As of today, your name won't show up everywhere, and there are some images you can't change.</li>
<li>Update the calamities.</li>
<li>Add the "tracks" for generating monsters.</li>
 
==Change the faction name==


==Main concept==
NYI
Monsters have a list of aspects; each aspect allows them to do one thing.  Some aspects include things like opening doors and searching, which many but not all monsters can do.  Monsters also have several attacks which they may choose among; the aspect simply points to an effect, and the details are in the effect.  We'll add a simple aspect, add this to the monster, add the related effect, and then most of the work is in the effect.  It's easiest to add a new ability which is a simple modification of an existing monster ability, weapon ability, or character class ability.  You can view monster abilities using the in-game editor; choose "monsters (ctr+7)" in the top dropdown.
 
==Update the calamities==
 
NYI
 
==Add tracks==
 
NYI


==Create the aspect==
The aspect links the monster to the effect.  It's quick to create the aspect file in a text editor, and easier to control the names.  Create the folders as needed to edit a new file in the assets/aspects folder.  I use one file named <mod>_aspects.json to store all the aspects.  Each aspect looks like this:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
[
[
Line 19: Line 35:
]
]
</syntaxhighlight>
</syntaxhighlight>
The name can be anything; one possible format is "<modId>_<abilityDescription>_<monsterName>".  It is OK to have the same name for the aspect and the effect.
==Add the aspect to the monster==
You can use the in-game editor, or a text editor.  Using the in-game editor, go to the monster tab (ctr+7), find your monster in the alphabetical list (using the mod prefix for monster names is helpful), hover over "aspects", click "Add", and find your aspect in the picklist.  Here is a screenshot.


[[File:ModdingMonsterAspect.PNG]]
[[File:ModdingMonsterAspect.PNG]]
In a text editor, find the aspects section in the monster file; it will have a number of aspects including probably "monstrous" and "monsterCanSearch".  Add your aspect into the list.
==Create the effect==
Effects can be very complicated, and this author doesn't understand all the details yet.  In general we can think of three types of combat abilities: on a player weapon (eg, water enchantment), on a player button (eg, the raider ability), or as part of a monster attack.  Each of these has different details.  Monster attacks need to be triggered automatically by the AI, rather than bound to a weapon or button. It's helpful to start with two existing working game files, one which is a monster ability with the type of targeting we want, and one which has an outcome close to what we want.
Then the new effect file can be constructed by cutting together the targets section of the first one, with the outcome section of the second one.  In this example we will make an ability which stuns all adjacent characters on a hit.
==Create the targets section==
The targets section creates roles.  In an encounter, roles are speaking roles, that is they are characters who appear in the comic with dialog.  In a combat effect, role is a more generic term which can refer to a tile as well.  Assuming you have chosen an existing ability with the same type of targeting, it may not be necessary to make changes to the targets section; paste from the existing monster ability.  Typical targets include targetTile, self, and the generic "target".  After some editing, here is the targets section of the new ability.  This author cannot explain every field; details may be available in the [[Effects]] and [[Outcomes]] pages.
[[File:ModdingMonsterTargets.PNG]]
Here is the corresponding json code.
<syntaxhighlight lang="json">
"targets": [
{
"template": "SELF",
"cost": { "class": "ActionPoints", "actionPoints": "attack" },
"missionFeedback": { "orientTo": "target" }
},
{
"template": "ADJACENT_ENEMY",
"showAnyway": true,
"alwaysSelect": true,
"aspects": [ "HOSTILE_TARGET", "alive" ],
"range": "1.6+self.BONUS_RANGE",
"lineOfSight": "LIVE_FIGURES"
},
{
"role": "targetTile",
"template": "TILE",
"missionFeedback": {
"rangeFeedback": "FRIENDLY_EFFECT_RANGE",
"suggestionFeedback": "FRIENDLY_EFFECT_SUGGESTION",
"hoverFeedback": "FRIENDLY_EFFECT_HOVER",
"applyRoleFootprint": "target"
},
"pathFrom": "self",
"pathTo": "target",
"matchSpecial": "knockBackDestination",
"relativeTo": "target",
"range": "2",
"lineOfSight": "ANY_COVER",
"tileFilter": "parentLocationOrValidMoveEnd",
"roleMustFit": "target"
},
{
"role": "target2",
"template": "ADJACENT_ENEMY",
"choose": "ANY",
"missionFeedback": null,
"aspects": [ "HOSTILE_TARGET", "alive" ],
"range": "max(1.6,weapon.weaponMaxRange)+self.BONUS_RANGE",
"lineOfSight": "LIVE_FIGURES"
}
]
</syntaxhighlight>
==Create the outcomes section==
The outcomes section uses the roles in the targets section, and does something.  It determines hit chances and applies damage or aspects to the targets who are hit.  As mentioned above, this author is not yet an expert on all the things that can be done; but it is possible to make new effects by copying related sections from other outcomes sections.  In this case, the stun effect is applied by other weapons and its name is "senseless".  The outcomes section of the in-game editor is very tall because of all the possible optional fields, but this screenshot shows the most important part
[[File:ModdingMonsterOutcomes.PNG]]


==Seeing the effect in game==
==Seeing the effect in game==
Line 93: Line 42:
# Choose tools from the game main menu, then select combat lab.  This will give you a chessboard-like battle map with a few characters and monsters already spawned.
# Choose tools from the game main menu, then select combat lab.  This will give you a chessboard-like battle map with a few characters and monsters already spawned.
# In the "Generate a unit" dropdown at the left, choose "Davea's monster" and then click Side A.  Your monster should appear:
# In the "Generate a unit" dropdown at the left, choose "Davea's monster" and then click Side A.  Your monster should appear:
[[File:ModdingMonsterPickMe.PNG]]


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

Revision as of 10:29, 2 July 2020

This page walks through the process of replacing all the monsters in a faction. 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 July 2020, early access version 0.23+148 Triss Thornfire.

Main concept

Today, modders cannot add factions. The game is hard-coded with five factions. But, you can replace all the monsters in a faction and change the name. Why would you do this, instead of just adding new monsters without factions? Because of calamities. In other games, you can make a large "family" of monsters with stronger and stronger abilities, and use an "encounter table" that maps the party's power level against the monster types. So, low level parties will encounter easy monsters and high level parties will encounter hard monsters. In Wildermyth, for the most part, low and high level parties encounter the same monsters; but calamities make the monsters stronger or add special effects. Hopefully, this makes encounters interesting for parties of all levels automatically.

If you want to add one monster for one event, you can do that, but you can't really tune it to be an interesting encounter for both a low level party and high level party. It's better to redefine a faction, and use the calamity system to make the monsters stronger as the party grows stronger.

Here are the steps to replacing a faction.

  1. Add monsters. The basics of adding monsters are described in this tutorial: Adding a monster. Most factions have 5-9 different monsters.
  2. Change the faction name. This has some limitations; As of today, your name won't show up everywhere, and there are some images you can't change.
  3. Update the calamities.
  4. Add the "tracks" for generating monsters.
  5. Change the faction name

    NYI

    Update the calamities

    NYI

    Add tracks

    NYI

    [
    {
    	"modId": "lewe",
    	"id": "lewe_stun_lord",
    	"effects": [ "lewe_stun_lord" ],
    	"importance": -1,
    }
    ]
    

    ModdingMonsterAspect.PNG

    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. Choose tools from the game main menu, then select combat lab. This will give you a chessboard-like battle map with a few characters and monsters already spawned.
    3. In the "Generate a unit" dropdown at the left, choose "Davea's monster" and then click Side A. Your monster should appear: