lipefl / swade-tools

A Fondry VTT module with automations for Savage Worlds (SWADE)
15 stars 13 forks source link

Attack rolls working on some tokens but not others #294

Closed Zacx133 closed 6 months ago

Zacx133 commented 6 months ago

When player character attack enemies and vice versa I receive the standard dice roll and not the Hit/Raise calculator button that usually appears, I managed to get it to work when I switched characters to Neutral. It also appears that gang up bonus is not being count for anyone no matter their Disposition. I tried seeing what was happening in the console but couldn't understand this error: Screenshot 2024-04-17 205932

This error is from an NPC extra who couldn't achieve the Hit/Raise calculator button without having every unit set to neutral.

lipefl commented 6 months ago

It's not happening here, so i need to investigate further. Can you inform the version of Foundry and SWADE system? Also... can you test with only SWADE Tools enabled? The error is happening within GangUp, in the part that check if the actor is Incapacitated (if you disable GangUp it'll probably stop). I also see some warnings about token "Jeep" and "Warden" having no actor, it can be what is causing the error. Can you provide more information about them?

Zacx133 commented 6 months ago

SWADE tools version 1.15.1 and Foundry version 11 build 315. Turning off the Gang Up bonus does fix the issue but I'd like to attempt to have that feature available. The Jeep and Warden tokens are unrelated to the tokens having the issue, as I ported this game over from roll 20 and those are old tokens. The tokens in this issue are entirely new ones made in Foundry. Screenshot 2024-04-18 104929 In this image here you can see that Hanabi's weapon doesn't get the Hit prompt, but Curze's weapon does. I've moved the weapons between the characters to test, any melee weapon on Hanabi doesn't work while any melee weapon on Curze does.

Zacx133 commented 6 months ago

Meanwhile the same exact test with this Thrall shows it can't see to trigger it on any attack except for an attack against itself. (H is Fighting against Hanabi, C against Curze, and T against itself.) rthralltest Issue still persists when only SWADE Tools is activated

Zacx133 commented 6 months ago

Did some testing and it appears the Thrall's attack works correctly when it's disposition is set to neutral or friendly, but not when Hostile or Secret

lipefl commented 6 months ago

It could be related to the imported tokens because GangUp analyzes all the tokens in canvas, not just adjacent tokens. I did a minor change in the code to prevent this. Update SWADE Tools and see if it works for you. Since I can't reproduce the error, I can only guess where the problem is.

Zacx133 commented 6 months ago

Wow that fixed it perfectly! Thank you for your help!