Difference between revisions of "Custom Weapons & Items"

From Wolfire Games Wiki
Jump to: navigation, search
(Added an introduction and an overview heading)
(Rewrote some things and added a coulpe of todos)
 
Line 1: Line 1:
This article tells you how weapons and items in Overgrowth are built. After reading it you should be well on your way to creating your own.
+
This article tells you how items in Overgrowth are built. Here the word "item" is being used as a technical term for an object that can be picked up by a character. The most common and most advanced use case for items in Overgrowth is to create weapons with them, so that's what this article focuses on. Whenever the words "weapon xml" is used, we're talking about an item xml file configured as a weapon.
  
 
== Overview ==
 
== Overview ==
Items are things that a character can pick up in the game, a large part of the items in the game are weapons. An item .xml file is needed to make an object into an item. The item .xml files that come with the game can be found in ../Overgrowth/Data/Items/. Items are picked up by their center point.  
+
An item xml file is the file you load in the editor to spawn an item, such as a weapon. The item xml files that come with the game can be found in ../Overgrowth/Data/Items/.
  
As an example, here is the item .xml file for the flint_knife weapon that comes with the game:
+
== Weapon XML Details ==
 +
So what does a weapon xml file look like? Here is the item xml file for the flint_knife weapon that comes with the game:
 
<pre>
 
<pre>
 
<?xml version="1.0" ?>
 
<?xml version="1.0" ?>
Line 12: Line 13:
 
     <grip ik_attach = "rightarm"
 
     <grip ik_attach = "rightarm"
 
           anim = "Data/Animations/r_dogweapongrip.anm"
 
           anim = "Data/Animations/r_dogweapongrip.anm"
  hands = "1"/>
+
          hands = "1"/>
 
     <sheathe ik_attach = "hip"
 
     <sheathe ik_attach = "hip"
 
           anim = "Data/Animations/r_dogweaponsheathed.anm"/>
 
           anim = "Data/Animations/r_dogweaponsheathed.anm"/>
Line 36: Line 37:
 
</pre>
 
</pre>
  
===Tags===
+
Let's go through what each tag in this file does:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 50: Line 51:
 
<pre><appearance
 
<pre><appearance
 
     obj_path="Data/Objects/Weapons/MyWeapon.xml"/></pre>
 
     obj_path="Data/Objects/Weapons/MyWeapon.xml"/></pre>
|| Path to the object .xml file to use as a visual representation of this item.
+
|| Path to the object xml file to use as a visual representation of this item. To find out how to make one of these, read the [[3D_Objects]] article.
 
|-
 
|-
 
! grip
 
! grip
Line 57: Line 58:
 
     ik_attach="rightarm"
 
     ik_attach="rightarm"
 
     anim="Data/Animations/r_dogweapongrip.anm"/></pre>
 
     anim="Data/Animations/r_dogweapongrip.anm"/></pre>
