User:Kernelmethod/Sandbox: Difference between revisions
Kernelmethod (talk | contribs) No edit summary |
Kernelmethod (talk | contribs) No edit summary |
||
Line 24: | Line 24: | ||
Before you get started, you may also want to check out the [https://steamcommunity.com/sharedfiles/filedetails/?id=1302696701| Blue Ctesiphus modding tutorial] on Steam. It's a little dated, but it also covers many of the concepts covered here. | Before you get started, you may also want to check out the [https://steamcommunity.com/sharedfiles/filedetails/?id=1302696701| Blue Ctesiphus modding tutorial] on Steam. It's a little dated, but it also covers many of the concepts covered here. | ||
This mod won't require any scripting, so you don't need to know anything about C#. However, I'd recommend that you play through a good chunk of Caves of Qud before you try your hand at modding. It's helpful to be able to refer to existing creatures and items when creating new ones. | |||
== Getting started, and basic concepts == | |||
If this is your first time modding, make sure to follow the checklist in [[Modding:Overview]]. It's particularly important that you install a text editor like [https://code.visualstudio.com/| VS Code]. I've prepared all of the tiles that you'll need to use for this tutorial, so you don't need to familiarize yourself with a pixel editor. However, if you plan on adding new tiles in the future you should be familiar with an editor like [https://www.piskelapp.com/| Piskel] or [https://www.aseprite.org/| Aseprite]. | |||
You should also enable the following options in your game: | |||
* Modding > Enable Mods | |||
* Debug > Show quickstart option during character generation. | |||
** This will cause a new <code>_Quickstart</code> 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: | |||
* the "offline mods" folder; and | |||
* the "game data files" folder. | |||
=== XML === | === XML === | ||
Line 43: | Line 43: | ||
'''XML''' (the e'''X'''tended '''M'''arkup '''L'''anguage) is a type of ''markup language'', which (loosely speaking) is a text-based document format that can be read and interpreted by a program. Caves of Qud makes extensive use of XML for things like defining creatures, quests, items, conversations, and more. We'll be working with XML a lot throughout this tutorial, so it's helpful to have a little familiarity with XML first. | '''XML''' (the e'''X'''tended '''M'''arkup '''L'''anguage) is a type of ''markup language'', which (loosely speaking) is a text-based document format that can be read and interpreted by a program. Caves of Qud makes extensive use of XML for things like defining creatures, quests, items, conversations, and more. We'll be working with XML a lot throughout this tutorial, so it's helpful to have a little familiarity with XML first. | ||
You can check out the [https://en.wikipedia.org/wiki/XML| Wikipedia page on XML] if you want to learn more | You can check out the [https://en.wikipedia.org/wiki/XML| Wikipedia page on XML] if you want to learn more. Here's some basic terminology you should be familiar with: in the XML snippet below, | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 64: | Line 64: | ||
=== Wishes === | === Wishes === | ||
[[Wishes]] are commands that can be executed in-game to perform a variety of tasks. They're very useful when modding -- you can use a wish to spawn a creature of your choice, or create an item, and a variety of other tasks. You should follow the instructions on the [[Wishes]] page to bind the wish command to a key combination. | |||
There are a lot of useful wishes. Here are a few that I use often: | |||
* <code>idkfa</code>: puts your character in "God Mode". This makes your character immortal, and causes all attacks that penetrate to instantly kill. | |||
* <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}}. | |||
== Creating a mod == | == Creating a mod == | ||
{| 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;" | Let's get started! | |||
|} | |||
The first thing we'll do is create a mod that doesn't actually do anything. To do that, go to Caves of Qud's "offline mods" folder; you can find the location of this folder for your operating system by looking at the page of [[file locations]]. Inside this folder (it should be named <code>Mods</code>), create a new folder called <code>SnapjawMage</code>. The first file we're going to create for our mod will be a '''''manifest file'''''; this contains metadata such as our mod's title, a description of the mod, and its version. Create a new file called <code>manifest.json</code> inside the <code>SnapjawMage/</code> folder, and paste in the following contents: | |||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> |