PDA

View Full Version : Assistance with PFSRD - coding question



Elaith
October 21st, 2019, 22:45
Hello,

I am trying to auto populate a character sheet with a classes weapon/armor proficiencies. It has been working great, however I have run into a problem with getting a rarer weapon to be added.

The code:


<weaponandarmorproficiency>
<level type="number">1</level>
<name type="string">Weapon and Armor Proficiency</name>
<text type="formattedtext">
<p>Investigators are proficient with all simple weapons, plus the hand crossbow, rapier, sap, shortbow, short sword, and sword cane. They are proficient with light armor, but not with shields. </p>
</text>
</weaponandarmorproficiency>

All the weapons/armor appear correctly, except the sword cane item.

The weapon is defined, along with the others, so that does not seem to be the issue.

Anyone know what function might control what is added as a proficiency?

Or do I need to create a function to add new items to auto-populate? If that is the case, can anyone point me towards some example code to get me an idea of what is needed.

Thanks,

-Elaith

Trenloe
October 21st, 2019, 22:58
Look at the function handleProficiencies in the 3.5E ruleset, campaign\scripts\manager_char.lua file. This looks for various weapon names to identify proficiencies.

Elaith
October 21st, 2019, 23:11
Ah, thank you so much. Was driving me crazy. Now I just need to figure out how to override the normal function to add the new items. But thank you for pointing me at exactly what I was looking for.

Trenloe
October 21st, 2019, 23:33
Now I just need to figure out how to override the normal function to add the new items.
It's part of the CharManager global script package. So you can override just that handleProficiencies function in an extension, using CharManager.handleProficiencies = <your new function> which will completely replace the base function.

Elaith
October 22nd, 2019, 00:35
Thanks so much Trenloe, I was able to get it figured out. Just needed to be pointed at the correct file.