eldarune
November 13th, 2023, 10:57
In the AFF ruleset we have custom buttons to add armour and weapons, as they are saved under the <armour /> and <weapon /> XML nodes in db.xml. I've added GM buttons as can be seen in the attachment.
In the example of an armour item, the database will look like this:
<root version="4.4" dataversion="20230911" release="23.11|CoreRPG:6">
<armour>
<id-00001>
<damage_mod type="number">0</damage_mod>
<itemtype type="string">armour</itemtype>
<level type="number">0</level>
<name type="string">Some Armour</name>
<roll1 type="number">0</roll1>
<roll2 type="number">0</roll2>
<roll3 type="number">0</roll3>
<roll4 type="number">0</roll4>
<roll5 type="number">0</roll5>
<roll6 type="number">0</roll6>
<roll7 type="number">0</roll7>
<text type="formattedtext">
<p />
</text>
</id-00001>
</armour>
Dragging said and dropping it back into the list correctly creates a copy, but under the <item> node.
<item>
<id-00001>
<action1_value type="number">0</action1_value>
<consumable type="number">0</consumable>
<name type="string">An Item</name>
<notes type="formattedtext">
<p />
</notes>
<weight type="number">0</weight>
</id-00001>
<id-00003>
<action1_value type="number">0</action1_value>
<consumable type="number">0</consumable>
<count type="number">1</count>
<damage_mod type="number">0</damage_mod>
<itemtype type="string">armour</itemtype>
<level type="number">0</level>
<locked type="number">1</locked>
<name type="string">Some Armour (Copy)</name>
<notes type="formattedtext">
<p />
</notes>
<roll1 type="number">0</roll1>
<roll2 type="number">0</roll2>
<roll3 type="number">0</roll3>
<roll4 type="number">0</roll4>
<roll5 type="number">0</roll5>
<roll6 type="number">0</roll6>
<roll7 type="number">0</roll7>
<text type="formattedtext">
<p />
</text>
<weight type="number">0</weight>
</id-00003>
</item>
How do I tell FGU that I want the new item, one where
itemtype = "armour", that I want it copied into the
<armour />. Also, some item properties (weight, etc) are being merged as well.
I know in hindsight I should have made these sub-item types but I believe I followed one of Damned's tutorials and this is where we are :)
Thanks in advance for any insight.
Oh, and I worked out the hard way the order of strings in the aDataMap variable is important. Make sure item is first.
In the example of an armour item, the database will look like this:
<root version="4.4" dataversion="20230911" release="23.11|CoreRPG:6">
<armour>
<id-00001>
<damage_mod type="number">0</damage_mod>
<itemtype type="string">armour</itemtype>
<level type="number">0</level>
<name type="string">Some Armour</name>
<roll1 type="number">0</roll1>
<roll2 type="number">0</roll2>
<roll3 type="number">0</roll3>
<roll4 type="number">0</roll4>
<roll5 type="number">0</roll5>
<roll6 type="number">0</roll6>
<roll7 type="number">0</roll7>
<text type="formattedtext">
<p />
</text>
</id-00001>
</armour>
Dragging said and dropping it back into the list correctly creates a copy, but under the <item> node.
<item>
<id-00001>
<action1_value type="number">0</action1_value>
<consumable type="number">0</consumable>
<name type="string">An Item</name>
<notes type="formattedtext">
<p />
</notes>
<weight type="number">0</weight>
</id-00001>
<id-00003>
<action1_value type="number">0</action1_value>
<consumable type="number">0</consumable>
<count type="number">1</count>
<damage_mod type="number">0</damage_mod>
<itemtype type="string">armour</itemtype>
<level type="number">0</level>
<locked type="number">1</locked>
<name type="string">Some Armour (Copy)</name>
<notes type="formattedtext">
<p />
</notes>
<roll1 type="number">0</roll1>
<roll2 type="number">0</roll2>
<roll3 type="number">0</roll3>
<roll4 type="number">0</roll4>
<roll5 type="number">0</roll5>
<roll6 type="number">0</roll6>
<roll7 type="number">0</roll7>
<text type="formattedtext">
<p />
</text>
<weight type="number">0</weight>
</id-00003>
</item>
How do I tell FGU that I want the new item, one where
itemtype = "armour", that I want it copied into the
<armour />. Also, some item properties (weight, etc) are being merged as well.
I know in hindsight I should have made these sub-item types but I believe I followed one of Damned's tutorials and this is where we are :)
Thanks in advance for any insight.
Oh, and I worked out the hard way the order of strings in the aDataMap variable is important. Make sure item is first.