User Tools

Site Tools


weapons

Weapons


A weapon is a special type of item that a character uses for attacking. When the “Equippable” button is toggled on for an item in the Item Editor, the “Weapon” button will become available. When an equippable item is configured as a weapon, it opens up several additional options which are described in more detail below.

Weapon Properties

NameDescription
TypeDetermines whether the weapon is a melee weapon or a ranged weapon. Melee weapons can only be used to attack from adjacent tiles, while ranged weapons can be used to attack from a distance.
Attack AnimationIf set, this will override the character's attack animation and play the specified animation name instead of “attack” (e.g. to play a “throw” animation for a throwing dagger).
Ammo/Energy RequiredDetermines whether or not the weapon requires ammo or energy in order to be used. Refer to the “Consumption Types” table below for a description of each option.
Projectile SpeedDetermines how fast the weapon's projectile moves, measured in voxels per second. This setting is only applicable to ranged weapons.
Minimum RangeDetermines the minimum distance (in tiles) required between the character and target entity in order to use the weapon. A value of 1 indicates that the weapon can be used from adjacent tiles. This setting is only applicable to ranged weapons.
Maximum RangeDetermines the maximum distance (in tiles) between the character and target entity from which the weapon can be used. This setting is only applicable to ranged weapons.

Consumption Types

TypeDescription
None (Unlimited Use)Weapon can be used an unlimited number of times (e.g. a sword).
None (Single Use)Weapon is consumed on use (e.g. a throwing dagger).
Items by IDWeapon consumes ammo items on use (e.g. a bow or a gun). The required ammo items are defined by one or more item IDs.
Items by TagWeapon consumes ammo items on use (e.g. a bow or a gun). The required ammo items are defined by one or more item tags.

Projectiles

In order for a ranged weapon to generate a visual projectile when used (e.g. an arrow, bullet, spinning dagger, etc.), you will need to make use of the “Object Model” item property found below the equippable/weapon settings.

Since projectiles are objects, their “default” animation will be played upon entering the scene, if one exists. This can be used, for example, to make a throwing dagger spin as it moves towards its target. To achieve this, you would simply create a spinning animation for the dagger named “default” and assign it to the “Object Model” property of your weapon (or ammo item if setting up a ranged weapon that consumes ammo).

(Info about “projectile” attach point to determine where and when the projectile's model will appears during the character's attack animation)

Setting Up a Ranged Weapon

- Enable “Equippable”

- Enable “Weapon”

- Set weapon type to “Ranged”

- Assign object model to weapon (or ammo item(s) if weapon consumes ammo)

- Create custom attack animation for character

- Create “projectile” attach point on a frame of character's attack animation

weapons.txt · Last modified: 2021/10/17 19:43 by justin