Modding
Hammerwatch 2 has a robust system for modding, with a few different types of mods possible.
Getting Started
- Open the game's folder (e.g. C:\Program Files (x86)\Steam\steamapps\common\Hammerwatch 2)
- Run "PACKAGER.exe"
- Select "Resources" from the list
- Click the "Extract Base Resources" button at the top (icon is a cardboard box)
- Wait for the unpacking to finish (This will take a while). It may give an error, this can be ignored.
- When finished, it will create a new folder named "unpacked_assets_[number]" containing all of the base game files
- Create a new folder named "mods"
- Create a new folder in mods with the name of your mod (cannot have spaces).
- Create a file info.xml with the following information
<dict>
<string name="name">Mod Name Here</string>
<string name="author">Your Name Here</string>
<string name="description">Explanation of what the mod is/does.</string>
</dict>
- Copy files you want to modify with their existing folder structure to your mod folder
- Use the <loader> tag to add new files.
Creating a new class
- In your mod folder, create a new folder "players"
- Copy an existing class from the unpacked players folder into your mod players folder
- Rename the baseclass folder and the baseclass.unit file within to your new class name
- Create a new file in players named <yourclass>.inc
- Copy the baseclass section %defblock to %endblock from unpacked/players/classes.inc into <yourclass>.inc
- Replace the baseclass with yourclass on the first line %defblock
- Edit the id, name and description at the top of the file to your own text (remove the .item.info.tooltip.class. and .menu.class. text).
- Edit the unit field to be players/yourclass/yourclass.unit
- Replace the baseclass with yourclass for every line in the <array name="skills"> section
- Create a new file in player named "modded_classes.sval"
- Paste the following contents into the file, using yourclass name:
- <loader order="1">PlayerClass::LoadMultiple</loader>%include "players/yourclass.in<array>%block yourclass</array>
- Paste the following contents into the file, using yourclass name:
- Rebuild the .tif files which are not unpacked correctly
- Download a tif conversion tool (e.g. Image Magick)
- Open powershell and navigate to your class folder: "cd \Steam\steamapps\common\Hammerwatch 2\mods\yourmod\players\yourclass"
- Convert all of the png files into tif with planar interlacing "magick mogrify -format tif -interlace plane orb*.png"