javierriveracastro / betteroll-swade

A Better Rolls port for SWADE
GNU General Public License v3.0
15 stars 31 forks source link

Repeated Automated Animations effects when ammo mangement is enabled #673

Closed hakeem4321 closed 3 months ago

hakeem4321 commented 5 months ago

When using automated ammo management alongside Automated Animations, the effects play twice.

How to reproduce: 1- Automatic Ammo Management must be enabled from the system configuration 2- Ammo subtraction is enabled (it doesn't matter if it's automatically toggled or manual) enable Subtract Ammo won't trigger the issue, it seems related how the Better Rolls cards work, because it works fine when using the system's default rolling method, this also doesn't happen to automatic power point management

javierriveracastro commented 5 months ago

Isn't any configuration needed on AA to reproduce this?

Given that it works using name, Does it happen with some particular item or kind of items?

hakeem4321 commented 5 months ago

Isn't any configuration needed on AA to reproduce this?

yes, you first need to set up the effect using AA, it seems to trigger as long as the effect is played on the attack roll (doesn't trigger when using templates effects for example)

i have tried a few other things:

Given that it works using name, Does it happen with some particular item or kind of items?

only with weapons with shots/ammo so far, i was unable to replicate it on active effects and powers, they work normally

javierriveracastro commented 5 months ago

Thanks I will try to reproduce it. It's likely that I have to get back to you as I have never used AA.

javierriveracastro commented 5 months ago

Sorry, but I'm totally unable to reproduce it.

hakeem4321 commented 5 months ago

https://youtu.be/c74FjwrAA6A here's a video a recorded, i thought the issue might be related to the browser (i was using firefox) but it wasn't, it also tried it on both a local foundry hosting and on Forge, same issue

javierriveracastro commented 5 months ago

Ahhhh... now I see it. It's quite subtle.

javierriveracastro commented 5 months ago

Nope, I have even delete shooting to use "uniskilled attempt".

Screencast_20240202_152907.webm

Something else must be going on.

hakeem4321 commented 5 months ago

did you add ammo and check the reload method? because the warning appeared in the video

javierriveracastro commented 5 months ago

Yes, I have just tested it so many times that I have run out of ammo:

imaxe

javierriveracastro commented 5 months ago

I have also removed ammunition. damage and range...

javierriveracastro commented 5 months ago

Can you record a video like this?

Screencast_20240202_154455.webm

The important bits is having debugging in AA enabled and the console open.

hakeem4321 commented 5 months ago

https://youtu.be/NJXqTNFE3fQ i apologize the video isn't uploaded on here, github doesn't support mkv files

hakeem4321 commented 5 months ago

also real quick, i tried it with one of my players and when he shoots the effects play rapidly but when i shoot they have a larger gap, we're both using the same character against the same target

javierriveracastro commented 5 months ago

It only shows one DEBUG | Automated Animations | range Animation Start" Object { primary: {…}, secondary: false, sourceFX: false, targetFX: false, macro: false } [constants.js:3:16](http://localhost:30000/modules/autoanimations/src/constants/constants.js)to me.

I'm sorry but I have absolutely no idea of what is going on here...

It must be some kind of race condition. Let me try to check how AA decides to play an animation.

hakeem4321 commented 5 months ago

and just to be sure, did you set the animations to play on trait or damage rolls?

javierriveracastro commented 5 months ago

Got it.

AA is hooking both to "BRSW-RollItem"and to "swadeConsumeItem". This is why it shown the animation twice.

Now in my test world, "swadeConsumeItem" is throwing an error and preventing the second animation to be shown. In yours it likely isn't doing that.

javierriveracastro commented 5 months ago

and just to be sure, did you set the animations to play on trait or damage rolls?

That shouldn't matter. It is only checked in the swade_action Hook.

javierriveracastro commented 3 months ago

I don't think that this could be addressed on BR2, so I'm closing it. Please, feel free to reopen it if you don't agree.