PDA

View Full Version : Trouble Finding Where AC and Initiative Are Calculated (5E)



oxymoronking
October 14th, 2022, 19:33
Hello all, I have been struggling with a small extension I am making for a very homebrewed campaign. The short of it is that I added a Ability Score, and I am trying to get AC and Initiative to calculate off of it instead of DEX. Could anyone point me in the right direction of what files I need to mess with?

Moon Wizard
October 14th, 2022, 20:02
You posted in the FG Classic support forum; so not sure if you meant to post in FG Unity (latest builds).

If FG Classic, I don't have an easy way to review the older code or answer the question.

If FG Unity, there are a few different places where I found dexterity mentioned that looked like it applied:

Templates: number_chartotalac; number_charinit
Window Control: charsheet_combatcalc:initdexbonus
Global Scripts: ActionInit.getEffectAdjustments, ActorManager5E.getDefenseValue, CombatManager2.onNPCPostAdd, CombatManager2.onVehiclePostAdd

There also might be some other field links to track when adding an ability score, but you'd have to look all over for where ability scores are referenced to match.
If the new ability score is PC only, you can avoid modifying the NPC/vehicle specific scripts, but you'll need to be more careful editing the others not to affect non-PCs.

Regards,
JPG

oxymoronking
October 15th, 2022, 00:20
Thank you so much!