Difference between revisions of "Modding add equipment"

From Wildermyth Wiki
Line 8: Line 8:
==Modifying the files==
==Modifying the files==
<ol>
<ol>
<li>Using a file explorer, navigate to the game install directory: steam\steamapps\common\Wildermyth\assets.  We need to copy (not move!) several files from there to your mod directory.  For each file when it is mentioned below, create folders in your mod as needed and copy.  These files are program source code and formatting is very important.
<li>Using a file explorer, navigate to the game install directory: steam\steamapps\common\Wildermyth\assets.  We need to copy (not move!) several files from there to your mod directory.  For each file when it is mentioned below, create folders in your mod as needed and copy, and then modify.  These files are program source code and formatting is very important.
<li>Add new effects.  Copy/modify data\aspects\items.json.  This will contain the bonuses that your items give.  You can search in the original file for ideas.  For this project, delete all the text and paste the following lines.  This adds two effects, +10 block and +1 armor. In your own mods I recommend you use your own unique prefix for items you add rather than "davea". 
<li>Add new aspects (effects).  Copy/modify data\aspects\items.json.  This will contain the bonuses that your items give.  You can search in the original file for ideas.  For this project, delete all the text and paste the following lines.  This adds two effects, +10 block and +1 armor.  
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
[
[
Line 21: Line 21:
}
}
]</syntaxhighlight>
]</syntaxhighlight>
<li>'''It is very important to delete all the other lines in the file.'''  Your declarations of these items will override what is in the original game files.  This prevents the developers from fixing bugs!  For example, suppose you leave behind the definition of an item; and the developers change that item to fix a bug or improve balancing.  Your mod loads with higher priority than the game's original files.  So your incorrect definition loads with higher priority than the developers' new and improved definition.  Players using your mod will not see this bug fix, and it will be very confusing to debug!
<li>'''It is very important to delete all the other lines in the file.'''  Your declarations of these items will override what is in the original game files.  This prevents the developers from fixing bugs!  For example, suppose you leave behind the definition of an item; and the developers change that item to fix a bug or improve balancing.  Your mod loads with higher priority than the game's original files.  So your incorrect definition loads with higher priority than the developers' new and improved definition.  Players using your mod will not see this bug fix, and it will be very confusing to debug!
# Add the new item.  Copy/modify data\items\offHand.json.  You can search in the original file for ideas.  For this project, delete all the text and paste the following lines.  This adds a shield which uses an existing image from the game, but gives the new shield effects created above.
<li>I also recommend that all the items and effects you add should start with a unique prefix.  I have used "davea".  This helps in keeping all your items together, filtering to find your items, and distinguishing items added by one mod versus another.
<li>Add the description for the aspects.  Copy/modify text\aspects\aspects.properties.  Delete all the text and add these lines:
<code>
#suppress inspection "UnusedProperty" for whole file
daveaShieldBlockBonus.blurb=davea effect shield block blurb
daveaShieldArmorBonus.blurb=davea effect shield armor blurb
</code>
 
<li>Add the new item.  Copy/modify data\items\offHand.json.  You can search in the original file for ideas.  For this project, delete all the text and paste the following lines.  This adds a shield which uses an existing image from the game, but gives the new shield effects created above.
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
[
[
Line 43: Line 52:
]
]
</syntaxhighlight>
</syntaxhighlight>
<li>Next point
<li>Add the name and blurb for the item.  Copy file text\dynamic\dynamic.properties.  Delete all the text and add these lines:
<code>
#suppress inspection "UnusedProperty" for whole file
item.daveaShield1=Davea's shield name
itemSummary.daveaShield1=Davea's shield summary
</code>
</ol>
</ol>



Revision as of 13:15, 30 November 2019

This page is a work in progress. It will walk through the process of adding a new item, a shield. 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.

Getting started

  1. Select "Tools" at the main game screen, then "Open Editor", then "Content and Comics Editor"
  2. 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; note that the directory is steam\steamapps\common\wildermyth\mods\user\<your mod name>. You will use this directory soon.
  3. Click the "save" button and then exit. Most of the work for this mod is done outside the in-game editor; the editor doesn't appear to support creating items yet.

Modifying the files

  1. Using a file explorer, navigate to the game install directory: steam\steamapps\common\Wildermyth\assets. We need to copy (not move!) several files from there to your mod directory. For each file when it is mentioned below, create folders in your mod as needed and copy, and then modify. These files are program source code and formatting is very important.
  2. Add new aspects (effects). Copy/modify data\aspects\items.json. This will contain the bonuses that your items give. You can search in the original file for ideas. For this project, delete all the text and paste the following lines. This adds two effects, +10 block and +1 armor.
    [
    {
    	"id": "daveaShieldBlockBonus",
    	"stats": { "BLOCK": 10 }
    },
    {
    	"id": "daveaShieldArmorBonus",
    	"stats": { "ARMOR": 1 }
    }
    ]
    
  3. It is very important to delete all the other lines in the file. Your declarations of these items will override what is in the original game files. This prevents the developers from fixing bugs! For example, suppose you leave behind the definition of an item; and the developers change that item to fix a bug or improve balancing. Your mod loads with higher priority than the game's original files. So your incorrect definition loads with higher priority than the developers' new and improved definition. Players using your mod will not see this bug fix, and it will be very confusing to debug!
  4. I also recommend that all the items and effects you add should start with a unique prefix. I have used "davea". This helps in keeping all your items together, filtering to find your items, and distinguishing items added by one mod versus another.
  5. Add the description for the aspects. Copy/modify text\aspects\aspects.properties. Delete all the text and add these lines:
    1. suppress inspection "UnusedProperty" for whole file
    daveaShieldBlockBonus.blurb=davea effect shield block blurb daveaShieldArmorBonus.blurb=davea effect shield armor blurb
  6. Add the new item. Copy/modify data\items\offHand.json. You can search in the original file for ideas. For this project, delete all the text and paste the following lines. This adds a shield which uses an existing image from the game, but gives the new shield effects created above.
    [
    	{
    		"id": "daveaShield1",
    		"tier": 1,
    		"category": "offHand",
    		"slots": ["OFF_HAND"],
    		"ownerAspects": [
    			"daveaShield1", 
    			"daveaShieldArmorBonus", 
    			"daveaShieldBlockBonus"
    		],
    		"cost": ["1 ingot", "2 heartwood"],
    		"layers": [
    			{"name": "augment_shieldCaveA_tint1", "depth": 6100, "tint": "primary", "tintAmount": 1.0},
    			{"name": "augment_shieldCaveB_untinted", "depth": 6101}
    		]
    	}
    ]
    
  7. Add the name and blurb for the item. Copy file text\dynamic\dynamic.properties. Delete all the text and add these lines:
    1. suppress inspection "UnusedProperty" for whole file
    item.daveaShield1=Davea's shield name itemSummary.daveaShield1=Davea's shield summary

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, and check "enable cheats". You don't need to select any of the sub-options under cheats for this project.
  3. When the game starts, click through the initial encounter to get to the first battle.
  4. Pick one of your characters, open the detail view, and click the gear tab. You will see a cheat menu that allows you to select any kind of item and add it. Select offhand, select your new item in the popup, and clock add item to add it. You will see the name at the top and the summary at the right. Try it out in combat!

ModdingItemPickMe.PNG