/
Alternate Usages

Alternate Usages

Sometimes an item can be used in more than one way. Buy a firearm, but also use it as a close combat weapon. To express this, the <alternate> element was introduced.

<item id="yamaha_pulsar_2" avail="1" price="350" type="WEAPON_FIREARMS" subtype="TASERS"> <modifications> <itemmod type="HOOK" ref="TOP" /> </modifications> <weapon dmg="4S(e)" attack="9,9,,," mode="SS" ammo="4(m)" skill="firearms" spec="firearms/tasers" /> <alternate mode="WEAPON" type="WEAPON_CLOSE_COMBAT" subtype="CLUBS"> <weapon dmg="3S" attack="6,,,," skill="close_combat" spec="close_combat/clubs"/> </alternate> </item>

The code above defines the firearm “Yamaha Pulsar 2” which should also show up as a close combat weapon, with totally different weapon stats.

<alternate> can have <attrdef> (and shortcuts), <usage> and <flags> elements. It also defines three attributes:

  • type - shortcut to define an ItemType

  • subtype - shortcut to define an ItemSubType

  • mode - hint how the item shall be used (PRIMARY (means carried), WEAPON, ARMOR or VEHICLE)

 

Related content

XML for gear
XML for gear
More like this
Flags
More like this
Variants
Variants
More like this
Basics
Basics
More like this
Usage
More like this