giffyglyph / foundry-5e-monster-maker

A D&D 5e monster maker module for the Foundry VTT. Build new monsters with level-appropriate, balanced stats in seconds.
30 stars 17 forks source link

Cannot roll Saving Throw or Ability Check from Scaled monster in new Update #65

Open Kavega opened 2 years ago

Kavega commented 2 years ago

Just informing that trying to roll an ability check, damage, or saving throw results in the error message "TypeError: roll.toMessage is not a function". However using abilities or scaled powers/attacks all work fine.

Thank you for the great module.

cmazur14 commented 2 years ago

Facing the same issue, screenshot included here:

image

ZerinaX commented 2 years ago

Also having this same issue since updating to Foundry 9.0. Love the module and use it a lot, would love to see a fix.

tposney commented 2 years ago

I believe one aspect of this is that a later version of dnd 1.5.7? introduced a change in the derived data for proficiency in prepareDerivedData

      abl.saveProf = new Proficiency(data.attributes.prof, abl.proficient);

In GMMActor this is left undefined which causes rollAbilitySave to fail when it references

    if ( abl.saveProf.hasProficiency )

As a proof of concept I copy/pasted the Proficiency class from dnd5e/module/actor/proficiency.js and added the line

    actorData.abilities[x].saveProf = new Proficiency(data.attributes.prof, false);

in GmmActor's _prepareMonsterDerivedData and saving throws worked.