Modding:Overview

From Caves of Qud Wiki
Revision as of 23:43, 27 July 2019 by imported>Koboldunderlord (→‎Setup)
Jump to navigation Jump to search
For information on installing mods, see Modding: Installing a mod.

Caves of Qud presents a broadly extensible engine. The game's core definition files reside in %game directory%\CoQ_Data\StreamingAssets\Base.

You can create mods for the game by creating a Mods folder in your game save directory, and then creating a sub-folder inside of the Mods folder for your new mod. New content can be created and existing content can be modified or replaced via data files and textures placed in this directory.

For example, on Windows: C:\Users\Brian\AppData\LocalLow\Freehold Games\CavesOfQud\Mods\MyAwesomeMod

Likewise, on Linux: ~/.config/unity3d/Freehold Games/CavesOfQud/Mods/MyAwesomeMod

On Mac: ~/Library/Application Support/com.FreeholdGames.CavesOfQud/mods/MyAwesomeMod

You may have to create the "mods" folder yourself. No results

Mac Modding Tips

Working on a Mac can be a little harder, but once you get going the workflow is generally the same.

Setup

  1. Install [Visual Studio for Mac|http://visualstudio.microsoft.com/vs/mac/]. Make sure to install Monodevelop and any .NET tools it offers for C#. While it can directly open the dll, it's hard to navigate and dive into.
  2. Create a folder somewhere you want to save the decompiled code. In this example, I'll use ~/QudCode
  3. Open a terminal, and install ilspycmd: dotnet tool install ilspycmd -g
  4. Locate the code installation location. For Steam at least, this exists at ~/Library/Application Support/com.FreeholdGames.CavesOfQud/code
  5. Run the following command, combining the two previous locations: ilspycmd -p -o ~/QudCode/ ~/Library/Application Support/com.FreeholdGames.CavesOfQud/code/Assembly-CSharp.dll

This will output all the decompiled assets to ~/QudCode, and create a Visual Studio project file for you to open at that location! From there you can use Visual Studio to explore the code. You will need to decompile again every time Caves of Qud updates.

Modding FAQ/Frequent Issues

Q: I keep getting an error when trying to save my game.

A: Most likely, you have a list in your mod. Qud's default method of saving doesn't handle lists, so you need to handle it yourself. To see how, check out this article on how to override Qud's default saving/loading.

Q: I'm stuck and don't know what to do.

A: Feel free to ask for help or guidance in #modding on the official Caves of Qud discord server! There are several modders there who use the channel to talk through and ask for feedback on their mods.