Modding monster abilities
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.
Preparation
This guide builds on the previous guide Adding a monster. You can also find the files created during that guide in a learning mod on steam workshop: Oh no a dragon. If it is helpful, you can start from that mod as described in Using an existing mod as a starting point.
Main concept
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. You cannot add a new monster here currently.
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:
[
{
"modId": "lewe",
"id": "lewe_lord_stun",
"effects": [ "lewelord_stun" ],
"importance": -1,
}
]
The name can be anything; one possible format is "<modId>_<monsterName>_<abilityDescription>". 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.
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 basic effect
Effects can be very complicated, and in this guide we won't get into many details. 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.
Seeing the effect in game
- 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.
- 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: