Modding:Overview: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
m (add heading; add paragraph break)
(add mention of build_log.txt)
(21 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Modding]]
[[Category:Modding Resources]]
<div class="nomobile">{{Ambox
<div class="nomobile">{{Ambox
| border = blue
| border = blue
| image = [[File:AmboxAlchTable.png|48px|Modding Info]]
| image = [[File:AmboxAlchTable.png|48px|Modding Info]]
| type = ''For information on ''installing'' mods, see [[Modding: Installing a mod]].''
| type = ''For information on ''installing'' mods, see [[Modding:Installing a mod]].''
}}</div><!--
}}</div><!--
--><div class="mobileonly" style="text-align:center">''For information on ''installing'' mods, see [[Modding: Installing a mod]].''</div>
--><div class="mobileonly" style="text-align:center">''For information on ''installing'' mods, see [[Modding: Installing a mod]].''</div>
Line 9: Line 9:
Caves of Qud presents a broadly extensible engine. The game's core definition files reside in <code>%game directory%\CoQ_Data\StreamingAssets\Base</code>.
Caves of Qud presents a broadly extensible engine. The game's core definition files reside in <code>%game directory%\CoQ_Data\StreamingAssets\Base</code>.


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.
You can create mods for the game by creating a Mods folder in the same parent directory where your Saves are located, 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: <code>C:\Users\Brian\AppData\LocalLow\Freehold Games\CavesOfQud\Mods\MyAwesomeMod</code>
For the exact mod folder locations for your operating system, see [[file locations#"Offline" mods (user created or manually added)|file locations]].


Likewise, on Linux: <code>~/.config/unity3d/Freehold Games/CavesOfQud/Mods/MyAwesomeMod</code>
== A (partial) checklist for getting ready to mod ==


On Mac: <code>~/Library/Application Support/com.FreeholdGames.CavesOfQud/mods/MyAwesomeMod</code>
* If your file manager (such as Windows Explorer) hides file extensions, tell it to show them instead. Being able to verify you're using the correct file extensions is vital when programming.
* Install a programming text editor, such as [https://code.visualstudio.com/ Visual Studio Code] (all major platforms), [https://www.sublimetext.com/ Sublime Text] (all major platforms), or [https://notepad-plus-plus.org/ Notepad++] (Windows only).
** Visual Studio Code in particular, paired with Microsoft's C# extension for it, is very useful if you plan to write any [[Modding:C Sharp Scripting|script mods]].
** Word processors (such as LibreOffice Writer and Microsoft Word) are unsuitable for modding the game, because they deal primarily with ''formatted'' text, as opposed to ''plain'' text.
** If you cannot install a programming text editor for whatever reason, Notepad is ''essentially'' useable, even though it's missing certain features usually considered desireable for programming, such as syntax highlighting and line numbering.
* If you plan to mod in your own tiles, familiarize yourself with a pixel editor, such as [https://www.piskelapp.com/ Piskel] (all major platforms and web).
** GIMP is essentially useable, but it isn't designed specifically for pixel art and may take more work to make game tiles with it than with a dedicated pixel editor.


You may have to create the "mods" folder yourself.
== Possible Issues ==


== A note about text editors ==
'''I'm stuck and don't know what to do.''' Feel free to ask for help or guidance in #modding on [https://discordapp.com/invite/cavesofqud 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.


Note that word processors, such as Microsoft Word, are not suitable for modding the game, because they save documents in a format intended for formatted text and the like, instead of for plain text, which is what programming tools tend to use.
'''How do I troubleshoot my mod?''' A good place to start is by reading the following files that are updated every time the game runs:
* <code>build_log.txt</code>: Includes compiler errors if your mod code has errors that will not compile. These errors can prevent your mod from being loaded at all.
* <code>Player.log</code>: Includes XML errors and other miscellaneous errors that can prevent your mod from working as intended, even if it does load. Search the file for <code>MODERROR</code> statements, and review carefully for other output lines that mention your mod.


Consider using [https://notepad-plus-plus.org/ Notepad++] (Windows only) or [https://www.sublimetext.com/ Sublime Text] (all major platforms) instead, or nearly any other programming text editor. If you must make do with what's already installed on your machine, Notepad is also essentially useable, even if it's missing certain features usually desireable for programming, such as syntax highlighting.
'''Where can I find <code>build_log.txt</code> and <code>Player.log</code>?''' See [[file locations#Log file|file locations]].


== Modding FAQ/Frequent Issues ==
'''My mod has been marked incompatible on Steam Workshop. What do I do?''' Update your mod to work with the latest stable or beta release of the game, then request that your mod be unmarked incompatible via either [https://discordapp.com/invite/cavesofqud the official Caves of Qud Discord server]'s #modding channel, or the support email address, [mailto:support@freeholdgames.com support@freeholdgames.com].


'''Q: I keep getting an error when trying to save my game.'''
'''I keep getting an error when trying to save my game.''' 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 [[Modding: Serialization (Saving/Loading)|this article]] on how to override Qud's default saving/loading.
 
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 [[Modding: Serialization (Saving/Loading)|this article]] on how to override Qud's default saving/loading.
[[Category:Guides]]
[[Category:Guides]]
'''Q: I'm stuck and don't know what to do.'''
A: Feel free to ask for help or guidance in #modding on [https://discordapp.com/invite/cavesofqud 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.


{{Modding Navbox}}
{{Modding Navbox}}

Revision as of 16:08, 17 January 2022

For information on installing mods, see Modding:Installing a mod.
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 the same parent directory where your Saves are located, 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 the exact mod folder locations for your operating system, see file locations.

A (partial) checklist for getting ready to mod

  • If your file manager (such as Windows Explorer) hides file extensions, tell it to show them instead. Being able to verify you're using the correct file extensions is vital when programming.
  • Install a programming text editor, such as Visual Studio Code (all major platforms), Sublime Text (all major platforms), or Notepad++ (Windows only).
    • Visual Studio Code in particular, paired with Microsoft's C# extension for it, is very useful if you plan to write any script mods.
    • Word processors (such as LibreOffice Writer and Microsoft Word) are unsuitable for modding the game, because they deal primarily with formatted text, as opposed to plain text.
    • If you cannot install a programming text editor for whatever reason, Notepad is essentially useable, even though it's missing certain features usually considered desireable for programming, such as syntax highlighting and line numbering.
  • If you plan to mod in your own tiles, familiarize yourself with a pixel editor, such as Piskel (all major platforms and web).
    • GIMP is essentially useable, but it isn't designed specifically for pixel art and may take more work to make game tiles with it than with a dedicated pixel editor.

Possible Issues

I'm stuck and don't know what to do. 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.

How do I troubleshoot my mod? A good place to start is by reading the following files that are updated every time the game runs:

  • build_log.txt: Includes compiler errors if your mod code has errors that will not compile. These errors can prevent your mod from being loaded at all.
  • Player.log: Includes XML errors and other miscellaneous errors that can prevent your mod from working as intended, even if it does load. Search the file for MODERROR statements, and review carefully for other output lines that mention your mod.

Where can I find build_log.txt and Player.log? See file locations.

My mod has been marked incompatible on Steam Workshop. What do I do? Update your mod to work with the latest stable or beta release of the game, then request that your mod be unmarked incompatible via either the official Caves of Qud Discord server's #modding channel, or the support email address, support@freeholdgames.com.

I keep getting an error when trying to save my game. 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.