User:Kernelmethod/Sandbox: Difference between revisions

Create initial sketch of the Snapjaw Wizards tutorial.
 
Add some more content to the new tutorial.
Line 14: Line 14:
| style = "padding:0em 1em;"| [[File:Mopango_pilgrim.png|40px]]
| style = "padding:0em 1em;"| [[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;" | I'm excited!
|}
|}
By the end of this tutorial, you'll have created a new mod which
* introduces two new creatures, the {{qud text|snapjaw wizard of &Rfire}} and the {{qud text|snapjaw wizard of &Cice}}, and
* introduces two books that function as missile weapons, the {{qud text|tome of &Rfire}} and the {{qud text|tome of &Cice}}.


== Getting started ==
== Getting started ==
Line 119: Line 124:
   <object Name="Pyovya_SnapjawWizard_Snapjaw Wizard" Inherits="Snapjaw">
   <object Name="Pyovya_SnapjawWizard_Snapjaw Wizard" Inherits="Snapjaw">
     <part Name="Description" Short="A great hero of the snapjaws." />
     <part Name="Description" Short="A great hero of the snapjaws." />
     <part Name="Render" DisplayName="snapjaw wizard" Tile="Assets_Content_Textures_Creatures_sw_snapjaw_warrior.bmp" ColorString="&amp;Y" DetailColor="R" />
     <part Name="Render" DisplayName="snapjaw wizard" Tile="Assets_Content_Textures_Creatures_sw_snapjaw_warrior.bmp" ColorString="&amp;O" DetailColor="Y" />
   </object>
   </object>
</objects>
</objects>
Line 150: Line 155:
** <code>DisplayName</code>: how the creature's name is displayed in-game.
** <code>DisplayName</code>: how the creature's name is displayed in-game.
** <code>Tile</code>: a .png or .bmp ("bitmap") image that's used to display the creature. Check out [[Modding:Tiles]] for more information. In the snippet above, I just used the tile for {{favilink|snapjaw warrior|plural}} to get us started.
** <code>Tile</code>: a .png or .bmp ("bitmap") image that's used to display the creature. Check out [[Modding:Tiles]] for more information. In the snippet above, I just used the tile for {{favilink|snapjaw warrior|plural}} to get us started.
** <code>ColorString</code> and <code>DetailColor</code>: these are the primary and secondary colors used to color in the tile that you supply. You can look at [[Modding:Colors & Object Rendering]] for a full list of all of the available colors; in this case, we used <code>Y</code> (white) as the primary color and <code>M</code> (magenta) as the detail color.
** <code>ColorString</code> and <code>DetailColor</code>: these are the primary and secondary colors used to color in the tile that you supply. You can look at [[Modding:Colors & Object Rendering]] for a full list of all of the available colors; in this case, we used <code>O</code> (orange) as the primary color and <code>Y</code> (white) as the detail color.


=== Using custom tiles ===
=== Using custom tiles ===
Line 182: Line 187:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<part Name="Render" DisplayName="snapjaw wizard" Tile="Pyovya_Snapjaw/snapjaw_wizard.png" ColorString="&amp;Y" DetailColor="R" />
<part Name="Render" DisplayName="snapjaw wizard" Tile="Pyovya_Snapjaw/snapjaw_wizard.png" ColorString="&amp;O" DetailColor="Y" />
</syntaxhighlight>
</syntaxhighlight>


Line 189: Line 194:
IMAGE
IMAGE


Cool!
Cool! Now let's fill out some more details about our new creature.


=== Filling out your new creature ===
=== Adding inventory ===