|| ik_attach defines what bone the object is attached to when it's held. Anim is the place where the weapon will be held at. You create these in blender using one of the existing rigs that comes with the game (preferably the rabbit_rig).  
+
|| ik_attach defines what bone the object is attached to when it's held. Anim is the place where the weapon will be held at. You create these in blender using one of the existing rigs that comes with the game (preferably the rabbit_rig). '''TODO:''' Check if "Anim is the place where the weapon will be held at" is correct
 
|-
 
|-
 
! sheathe
 
! sheathe
Line 64: Line 65:
 
     ik_attach="hip"
 
     ik_attach="hip"
 
     anim="Data/Animations/r_dogweaponsheathed.anm"/></pre>
 
     anim="Data/Animations/r_dogweaponsheathed.anm"/></pre>
|| ik_attach defines where to attach the object when sheathed. Anim is the place where the weapon will be sheathed at. You create these in Blender using one of the existing rigs that the game comes with (preferably the rabbit_rig).
+
|| ik_attach defines where to attach the object when sheathed. Anim is the place where the weapon will be sheathed at. You create these in Blender using one of the existing rigs that the game comes with (preferably the rabbit_rig). '''TODO:''' Check if "Anim is the place where the weapon will be sheathed at" is correct
 
|-
 
|-
 
! physics
 
! physics

Latest revision as of 14:46, 17 May 2018

This article tells you how items in Overgrowth are built. Here the word "item" is being used as a technical term for an object that can be picked up by a character. The most common and most advanced use case for items in Overgrowth is to create weapons with them, so that's what this article focuses on. Whenever the words "weapon xml" is used, we're talking about an item xml file configured as a weapon.

Overview

An item xml file is the file you load in the editor to spawn an item, such as a weapon. The item xml files that come with the game can be found in ../Overgrowth/Data/Items/.

Weapon XML Details

So what does a weapon xml file look like? Here is the item xml file for the flint_knife weapon that comes with the game:

<?xml version="1.0" ?>
<item>
    <type>weapon</type>
    <appearance obj_path = "Data/Objects/Weapons/flint_knife.xml"/>
    <grip ik_attach = "rightarm"
          anim = "Data/Animations/r_dogweapongrip.anm"
          hands = "1"/>
    <sheathe ik_attach = "hip"
          anim = "Data/Animations/r_dogweaponsheathed.anm"/>
    <physics mass = "0.4 kg"/>
    <points>
        <pommel x="0" y="-0.081" z="0"/>
        <guard x="0" y="0.10" z="0"/>
        <tip x="0" y="0.33" z="0"/>
    </points>
    <label>knife</label>
    <lines>
        <wood start="pommel" end="guard"/>
        <metal start="guard" end="tip"/>
    </lines>
    <anim_override idle = "Data/Animations/r_knifestancerear.xml"
                   movement = "Data/Animations/r_weaponmovestance.xml"/>
    <attack_override moving = "Data/Attacks/knifeslash.xml"
                     moving_close = "Data/Attacks/knifeslash.xml"
                     stationary = "Data/Attacks/knifeslash.xml"
                     stationary_close = "Data/Attacks/knifeslash.xml"/>
    <range multiply = "0.8"/>
</item>

Let's go through what each tag in this file does:

Tag Example use Description
type
<type>weapon</type>
Defines what kind of item the object is. Can be weapon, collectible or misc. TODO: What does each type do?
appearance
<appearance
    obj_path="Data/Objects/Weapons/MyWeapon.xml"/>
Path to the object xml file to use as a visual representation of this item. To find out how to make one of these, read the 3D_Objects article.
grip
<grip
    ik_attach="rightarm"
    anim="Data/Animations/r_dogweapongrip.anm"/>
ik_attach defines what bone the object is attached to when it's held. Anim is the place where the weapon will be held at. You create these in blender using one of the existing rigs that comes with the game (preferably the rabbit_rig). TODO: Check if "Anim is the place where the weapon will be held at" is correct
sheathe
<sheathe
    ik_attach="hip"
    anim="Data/Animations/r_dogweaponsheathed.anm"/>
ik_attach defines where to attach the object when sheathed. Anim is the place where the weapon will be sheathed at. You create these in Blender using one of the existing rigs that the game comes with (preferably the rabbit_rig). TODO: Check if "Anim is the place where the weapon will be sheathed at" is correct
physics
<physics mass="1 kg"/>
Changes the pitch of the sound made by the object hitting things. Also changes how overall heavy it is.
points
<points>
    <pommel x="0" y="-0.081" z="0"/>
    <guard x="0" y="0.10" z="0"/>
    <tip x="0" y="0.33" z="0"/>
</points>
Defines a number of points on the weapon that can be used with the lines element to define what material a part of the weapon has.
lines
<lines>
    <wood start="pommel" end="guard"/>
    <metal start="guard" end="tip"/>
</lines>
Defines what materials go between what points that are defined in the points tag.
anim_blend
<anim_blend
    idle = "Data/Animations/r_bigdogsword.xml"/>
Override the animation for part of a character holding the item. Animation keywords that can be overridden are idle and movement. This is used for for instance two handed weapons, spears and so on, where the default animations don't fit.
anim_override
<anim_override
    idle="Data/Animations/r_weaponidlestance.xml"/>
Overrides animations of a character holding the item. Animation keywords that can be overridden are idle, movement, medleftblock, medrightblock, blockflinch and more.

(See Custom Characters: File 3 for the keywords.) This is used for for instance two handed weapons, spears and so on, where the default animations don't fit.

attack_override
<attack_override
    moving="Data/Attacks/knifeslash.xml"
    moving_close="Data/Attacks/knifeslash.xml"
    stationary="Data/Attacks/knifeslash.xml"
    stationary_close="Data/Attacks/knifeslash.xml"/>
What attacks should be used with this weapon in different contexts.
range
<range multiply="0.8"/>
Multiply multiplies the range with the specified value to make a weapon reach further or shorter.