tposney / midi-qol

Other
5 stars 0 forks source link

[Bug] Odd Behavior for Multiple Optional Bonuses at Once #919

Closed tposney closed 1 year ago

tposney commented 2 years ago

In GitLab by @ShtoDog on Jul 23, 2022, 09:31

It seems that when a character has two optional bonuses that can apply to the same roll, their bonuses don't always operate correctly. As an example, I configured an effect that grants a character an optional +1d4 to an ability check, plus another effect that allows them to reroll an ability check and keep the higher result as well as run a macro using the macroToCall functionality.

The prompt that allows you to select a bonus after each roll persists until you either use all possible bonuses or until you close out of it. However, the roll a bonus provides doesn't update the result in the window - if you rolled a 16 total, and click the option to roll an additional 1d4, the button for that d4 will disappear but the window will still display a 16 total. The chat will whisper the updated roll, and the final roll will take the optional bonus into account correctly, but the lack of an update to this window might be confusing. The total roll in this prompt likewise fails to update if you choose the reroll first.

Further, if the optional bonus would trigger a macro, it fails to do so unless there were no other optional bonuses you could apply to the roll after you select the option with the macro. Using the effects above, if you select the +1d4 bonus followed by the reroll, the macro attached to the reroll bonus is triggered. However, if you select the reroll option first, the macro is never called. This is the case regardless of whether you then apply the +1d4 bonus to the roll or not.

I noticed and tested the above in Midi-QOL v0.9.66, Foundry Version 9 Build 269.

tposney commented 2 years ago

The not updating the displayed roll is quite possible - I confess I have not tested that in detail.

The macro issue surprises me, but again have not tested the specific usage you mention.

I will have a look, but it will be a few days as I am in the middle of v10 migration for all my modules

tposney commented 2 years ago

Can you attach the actor the report plus your midi settings? It will make testing easier.

tposney commented 2 years ago

In GitLab by @ShtoDog on Aug 6, 2022, 06:58

Character and midi settings are attached. While exporting those details, it seems there may be more of an issue. The attached character has an effect called "Favored" which is just the "Lucky" feat with only 1 point instead of 3 (reroll-kh effect). It also calls a macro that only logs text to the console. She also has the "Guidance" effect on her (+1d4 to a roll), from the spell of the same name.

When I repeated the steps with this character to verify that things still weren't working, it seems that I'm now just getting an error for this effect whenever I try to run it with the macro call included. But I have another effect ("Super Inspiration") through Convenient Effects which seems to proceed without an error in the console despite being set up similarly, though it still has the same issue I originally reported above. Not sure if it's something I've configured incorrectly, but I've included an export of my Convenient Effects in case it's helpful.

jw_fvtt-Actor-cassiopeia.json

jw_fvtt-midi-qol-settings.json

jw_fvtt-Item-custom-convenient-effects.json

tposney commented 2 years ago

Found one part of the problem. If you are just rolling a saving throw from the character sheet (i.e. not when triggered by an item) the macro call will fail. That will be fixed in next midi version 10.0.3.

The dialog detail not updating I'll fix.

I can't reproduce the problem of the macro not being called, but will dig further.

The chat cards not updating is tricky, so that is going to move to 10.x since it's too hard to support in the both branches of the code.

tposney commented 2 years ago

In GitLab by @ShtoDog on Aug 10, 2022, 07:36

If you haven't already tried this specific combination, I'm able to replicate the behavior consistently by applying both the "Super Inspiration" and "Inspiration" Convenient Effects from my earlier export to a token, before having its actor make an attack roll with any item in their inventory. Using "Super Inspiration" first in the resulting dialog fails to trigger its macro, while using it second triggers it normally.

If those steps don't replicate the issue on your end, then I'm at a loss. It could be that there's something on my end that's causing the issue, but even disabling nearly all other modules doesn't seem to affect this, so I'm not sure. If there's anything I can do further to help, please let me know.

tposney commented 2 years ago

Thanks for that - I've found the problem and a fix will go out in 0.9.73.