Let's keep adding some more stuff to our snapjaw wizard to round them out a bit more. First of all, like any good wizard, they need a {{favilink|walking stick}} and some [[book|books]]. Let's give them some clothes to equip while we're at it. Add the following XML to your creature:
We'll keep adding stuff to our snapjaw wizard to round them out a bit more. First of all, like any good wizard, they need a {{favilink|walking stick}} and some [[book|books]]. Let's give them some clothes to equip while we're at it. Add the following XML to your creature:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<inventoryobject Blueprint="Walking Stick" />
<inventoryobject Blueprint="Walking Stick" Number="1" />
<inventoryobject Blueprint="Woven Tunic" Number="1" />
<inventoryobject Blueprint="Woven Tunic" Number="1" />
<inventoryobject Blueprint="Sandals" Number="1" />
<inventoryobject Blueprint="Sandals" Number="1" />
<inventoryobject Blueprint="StandaloneMarkovBook" Number="2-3" />
<inventoryobject Blueprint="StandaloneMarkovBook" Number="1-2" Chance="10" />
</syntaxhighlight>
</syntaxhighlight>
By setting <code>Number="1-2"</code> and <code>Chance="10"</code> in that last line, we've given our wizards a 10% chance of holding 1-2 books when they spawn.
=== Adding skills ===


Let's give our wizard the [[Cudgel]] skill as well, so that they're a little bit better at fighting with that walking stick:
Let's give our wizard the [[Cudgel]] skill as well, so that they're a little bit better at fighting with that walking stick:
Line 208: Line 217:
</syntaxhighlight>
</syntaxhighlight>


TODO: stats
=== Changing stats ===
 
The base <code>Snapjaw</code> creature that we're inheriting from has really low stats, so we're going to bump up our wizard's stats a little.
 
<syntaxhighlight lang="xml">
<stat Name="Hitpoints" Value="15" />
<stat Name="DV" Value="4" />
 
<!-- Raise ego to make the wizard's mental mutations a little more powerful -->
<stat Name="Ego" Value="17" />
 
<!-- Raise willpower to reduce the cooldowns of abilities -->
<stat Name="Willpower" Value="17" />
</syntaxhighlight>
 
=== Minor details ===


TODO
TODO
Line 221: Line 245:
<tag Name="DynamicObjectsTable:Snapjaws" />
<tag Name="DynamicObjectsTable:Snapjaws" />
<tag Name="AggregateWith" Value="Pyovya_SnapjawWizard_Snapjaw Wizard" />
<tag Name="AggregateWith" Value="Pyovya_SnapjawWizard_Snapjaw Wizard" />
<tag Name="BaseObject" Value="*noinherit" />
</syntaxhighlight>
</syntaxhighlight>


FINAL VERSION OF CREATURE XML BEFORE GOING TO THE NEXT SECTION
FINAL VERSION OF CREATURE XML BEFORE GOING TO THE NEXT SECTION


=== Using your creature as a base: Elemental Wizards ===
== Using your creature as a base: Elemental Wizards ==


