Variants
When you look closely at the Shadowrun core rules, you find a lot of items that exist in variants, where the stats are different enough that it cannot be expressed using a rating. Some examples:
Bone Lacing comes in Plastic, Aluminium and Titanium
Low Light Vision exists as an accessory for cameras, contacts … or as a cybereye accessory or a bodyware for direct implant. The effect and name is the same in all cases, while availability and price differs.
Cyberarms come in Full, Half and Hand - each in obvious or synthetic quality.
Originally in Genesis each variant was modelled as a standalone item. This changed for Commlink.
Structure
<item id="main_id">
... shared attributes or attributes for default item ...
<variant id="variant_id_1">
.. attributes ...
</variant>
<variant id="variant_id_2">
.. attributes ...
</variant>
</item>
The code above defines an item with two optional variants. The user can choose a variant, but he doesn’t need to. Effectively the item comes in three versions (standard and 2 variants)
<item id="main_id" reqVariant="true">
... shared attributes or attributes for default item ...
<variant id="variant_id_1">
.. attributes ...
</variant>
<variant id="variant_id_2">
.. attributes ...
</variant>
</item>
The code above defines an item without a standard item and two variants, from which selecting one is mandatory.
Attributes
The order on which attributes are defined is
Use shortcuts of the main item
Use <attrdef> lines of the main item
Use shortcuts of the variant
Use <attrdef> lines of the variant
This means that attributes defined in a variant overwrite those of the main item. It also means that attributes shared in all variants can be defined in a main item.
Allowed elements in a variant
<variant id="mandatoryID" mode="" modonly="">
<usage />
<usage />
...
<attrdef />
<attrdef />
...
<flags>
</flags>
<alternate />
<alternate />
...
</variant>
mode
provides an additional hint for Commlink how the variant shall be treated. Allowed values are:NORMAL - Item is carried (or whatever is normal for the item)
EMBEDDED - Used as an accessory
BODYWARE - Directly implanted in the body
modonly
means that the user cannot select the item - it may be only created by modifications.
I am not sure I will keep the mode attribute. It may be sufficient to work with <usage> instead, since they express the same.
Localization of variants
You don’t need to add .page or .desc versions - if they are not present, the main items data is used.
The name of a variant is usually the name of the main item with the variant name in brackets. E.g. “Cyberarm (Full-Arm, obvious)”
Examples
Bone Lacing - different statted versions of the same item
Flare Compensation - exists as an optical accessory, as well as cyberware for capacity or karma