Custom Weapons & Items

From Wolfire Games Wiki
Revision as of 11:37, 27 April 2018 by Silverfish (talk | contribs) (Initial version, moved here from the 3D Objects article)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

As an example, 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>

Tags

Tag Example use Description
type
<type>weapon</type>
Defines what kind of item the object is. Can be weapon, collectible or misc.
appearance
<appearance
    obj_path="Data/Objects/Weapons/MyWeapon.xml"/>
Path to the object .xml file to use as a visual representation of this item.
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).
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).
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.