Rolling Hooks
Rolling Hooks!
I am working on a couple of additions to one of the upcoming version of 5e to add hooks to all of the system's rolling functions with the intention of allowing modules to fully customize these systems without having to wrap any methods. I welcome an eye on this from any module developers who work on modules that modify or respond to rolling behavior in 5e. Here are the three PRs with the changes:
https://github.com/foundryvtt/dnd5e/pull/1670
https://github.com/foundryvtt/dnd5e/pull/1662
https://github.com/foundryvtt/dnd5e/pull/1671
GitHub
[#1002] Add hooks to
Actor5e
rolling methods by arbron · Pull Req...Adds a number of hooks to the actor rolling process to allow modules to better customize rolling without having to override or wrap system methods:
dnd5e.preRollSkill & dnd5e.rollSkill
dnd5e.p...
GitHub
[#1002] Add hooks to
Item5e#roll
& Item5e#displayCard
to allow ...Adds a number of hooks to the item rolling process to allow modules to better customize that workflow without having to override or wrap system methods:
dnd5e.preRoll: Called before the item is co...
GitHub
[#1002] Add hooks to
Item5e
rolling methods by arbron · Pull Requ...Add hooks to the specific item rolling methods not covered by #1662.
dnd5e.preRollAttack, dnd5e.rollAttack
dnd5e.preRollDamage, dnd5e.rollDamage
dnd5e.preRollFormula, dnd5e.rollFormula
dnd5e.preRo...
C
Calego•641d ago
Giving things a look as I can, probably can't actually test these but I can at least point things out in the PRs
E
enso•641d ago
those rollAttack/Damage hooks are a godsend for Multiattack 5e
Z
Zhell•636d ago
and the Item#roll hook is a godsend for concentration tracking instead of reading the chatlog. I can do so much less filtering.
Isn't this also the perfect opportunity to add more options to
Item#roll
and items' measuredTemplates?A
arbron•636d ago
What specifically were you thinking?
Z
Zhell•636d ago
https://github.com/foundryvtt/dnd5e/issues/1543 for roll options.
For templates, I still don't think they have any flags or other data identifying the item that created them?
I could kiss you
A
arbron•636d ago
Well, the first one was easy enough
😮
Is there an issue for adding an origin flag to templates? If not, why not throw one up so I have something to point to 😇
Z
Zhell•636d ago
Will check (and if not, will do).
A
arbron•636d ago
Whelp, it seems like
MeasuredTemplateDocument
doesn't like getting passed flags
But you can set them after it is created, odd
Hmm, it doesn't accept a flattened key for some reasonZ
Zhell•636d ago
Is the issue in the dnd5e-specific method? Creating a template directly on the canvas with templateData can definitely accept a flag
https://github.com/foundryvtt/dnd5e/issues/1677
A
arbron•636d ago
We are calling
new MeasuredTemplateDocument(tempateData)
, so I'm not sure what the issue might be
Looks like the constructor doesn't take flattened objects, but the create
method does
Such a complex change, hours of work: https://github.com/foundryvtt/dnd5e/pull/1662/commits/c48d6874873c4c85f2c3702e8f4810ea996e7663Z
Zhell•636d ago
👏
I have many plans for this.
Speaking of hooks, and I know this could be straying off topic, but are there pre-rest hooks or (pre)-hitDieRoll hooks? 🤔
A
arbron•636d ago
The hit die ones are in another PR: https://github.com/foundryvtt/dnd5e/pull/1670
GitHub
[#1002] Add hooks to
Actor5e
rolling methods by arbron · Pull Req...Adds a number of hooks to the actor rolling process to allow modules to better customize rolling without having to override or wrap system methods:
dnd5e.preRollSkill & dnd5e.rollSkill
dnd5e.p...
A
arbron•636d ago
No pre rest hook at the moment, but it could be added
Z
Zhell•636d ago
I can imagine that to be useful. Cursed to not gain spell slots back. Idk. I'll think of something.
should I log an issue?
A
arbron•636d ago
Sure, that will remind me
C
Calego•636d ago
this has some minor problems same as chatMessages which outlive their consumable items.
scroll of fireball for instance
speaking of wishlists, idk if you've already done this or not but including the spellLevel as a flag on the created chatcard is a very useful thing, so consumers (including the system itself) don't have to parse the DOM to get the spell level of an upcast spell (when rolling damage)
that's probably a different task though
Z
Zhell•636d ago
https://github.com/foundryvtt/dnd5e/issues/1678
"preRestCompleted" seems like a strange name...
UU
Unknown User•634d ago
W
Wasp•632d ago
A bit late to the party, but THANK GOD for the
preRollHitDie
additions, this will make my life so much easier in Rest Recovery ❤️A
arbron•628d ago
Hooks have been merged! Hopefully there will be a new alpha branch soon so everyone can start testing them 🙂
Z
Zhell•628d ago
👏
Want results from more Discord servers?
More PostsWeight MRSure.2.0.0 explorationFrom Atropos in the mothership (in v10 Feedback)
> Hello folks, for those of you testing V10 using tElectron ViteIt loads at least.early v10 compat testing@dnd5e - No action required
Work is being done on fixing the core system compatibility with v10 in module.json helpYou have no manifest or download fields.TyphonJS Runtime Library - RC 0.0.12The TyphonJS Runtime Library / TRL release candidate version 0.0.12 is now available. This is a massCypress FunYeah, unfortunately it ain't that simple 😅 Cypress, like you say, automatically retries things, andpreUpdateHook questionHey all, question for anyone who has a sec. I'm trying to use `preCreateActor` to add rolled values spitballing about jest mocksok. ok. ok. pure spitballing theory here.
All the client side source exists in esmodule form (hopef1.6.1 testing@dnd5e Testing Action Requested but not required.
version 1.6.1 is a bugfix version, it's pretty clconversion macro@max.pat did you have a macro or script which could change the old classFeatures data into advancemeAC calc changesI do not believe the data for AC actually changed, only the way it is calculated.
evidence: no chang1.6.0 Custom Sheet ChangesLooking at the changes made which are breaking for custom sheets. Gonna make a thread for this.1.6.0 testingCommunity Testing Requests:
For those of you interested in helping to QA this branch, I'll put togeHook documentationdnd5e Hook Documentation:
https://gitlab.com/foundrynet/dnd5e/-/wikis/HooksTyphonJS Runtime Library v0.0.9 - Release CandidateAlrighty! The TyphonJS Runtime Library (TRL) v0.0.9 is out... In the last 2 weeks+ I have done massi1.6.0 - 82%@dnd5e - **No action Required**
The 1.6.0 milestone is at 82% completion
https://gitlab.com/foundryadvancement consumptionnow that I brought that up on #progress-reports @calego , could I maybe pester you later for some adAlternative Alignment System D&D5eWow, that is a really powerful way to codify alignment. I like it! Do you have any ideas as to how iconsumables chat data@Zhell
> So that's odd. How come consumables work different and all other item types get a non-func