dwonderley / mookAI

If you encounter problems, please leave an issue or message me on the FVTT discord with the handle @Daveofwonders
MIT License
9 stars 13 forks source link

MidiQOL not registering Attack/Damage rolls #20

Closed GhostofXavier closed 3 years ago

GhostofXavier commented 3 years ago

When attacking normally, MidiQOL behaves as expected.

When using MookAI, it triggers movement and targeting and performs attack and damage rolls but MidiQOL doesn't register the action (and thus no damage is applied).

I've deleted (uninstalled from Foundry) both mods and reinstalled but the issue persists. I've tried numerous setting changes but I'm not sure why it suddenly stopped working.

Thanks!

jesterret commented 3 years ago

MidiQOL works by registering events for each step of the workflow (attack, check if hit, roll damage, apply), and expects the target to stay targetted throughout all of them. Meanwhile, mookAI untargets right after a roll.
Easiest fix would be to check whether midiQOL is installed before calling this function.

GhostofXavier commented 3 years ago

I'd love to say that I was a programmer, but I haven't really delved into programming since 2005. I can generally read basic code but that doesn't mean I know what to do with your testing instructions...

Ive done some additional troubleshooting to see if there was a different mod that could be potentially mucking things up. No dice. Even when only Mook and Midi are activated it still isn't working. I'm wondering if there's a broken config file somewhere that is changing things inadvertently.

Also, since I didn't mention before, Foundry, Dnd5e, and the modules are all fully updated to the most recent versions available.

jesterret commented 3 years ago

Considering there was no updates for a while, You could just comment this line on your local module source and if there would be update to this module in the future, reapply it, or hope it's already included.
Not knowing anything about your setup, you need to find foundry data directory (not app installation, but where worlds etc are stored), and edit this file FoundryVTT/Data/modules/mookAI/scripts/mook.js

If You want to keep untargetting if you disable midiqol, this should be enough.

                if(!game.modules.get("midi-qol")?.active) {
             this.clearTargets ();
                }
GhostofXavier commented 3 years ago

Commenting out the .cleartargets line worked! And since MookAI (re)targets enemies when starting a new action, it properly changes targets without issue.

Thanks again!