-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create effects using Ability Modifiers (and others) #172
Comments
I'm fixing this right now. Also fixing several minor things. Docuemnting it here for the PR as I go along: Ability modifier calculations moved into a separate method that is called by prepareData and prepareChatData. This does not cause an infinite loop. added the shortcut @xmod variables from power replacer to actors getChatDa\ta mewthod so they work in effects created several new @variables: All class features have had their number of surges calculationc hanged from maths, which was javascript, and therefore wrong, to @Conmod. Javascript type system strikes again, so if your conmod was actually x.5 the maths showed the 0.5 because javascript tries to be helpful and converts integer division into a float for you. This is why I hate javascript. It is a silly language. All class feature effects for HP changed from "add" to "override" otherwise, because auto calc hp fields are saved with the character, adding features to a character who has ever poked autocalc is both hilarious and very wrong, leading to characters with 10000HP. Dragonborn racial fixed #166 I know humans suck, but not giving them their racial defence bonus was really mean. Think of all the poor humans who have died for the lack of +1 ref! When entering all the SRD weapons, I somehow missed the "2 handed" weapon property, which is a bummer because that's what the example fighter class feature uses! Added that. I ahve now fallen down a rabbit hole regarding high crit weapons and that the critBonusField can't have a nested formula. |
Discovered that foundry dice formula sometimes does not put formula back in the right shape. A few spaces missing here and there |
High crit weapons fixed to have their extra damage dice referred to via variables so they just always work. |
Basic attacks adjusted to use @Epic for their damage formula |
@powmax updated to process formula in the base weapon damage correctly, like @powDamage |
Actor ChatData for Effects SRD Compendium fixes Example Compendium fixes I feel down a formula hole and couldn't get out
Actor ChatData for Effects SRD Compendium fixes Example Compendium fixes I feel down a formula hole and couldn't get out
Closed in 0.2.63 |
Blame a chap on discord for leading me down this rabbit hole.
Creating an effect that uses an @variable, e.g.
@details.tier
That works fine. And so does
@abilities.str.value
However the more likely use
@abilities.str.mod
does not.I tracked this down. The replacer (apply function in dnd4eBeta.js) calls
owner.getRollData()
That we have an override that is kinda pointless, but was very good for debugging. When this is called, the actor is in a "pristine" state -prepareData()
has not been run, therefore it does not have any mod values, as they are dynamically computed - it only has data that is saved (e.g. stuff that is in the template). the only available strength values are the value, and the text for a roll.This will apply I think to any value that is dynamically calculated rather than stored.
The solution to this is definitely not to call
prepareData()
in the getRollData() method, as that causes an infinite loop.The text was updated successfully, but these errors were encountered: