User:Kernelmethod/Sandbox: Difference between revisions
Kernelmethod (talk | contribs) Finish up the population tables section |
Kernelmethod (talk | contribs) m Small editing pass |
||
Line 286: | Line 286: | ||
https://github.com/TrashMonks/Snapjaw-Mages/blob/main/Snapjaw-Mages/Textures/Pyovya_SnapjawMage/snapjaw_mage.png | https://github.com/TrashMonks/Snapjaw-Mages/blob/main/Snapjaw-Mages/Textures/Pyovya_SnapjawMage/snapjaw_mage.png | ||
In your mod directory, create a folder called <code>Textures/</code>; in that folder, create a subfolder called <code>Pyovya_SnapjawMage | In your mod directory, create a folder called <code>Textures/</code>; in that folder, create a subfolder called <code>Pyovya_SnapjawMage/</code>. Save <code>snapjaw_mage.png</code> there, so that your mod folder now looks like this: | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
Line 305: | Line 305: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Now let's fill out some more details about our furry friend | Now let's fill out some more details about our furry friend! | ||
=== Adding inventory === | === Adding inventory === | ||
First of all, like any good mage, they need a {{favilink|walking stick}} and some [[book|books]]. Let's also give them some clothes to equip while we're at it. Add the following XML to your creature: | |||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 381: | Line 381: | ||
I was just getting to that! | I was just getting to that! | ||
So far, we've sketched out most of the properties, skills, and stats that a snapjaw mage should have. Now we're going to create two types of mages: '''''fire mages''''' and '''''ice mages'''''. | So far, we've sketched out most of the properties, skills, and stats that a snapjaw mage should have. Now we're going to create two types of mages: '''''fire mages''''' and '''''ice mages'''''. | ||
First, we need to mark the snapjaw mage we've created as a "base object", i.e. an object that doesn't appear in-game but which instead serves as the basis for other objects. Add the following tag to the <code>Pyovya_SnapjawMage_Snapjaw Mage</code> creature: | |||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 428: | Line 430: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Now try wishing for a <code>Pyovya_SnapjawMage_Fire Mage</code> and a <code>Pyovya_SnapjawMage_Ice Mage</code>. You should get two creatures that appear like the ones below (and they should immediately start attacking you with {{favilink|Pyrokinesis}} and {{favilink|Cryokinesis}}): | Now try wishing for a <code>Pyovya_SnapjawMage_Fire Mage</code> and a <code>Pyovya_SnapjawMage_Ice Mage</code>. You should get two creatures that appear like the ones below (and they should immediately start attacking you with {{favilink|Pyrokinesis}} and {{favilink|Cryokinesis}}!): | ||
[[File:Snapjaw_Mages_--_Fire_and_Ice.webp|700px]] | [[File:Snapjaw_Mages_--_Fire_and_Ice.webp|700px]] | ||
Line 484: | Line 486: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
We've already seen the <code>Description</code> part before. The <code>Physics</code> part is a common part used by items to determine how much they | We've already seen the <code>Description</code> part before. The <code>Physics</code> part is a common part used by items to determine how much they weigh, whether they are equipped in one or two slots, and what category they appear under in the inventory screen. Finally, the <code>Commerce</code> part defines how valuable the item is. | ||
Let's also add a tag to the item to indicate its [[tier]], as well as what [[mods]] it can accept (in our case, we don't want this item to be moddable): | Let's also add a tag to the item to indicate its [[tier]], as well as what [[mods]] it can accept (in our case, we don't want this item to be moddable): | ||
Line 493: | Line 495: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
That should be enough for our base object. Now, let's create a fire tome and an ice tome by inherting from <code>Pvovya_SnapjawMage_Magic Tome</code>. While we're at it, let's add some tiles to render each of them | That should be enough for our base object. Now, let's create a fire tome and an ice tome by inherting from <code>Pvovya_SnapjawMage_Magic Tome</code>. While we're at it, let's add some tiles to render each of them; we'll use the built-in <code>Items/sw_book_1.bmp</code> tile (which looks like a regular [[book]]). | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 512: | Line 514: | ||
=== Using existing items as a template === | === Using existing items as a template === | ||
Now, we know that we want these items to function like a {{favilink|flamethrower}} and {{favilink|freeze ray}}, but we probably need to iron out some more details first. | Now, we know that we want these items to function like a {{favilink|flamethrower}} and {{favilink|freeze ray}}, but we probably need to iron out some more details first. Such as: | ||
{| style = "margin: 1em;font-family:Source Code Pro;" | {| style = "margin: 1em;font-family:Source Code Pro;" | ||
Line 582: | Line 584: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
From this, we can see that | From this, we can see that freeze rays shoot a <code>ProjectileFreezeRay</code> object, and flamethrowers shoot a <code>ProjectileFlamethrower</code> object. | ||
To have our new items shoot these projectiles on a cooldown, we're going to add the <code>CooldownAmmoLoader</code> part. Here's how we'll add it to our {{qud text|&Ytome of &Rfire}}: | To have our new items shoot these projectiles on a cooldown, we're going to add the <code>CooldownAmmoLoader</code> part. Here's how we'll add it to our {{qud text|&Ytome of &Rfire}}: | ||
Line 645: | Line 647: | ||
|} | |} | ||
Ah, hm, yeah | Ah, hm, yeah. The projectile that a missile weapon shoots defines the damage and effects of that weapon. We just decided to use the same projectile that {{favilink|flamethrower}} and {{favilink|freeze ray}} use, which in retrospect wasn't the greatest idea. Those are both mid- to late-game items, and we want our new snapjaws to be early-game enemies. | ||
Let's fix that by creating some new projectile types that operate in the same way as <code>ProjectileFlamethrower</code> and <code>FreezeRayProjectile</code>, but are a little bit weaker. First, let's look up how these projectiles are defined in the game's data files; you can find them in (the game's version of) <code>ObjectBlueprints/Items.xml</code>. | |||
We'll copy those definitions over to our own <code>Items.xml</code> in the folder for our mod. We'll rename these projectiles <code>Pyovya_SnapjawMage_FireTomeProjectile</code> and <code>Pyovya_SnapjawMage_IceTomeProjectile</code>: | |||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 667: | Line 671: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Let's make some changes to the penetration, base damage, and temperature changes of each of these items. Here's what I set mine to, but go ahead and try tweaking these numbers to different values | Let's make some changes to the penetration, base damage, and temperature changes of each of these items. Here's what I set mine to, but go ahead and try tweaking these numbers to different values! | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
Line 685: | Line 689: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Now you | Now you should change the <code>CooldownAmmoLoader</code> part of your {{qud text|&Ytome of &Rfire}} and {{qud text|&Ytome of &Cice}} objects to use this new projectile. | ||
=== Wrapping up === | === Wrapping up === | ||
Line 746: | Line 750: | ||
There are a few different snapjaw-related population tables in the data files -- <code>SnapjawParty0</code>, <code>SnapjawParty1</code>, <code>SnapjawParty1-with-Warlord</code>, and <code>SnapjawParty2</code>. Each of these tables is used for different encounters with snapjaws. | There are a few different snapjaw-related population tables in the data files -- <code>SnapjawParty0</code>, <code>SnapjawParty1</code>, <code>SnapjawParty1-with-Warlord</code>, and <code>SnapjawParty2</code>. Each of these tables is used for different encounters with snapjaws. | ||
In your <code>Snapjaw- | In your <code>Snapjaw-Mages</code> mod folder, create a new file called <code>PopulationTables.xml</code>: | ||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> |