User:Kernelmethod/Sandbox: Difference between revisions

mNo edit summary
Add a section on navigating the game's data files.
Line 37: Line 37:
** This will cause a {{qud text|&Y_Quickstart}} option to show up when you start a new game. This option makes it very easy to create a new character and immediately start testing out your mod.
** This will cause a {{qud text|&Y_Quickstart}} option to show up when you start a new game. This option makes it very easy to create a new character and immediately start testing out your mod.


Finally, you should take a look at the page of [file locations] and find the following directories on your computer:
Finally, you should take a look at the page of [[file locations]] and find the following directories on your computer:
* the "offline mods" folder; and
* the "offline mods" folder; and
* the "game data files" folder.
* the "game data files" folder.
Line 74: Line 74:
* <code>swap</code>: allows you to swap your body with an adjacent creature.
* <code>swap</code>: allows you to swap your body with an adjacent creature.
* In addition, you can wish for the ID of a creature or item to spawn that creature/item. For instance, wishing for <code>Troll King 1</code> will spawn {{favilink|Jotun, Who Parts Limbs}}.
* In addition, you can wish for the ID of a creature or item to spawn that creature/item. For instance, wishing for <code>Troll King 1</code> will spawn {{favilink|Jotun, Who Parts Limbs}}.
=== Navigating the game's data files ===
We won't delve too deeply into Caves of Qud's data files, but it's helpful to know how to navigate through them when creating a mod. Make sure that you've found where your computer keeps the game's data files by looking at the list of [[file locations]] before continuing; it should be a subfolder called <code>Base</code> of a folder called <code>StreamingAssets</code> somewhere on your machine.
{| style = "margin: 1em;font-family:Source Code Pro;"
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]]
| style= "color:#155352" | <
| style = "border:1px solid #155352;padding:0.5em 1em;" | Don't modify the game's files! You could end up having to reinstall the game in order to fix a mistake.
|}
Once you've found this folder, you should see a bunch of files with names ending in things like .bmp, .rpm, .xml, .json, and so on.
[[File:Snapjaw_Mages_--_Game_files.webp|700px]]
For this tutorial, the .xml files are the ones we're going to be the most interested in. There are a lot of these files (35 as of game version 2.0.205.63); here's a high-level overview of just a few of them:
* <code>Bodies.xml</code>: in charge of defining various body parts and creature anatomies. This is useful when you want to define a new body type; for instance, the [https://github.com/librarianmage/Blahajar| Blahajar mod] defines a unique anatomy specific to sharks.
* <code>Conversations.xml</code>: defines the conversational script that different creatures have.
* <code>Mutations.xml</code>: data file containing all of the mutations that are available in-game.
* <code>ObjectBlueprints/Creatures.xml</code>: definitions of all of the creatures that exist in Caves of Qud.
* <code>ObjectBlueprints/Items.xml</code>: definitions of all of the items available in Caves of Qud.
* <code>Skills.xml</code>: contains all of the skill trees provided by Caves of Qud, and abilities within those trees.
* <code>Quests.xml</code>: lays out the steps and rewards for non-procedurally generated quests.
When adding new creatures and items (as in this tutorial!), we're mostly going to be interested in just <code>ObjectBlueprints/Creatures.xml</code> and <code>ObjectBlueprints/Items.xml</code>. Starting in the next section, we'll discuss what all of the bits and pieces mean in these files. Make sure you know where to find these files before you continue!


== Creating a mod ==
== Creating a mod ==