PDA

View Full Version : Weapons showing wrong type



Coanunn
January 21st, 2017, 14:56
I have created a module for my Savage Star Wars game and actually got to start play testing last night with a group of friends. Unfortunately we immediately ran into an issue, all the ranged weapons are showing up as melee in Fantasy Grounds. I checked and the XML looks right to me so I shall beg of the community to take a look and see if you spot my problem. I have included a screen shot of the entry in Fantasy Grounds as well as the XML.



<id-R001> <!-- A280 Blaster Rifle -->
<ammo>
<max type="number">10</max>
</ammo>
<armorpiercing type="number">2</armorpiercing>
<bonuslist>
</bonuslist>
<catname type="string">Ranged Weapons</catname>
<cost type="string">750</cost>
<damage type="string">2d8</damage>
<damagebonus type="number">0</damagebonus>
<damagedice type="dice">d8,d8</damagedice>
<fumble type="number">1</fumble>
<group type="string">Rifles</group>
<locked type="number">1</locked>
<minstr type="string">d8</minstr>
<name type="string">A280 Blaster Rifle</name>
<notes type="string">AP 2, Snapfire, HW, Blaster Trapping</notes>
<range type="string">50/100/200</range>
<rof type="string">1</rof>
<text type="formattedtext">
<p>These powerful blaster rifles, known for their impressive power and capable of piercing armor, were used by planetary forces across the galaxy. With their widespread use, it made them easy for the Rebel Alliance to procure on the black market to use against the forces of the Galactic Empire. They were scoped for increased accuracy. BlasTech Industries manufactured them.</p>
<p><b>Blaster:</b> Fire a bolt of compressed high energy gas particles focused through a crystal and emitted via a galven circuit. Blasters are the most common weapons in the galaxy. <u><b>Effect</b></u> - Blasters have no recoil penalty and can be used to ignite flammable liquids automatically on a hit.</p>
</text>
<traittype type="string">Ranged</traittype>
<weaponnotes type="string">AP 2; Snapfire; HW; Blaster Trapping</weaponnotes>
<weight type="number">20</weight>
<wpweight type="number">20</wpweight>
</id-R001>


17548

Doswelk
January 21st, 2017, 19:09
When creating weapons you need the following code to determine weapon type:

<type type="number">1</type> - Ranged Weapon
<type type="number">2</type> - Thrown Weapon
<type type="number">3</type> - Melee Weapon

SW defaults to melee if this is not set.

Ikael
January 21st, 2017, 19:11
Could you try out using "ranged" instead of "Ranged"?

Coanunn
January 21st, 2017, 19:40
After your posts I tried both, "ranged" and setting the type to a numerical value, starting with 1, then 2 and 3. At none of these changes altered the behavior, it still displayed only as melee for type. I then changed other weapons as well to see if there as an issue with that specific record and those failed to update as well.

Coanunn
January 21st, 2017, 20:15
As an aside when I used the item export just now making a test item it uses "Ranged" for the trait type. I have literally no clue why this is happening.


<id-00001>
<ammo>
<max type="number">5</max>
</ammo>
<armorpiercing type="number">1</armorpiercing>
<bonuslist>
</bonuslist>
<catname type="string">Weapon</catname>
<cost type="string">4</cost>
<damage type="string">2d4</damage>
<damagebonus type="number">0</damagebonus>
<damagedice type="dice">d4,d4</damagedice>
<fumble type="number">1</fumble>
<isidentified type="number">0</isidentified>
<locked type="number">1</locked>
<minstr type="string">d6</minstr>
<name type="string">test ranged weapon</name>
<notes type="string">7777777</notes>
<range type="string">1/2/3</range>
<rof type="string">2</rof>
<text type="formattedtext">
</text>
<traittype type="string">Ranged</traittype>
<weaponnotes type="string">7777777</weaponnotes>
<weight type="number">3</weight>
<wpweight type="number">3</wpweight>
</id-00001>

Mortar
January 21st, 2017, 21:01
do you have the blasters listed a Ranged Weapons table or do you have all the weapons listed on one table?

Coanunn
January 21st, 2017, 21:11
I have them all located under reference.weapons so that they show up in the sidebar. I do have a categorized list that pulls them to a page in the reference manual but it simply pulls the category "Ranged Weapons" and displays only ranged weapons.

Coanunn
January 21st, 2017, 21:37
Ok, re-entering an item from scratch I noticed doswelk used the tag <type>, while the export was using the tag <traittype>. I changed it to <type> and resolved the issue.

Mortar
January 21st, 2017, 23:52
Weird, all the conversions I have done use the <traittype> tag and work fine, so does the the SW PG mod.

Coanunn
January 22nd, 2017, 03:30
Yep, I had copied the original XML from the SW PG Mod and then verified it by exporting items created within the GUI. Regardless this resolved it so at this point I've adjusted all of the weapons in the module to use it just to make sure it continues to work properly.

Ikael
January 22nd, 2017, 04:48
Strange. The type is old way to define value and was replaced by traittype. However 3.2.2 changed something regarding it with might have caused this. I will have to check this myself

Coanunn
January 22nd, 2017, 05:49
I am still using the Test client, so perhaps something that is currently being iterated upon caused this to happen?

Ikael
January 22nd, 2017, 11:10
I checked the code and the weapon type control got broken in v3.2.2 version. For the record you should not use "type" named element which has numeric values 1,2,3 etc because that's the old way and was replaced with the "traittype" that defines type in string format. The old "type" was replaced because increasing numbers could not represent all possible weapon type cases. Not to mention that you can introduce new weapon types via ruleset API and if numbers would represent the type, some of your existing weapon types might switch around when you introduce new one. The most common case was that some settings introduced "Bomb" weapon type; settings that did not use it was using 4=Arcane, but when using that setting it as 4=Bomb,5=Arcane etc. Those two datas would got messed in your charsheets.

Anyways, use the "traittype" since it's the new approach; ruleset will be fixed to support it

Coanunn
January 22nd, 2017, 15:37
Good to know, I'll switch it back once the fix is push since this is the game we are actively playing atm.

Moon Wizard
January 23rd, 2017, 04:28
Just pushed a potential hot fix for this to the Test channel. I'm having Ikael take a look as well before I push this fix out. You're welcome to check yourself as well(just select Test mode in FG Settings, and Update).

Cheers,
JPG

Coanunn
January 23rd, 2017, 05:49
That seems to have cleared up the issue for me, thanks Moon!

Doswelk
January 24th, 2017, 23:59
I checked the code and the weapon type control got broken in v3.2.2 version. For the record you should not use "type" named element which has numeric values 1,2,3 etc because that's the old way and was replaced with the "traittype" that defines type in string format. The old "type" was replaced because increasing numbers could not represent all possible weapon type cases. Not to mention that you can introduce new weapon types via ruleset API and if numbers would represent the type, some of your existing weapon types might switch around when you introduce new one. The most common case was that some settings introduced "Bomb" weapon type; settings that did not use it was using 4=Arcane, but when using that setting it as 4=Bomb,5=Arcane etc. Those two datas would got messed in your charsheets.

Anyways, use the "traittype" since it's the new approach; ruleset will be fixed to support it

I bow to your expertise, oh master of the SW ruleset... :bandit:

Hmm I better update from Weapon/Armor/Equipment spreadsheet