User:Kernelmethod/Sandbox: Difference between revisions
Kernelmethod (talk | contribs) Shorten the dynamic tables section a bit, add a reference to the Modding:Encounters and Population page |
Kernelmethod (talk | contribs) m Tweak interlocutor CSS to fix images in mobile view. |
||
Line 6: | Line 6: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Howdy! | | style = "border:1px solid #155352;padding:0.5em 1em;" | Howdy! | ||
Line 12: | Line 12: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | I'm excited! | | style = "border:1px solid #155352;padding:0.5em 1em;" | I'm excited! | ||
Line 84: | Line 84: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Don't modify the game's files! If you make a mistake, you could end up having to reinstall the game. | | style = "border:1px solid #155352;padding:0.5em 1em;" | Don't modify the game's files! If you make a mistake, you could end up having to reinstall the game. | ||
Line 109: | Line 109: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Let's get started! | | style = "border:1px solid #155352;padding:0.5em 1em;" | Let's get started! | ||
Line 129: | Line 129: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Feel free to replace <code>Pyovya</code> with your own name! | | style = "border:1px solid #155352;padding:0.5em 1em;" | Feel free to replace <code>Pyovya</code> with your own name! | ||
Line 153: | Line 153: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Every time you make a change to your mod, you will need to go back to this screen and activate the "Save and Reload" option (which you can do by pressing <code>r</code>). You should see a bar saying "reloading mod configuration" appear at the bottom of your screen, like so: | | style = "border:1px solid #155352;padding:0.5em 1em;" | Every time you make a change to your mod, you will need to go back to this screen and activate the "Save and Reload" option (which you can do by pressing <code>r</code>). You should see a bar saying "reloading mod configuration" appear at the bottom of your screen, like so: | ||
Line 198: | Line 198: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Hey, why'd you add the <code>Pyovya_SnapjawMage</code> bit to the front of the name of the creature? Why not just call it a <code>Snapjaw Mage</code>? | | style = "border:1px solid #155352;padding:0.5em 1em;" | Hey, why'd you add the <code>Pyovya_SnapjawMage</code> bit to the front of the name of the creature? Why not just call it a <code>Snapjaw Mage</code>? | ||
Line 204: | Line 204: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | When writing a mod, it's common courtesy to prefix unique identifiers with your name, an underscore <code>_</code>, followed by the mod's name. This ensures that if somebody else writes their own Snapjaw Mage mod, your mod won't conflict with theirs. | | style = "border:1px solid #155352;padding:0.5em 1em;" | When writing a mod, it's common courtesy to prefix unique identifiers with your name, an underscore <code>_</code>, followed by the mod's name. This ensures that if somebody else writes their own Snapjaw Mage mod, your mod won't conflict with theirs. | ||
Line 212: | Line 212: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | What's a part? | | style = "border:1px solid #155352;padding:0.5em 1em;" | What's a part? | ||
Line 218: | Line 218: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | A '''''part''''' is a special piece of code that can be added to a creature to modify its appearance, behavior, stats, and any number of other things. There are a ''lot'' of parts -- over a thousand! You won't need to worry about most of them; many of them are highly-customized bits of code written for just one or two creatures. For instance, there's a <code>CryptSitterBehavior</code> part that is used exclusively by {{favilink|crypt sitter|plural}}. | | style = "border:1px solid #155352;padding:0.5em 1em;" | A '''''part''''' is a special piece of code that can be added to a creature to modify its appearance, behavior, stats, and any number of other things. There are a ''lot'' of parts -- over a thousand! You won't need to worry about most of them; many of them are highly-customized bits of code written for just one or two creatures. For instance, there's a <code>CryptSitterBehavior</code> part that is used exclusively by {{favilink|crypt sitter|plural}}. | ||
Line 238: | Line 238: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | To reload your mods, return to the start screen for Caves of Qud, click on "installed mod configuration", and then press <code>r</code>. Then restart the game, either by continuing an old save or starting a new save. | | style = "border:1px solid #155352;padding:0.5em 1em;" | To reload your mods, return to the start screen for Caves of Qud, click on "installed mod configuration", and then press <code>r</code>. Then restart the game, either by continuing an old save or starting a new save. | ||
Line 250: | Line 250: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style = "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | I did? | | style = "border:1px solid #155352;padding:0.5em 1em;" | I did? | ||
|} | |} | ||
Line 258: | Line 258: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | *rustling noises* | | style = "border:1px solid #155352;padding:0.5em 1em;" | *rustling noises* | ||
Line 277: | Line 277: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | I'm just a lil old sprouting orb, I don't know how to do any of those things. | | style = "border:1px solid #155352;padding:0.5em 1em;" | I'm just a lil old sprouting orb, I don't know how to do any of those things. | ||
Line 374: | Line 374: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Hold up a second. How is this creature a mage? It doesn't have any kind of magic spells! | | style = "border:1px solid #155352;padding:0.5em 1em;" | Hold up a second. How is this creature a mage? It doesn't have any kind of magic spells! | ||
Line 407: | Line 407: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Notice how we've used the <code>Inherits</code> attribute here. We're telling the game that our original snapjaw mage creature, <code>Pyovya_SnapjawMage_Snapjaw Mage</code>, should serve as a base for our fire and ice mages. As a result, our creatures will spawn with walking sticks, have the [[Cudgel]] skill, and so on. | | style = "border:1px solid #155352;padding:0.5em 1em;" | Notice how we've used the <code>Inherits</code> attribute here. We're telling the game that our original snapjaw mage creature, <code>Pyovya_SnapjawMage_Snapjaw Mage</code>, should serve as a base for our fire and ice mages. As a result, our creatures will spawn with walking sticks, have the [[Cudgel]] skill, and so on. | ||
Line 453: | Line 453: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Does it matter whether I name my file <code>Items.xml</code>? And do I have to place it in the <code>ObjectBlueprints/</code> directory? | | style = "border:1px solid #155352;padding:0.5em 1em;" | Does it matter whether I name my file <code>Items.xml</code>? And do I have to place it in the <code>ObjectBlueprints/</code> directory? | ||
Line 459: | Line 459: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Nope and nope! In fact, you can name all of your XML files whatever you want (as long as they end in .xml) and place them wherever you feel like (as long as they're in the <code>SnapjawMage/</code> mod directory). The scheme that we're using here to organize our XML files is the same scheme that the game uses for its own files (the ones that you can find in the [[File locations|"game data files" folder]]), just to make the relationship between what we're writing and Caves of Qud's code a little bit clearer. | | style = "border:1px solid #155352;padding:0.5em 1em;" | Nope and nope! In fact, you can name all of your XML files whatever you want (as long as they end in .xml) and place them wherever you feel like (as long as they're in the <code>SnapjawMage/</code> mod directory). The scheme that we're using here to organize our XML files is the same scheme that the game uses for its own files (the ones that you can find in the [[File locations|"game data files" folder]]), just to make the relationship between what we're writing and Caves of Qud's code a little bit clearer. | ||
Line 517: | Line 517: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Do magic books use ammo? | | style = "border:1px solid #155352;padding:0.5em 1em;" | Do magic books use ammo? | ||
Line 642: | Line 642: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | I burnt down all of Joppa with my tome of fire! Take that, Ualraig. | | style = "border:1px solid #155352;padding:0.5em 1em;" | I burnt down all of Joppa with my tome of fire! Take that, Ualraig. | ||
Line 712: | Line 712: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Well, it looks like I can wish for a <code>Pyovya_SnapjawMage_Fire Tome</code> or a <code>Pyovya_SnapjawMage_Ice Mage</code>. But I can't find them anywhere in the game! | | style = "border:1px solid #155352;padding:0.5em 1em;" | Well, it looks like I can wish for a <code>Pyovya_SnapjawMage_Fire Tome</code> or a <code>Pyovya_SnapjawMage_Ice Mage</code>. But I can't find them anywhere in the game! | ||
Line 720: | Line 720: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | In fact, it ''is'' already possible for our snapjaw mages to appear in game; it's just that the probability of this happening is very low at the moment. We'll talk about this more when we discuss [[#dynamic population tables|dynamic tables]]. | | style = "border:1px solid #155352;padding:0.5em 1em;" | In fact, it ''is'' already possible for our snapjaw mages to appear in game; it's just that the probability of this happening is very low at the moment. We'll talk about this more when we discuss [[#dynamic population tables|dynamic tables]]. | ||
Line 796: | Line 796: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | What does <code>Load="Merge"</code> do? | | style = "border:1px solid #155352;padding:0.5em 1em;" | What does <code>Load="Merge"</code> do? | ||
Line 802: | Line 802: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | We need to specify <code>Load="Merge"</code> to tell Caves of Qud that we want to merge new XML into an existing table. This prevents us from creating a new population table like (for example) <code>SnapjawParty0</code> that overwrites the old one. | | style = "border:1px solid #155352;padding:0.5em 1em;" | We need to specify <code>Load="Merge"</code> to tell Caves of Qud that we want to merge new XML into an existing table. This prevents us from creating a new population table like (for example) <code>SnapjawParty0</code> that overwrites the old one. | ||
Line 970: | Line 970: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Because snapjaw mages are descended from the Snapjaw object, which in turn ultimately descends from the Creature object, it turns out that snapjaw mages were already included in some population tables before we started writing <code>PopulationTables.xml</code>! In particular, snapjaw mages could appear in the <code>DynamicInheritsTable:Creatures</code> table, although the probability of them being generated was pretty low. | | style = "border:1px solid #155352;padding:0.5em 1em;" | Because snapjaw mages are descended from the Snapjaw object, which in turn ultimately descends from the Creature object, it turns out that snapjaw mages were already included in some population tables before we started writing <code>PopulationTables.xml</code>! In particular, snapjaw mages could appear in the <code>DynamicInheritsTable:Creatures</code> table, although the probability of them being generated was pretty low. | ||
Line 991: | Line 991: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Mopango_pilgrim.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | Woohoo! | | style = "border:1px solid #155352;padding:0.5em 1em;" | Woohoo! | ||
Line 997: | Line 997: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | I'm ready to go face these mages in magical combat. | | style = "border:1px solid #155352;padding:0.5em 1em;" | I'm ready to go face these mages in magical combat. | ||
Line 1,012: | Line 1,012: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]] | | style = "padding:0em 1em; min-width: 40px;"| [[File:Sprouting orb.png|40px]] | ||
| style= "color:#155352" | < | | style= "color:#155352" | < | ||
| style = "border:1px solid #155352;padding:0.5em 1em;" | What should I do if I want to start designing my own creatures? | | style = "border:1px solid #155352;padding:0.5em 1em;" | What should I do if I want to start designing my own creatures? |