{| style = "margin: 1em;font-family:Source Code Pro;"
{| style = "margin: 1em;font-family:Source Code Pro;"
Line 237: Line 260:


So far, we've sketched out most of the properties, skills, and stats that a snapjaw wizard should have. Now we're going to create two types of wizards: '''''fire wizards''''' and '''''ice wizards'''''. Under your definition of the <code>Pyovya_SnapjawWizard_Snapjaw Wizard</code> creature in <code>Creatures.xml</code>, add two new creatures:
So far, we've sketched out most of the properties, skills, and stats that a snapjaw wizard should have. Now we're going to create two types of wizards: '''''fire wizards''''' and '''''ice wizards'''''. Under your definition of the <code>Pyovya_SnapjawWizard_Snapjaw Wizard</code> creature in <code>Creatures.xml</code>, add two new creatures:
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8" ?>
<objects>
  <object Name="Pyovya_SnapjawWizard_Snapjaw Wizard" Inherits="Snapjaw">
    <!-- All of the stuff that you added in the previous section... -->
    <tag Name="BaseObject" Value="*noinherit" />
  </object>
</objects>
</syntaxhighlight>
TODO


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
Line 245: Line 280:
   -->
   -->


   <object Name="Pyovya_SnapjawWizard_Flame Wizard" Inherits="Pyovya_SnapjawWizard_Snapjaw Wizard">
   <object Name="Pyovya_SnapjawWizard_Fire Wizard" Inherits="Pyovya_SnapjawWizard_Snapjaw Wizard">
   </object>
   </object>


Line 253: Line 288:
</syntaxhighlight>
</syntaxhighlight>


Referencing the [[Modding:Colors & Object Rendering]] page, we're going to change our fire wizard's detail color to red. We're also going to give them the {{favilink|Flaming Ray}} mutation:
Notice how we've used the <code>Inherits</code> attribute here. We're using our original snapjaw wizard creature, <code>Pyovya_SnapjawWizard_Snapjaw Wizard</code>, as a base for our fire and ice wizards. As a result, our new creatures will spawn with walking sticks, have the [[Cudgel]] skill, and so on.
 
Referencing the [[Modding:Colors & Object Rendering]] page, we're going to change our fire wizards' detail color to red. We're also going to give them the {{favilink|Pyrokinesis}} mutation:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<object Name="Pyovya_SnapjawWizard_Flame Wizard" Inherits="Pyovya_SnapjawWizard_Snapjaw Wizard">
<object Name="Pyovya_SnapjawWizard_Fire Wizard" Inherits="Pyovya_SnapjawWizard_Fire Wizard">
   <part Name="Render" DisplayName="snapjaw wizard of {{R|fire}}" Tile="Pyovya_SnapjawWizard/snapjaw_wizard.png" ColorString="&amp;Y" DetailColor="R" />
   <part Name="Render" DisplayName="snapjaw wizard of {{R|fire}}" Tile="Pyovya_SnapjawWizard/snapjaw_wizard.png" ColorString="&amp;O" DetailColor="R" />
   <mutation Name="FlamingHands" Level="1" BodyPartType="Hands" CreateObject="false" />
   <mutation Name="Pyrokinesis" Level="1" />
</object>
</object>
</syntaxhighlight>
</syntaxhighlight>
Line 265: Line 302:


TODO: explain what's going on in the <code><mutation></code> tag.
TODO: explain what's going on in the <code><mutation></code> tag.
Now we'll make some similar changes to our ice wizards: we'll change their detail color to cyan, and give them the {{favilink|Cryokinesis}} mutation.


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<object Name="Pyovya_SnapjawWizard_Ice Wizard" Inherits="Pyovya_SnapjawWizard_Snapjaw Wizard">
<object Name="Pyovya_SnapjawWizard_Ice Wizard" Inherits="Pyovya_SnapjawWizard_Ice Wizard">
   <part Name="Render" DisplayName="snapjaw wizard of {{C|ice}}" Tile="Pyovya_SnapjawWizard/snapjaw_wizard.png" ColorString="&amp;Y" DetailColor="R" />
   <part Name="Render" DisplayName="snapjaw wizard of {{C|ice}}" Tile="Pyovya_SnapjawWizard/snapjaw_wizard.png" ColorString="&amp;O" DetailColor="C" />
   <mutation Name="FreezingHands" Level="1" BodyPartType="Hands" CreateObject="false" />
   <mutation Name="Cryokinesis" Level="1" />
</object>
</object>
</syntaxhighlight>
</syntaxhighlight>
Line 276: Line 315:
* Inherit from the Snapjaw Hero
* Inherit from the Snapjaw Hero
* Add mutations, change colors
* Add mutations, change colors
== Creating new items ==
TODO: magical tome of fire + magical tome of ice
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8" ?>
<objects>
  <!-- Weapons -->
  <object Name="Pvovya_SnapjawWizard_Magic Tome" Inherits="BaseMissileWeapon">
    <part Name="Description" Short="A magical tome." />
    <part Name="Physics" Weight="1" UsesTwoSlots="true" Category="Missile Weapon" />
    <part Name="Commerce" Value="200" />
    <tag Name="Tier" Value="2" />
    <tag Name="BaseObject" Value="*noinherit" />
  </object>
  <object Name="Pvovya_SnapjawWizard_Fire Tome" Inherits="Pvovya_SnapjawWizard_Magic Tome">
    <part Name="Render" DisplayName="tome of {{R|fire}}" Tile="Items/sw_book_1.bmp" ColorString="&amp;R" DetailColor="Y" />
    <part Name="MissileWeapon" Skill="Rifle" AmmoChar="f" ShotsPerAction="1" AmmoPerAction="1" ShotsPerAnimation="1" WeaponAccuracy="0" />
    <part Name="CooldownAmmoLoader" Cooldown="10" Readout="true" ProjectileObject="Pvovya_SnapjawWizard_FireTomeProjectile" />
    <tag Name="MissileFireSound" Value="flamethrower" />
    <stag Name="Heat" />
  </object>
  <object Name="Pvovya_SnapjawWizard_Ice Tome" Inherits="Pvovya_SnapjawWizard_Magic Tome">
    <part Name="Render" DisplayName="tome of {{C|ice}}" Tile="Items/sw_book_1.bmp" ColorString="&amp;C" DetailColor="Y" />
    <part Name="MissileWeapon" Skill="Rifle" AmmoChar="FR" ShotsPerAction="1" AmmoPerAction="1" ShotsPerAnimation="1" WeaponAccuracy="0" />
    <part Name="CooldownAmmoLoader" Cooldown="10" Readout="true" ProjectileObject="Pvovya_SnapjawWizard_IceTomeProjectile" />
    <tag Name="MissileFireSound" Value="hiss_low" />
    <stag Name="Cold" />
  </object>
  <!-- Projectiles -->
  <object Name="Pvovya_SnapjawWizard_FireTomeProjectile" Inherits="TemporaryProjectile">
    <part Name="Render" DisplayName="{{R|stream of flame}}" ColorString="&amp;R" />
    <part Name="Projectile" BasePenetration="8" BaseDamage="1d2" Attributes="Heat Fire" ColorString="&amp;R" PassByVerb="whoosh" />
    <part Name="TemperatureOnHit" Amount="4d20" Max="false" OnWielderHit="true" />
    <part Name="TemperatureOnEntering" Amount="8d20" Max="false" OnWielderHit="true" />
  </object>
  <object Name="Pvovya_SnapjawWizard_IceTomeProjectile" Inherits="TemporaryProjectile">
    <part Name="Render" DisplayName="{{C|streak of ice}}" ColorString="&amp;B" />
    <part Name="Projectile" BasePenetration="4" BaseDamage="1d4" Attributes="Cold NonPenetrating" ColorString="&amp;B" PassByVerb="crackle" />
    <part Name="TemperatureOnHit" Amount="-4d20" Max="false" OnWielderHit="true" />
    <part Name="TemperatureOnEntering" Amount="-8d20" Max="false" OnWielderHit="true" />
  </object>
</objects>
</syntaxhighlight>
== Going forward ==
Congrats! You reached the end of the tutorial!
{| 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;" | Woohoo!
|}
{| style = "margin: 1em;font-family:Source Code Pro;"
| style = "padding:0em 1em;"| [[File:Sprouting orb.png|40px]]
| style= "color:#155352" | <
| style = "border:1px solid #155352;padding:0.5em 1em;" | I'm ready to go face these wizards in magical combat.
|}
=== Extra challenge ===
Before you go, here's a little challenge that you can use to test what you've learned so far. We now have wizards of fire and ice; now, try creating a new {{qud text|snapjaw wizard of &Welectricity}}, along with a {{qud text|tome of &Welectricity}} that shoots electric projectiles. You're free to go about this however you wish, but here are some general pointers:
* You'll probably want to give your new wizard the {{favilink|Electrical Generation}} mutation.
* When you're creating your {{qud text|tome of &Welectricity}}, start by having it shoot <code>ProjectileElectroPistol</code>; this is the projectile that is shot by an {{favilink|arc winder}}. Once you're ready, create your own version of this projectile by referring to how <code>ProjectileElectroPistol</code> is implemented in the game's version of <code>ObjectBlueprints/Items.xml</code>.


[[Category:Guides]]
[[Category:Guides]]