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>
- Start making changes!
- Files with the same name as an existing file will take precedence and completely overwrite anything in the base file. You can copy folders or files directly from the unpacked_assets folder and make changes
- All .sval files are all read in when the game loads. You can use <loader> tags to merge additional data into existing and set load order
- .inc files are referenced with a %include in .sval files, but not automatically loaded
Tutorials
Video Tutorial - Hammerwatch 2 Modding: NPCs, Quests, and Custom Crafting
Text Tutorial - How to create a custom class
Fixing .tif files
The unpackager tool does not create tif files in the correct format to use for the game. Any .tif files copied from the unpacked_assets folder to your mod folders will show as an empty or glitched texture in game, popup an error on loading, and record an ERR event in HW2.exe.log. This can be corrected with any of the following methods
- Adobe Photoshop (Best - maintains masking to allow recoloring sprites)
- Photoshop has an option to convert tif files from standard (RGBRGB) to planar (RRGGBB) that the game expects. (Need more details on steps to perform)
- Image Magick Conversion (masking is lost and sprites can no longer be recolored)
- 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 using the command "magick mogrify -format tif -interlace plane *.png"