Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Particle Switch Hook using name - effect does not switch off if other particle effects are also currently on (Foundry V10) #320

Closed
napolitanod opened this issue Jul 24, 2022 · 3 comments
Labels
bug Something isn't working confirmed

Comments

@napolitanod
Copy link

Expected Behavior

Reading through the API documentation, hook call "fxmaster.switchParticleEffect" should toggle an effect off and on and can target based on effect id (name).

Current Behavior

The hook call DOES behave this way (toggles the effect off when called), but only if no other particle effect is also currently running (for the instances that I have run tests for, see below). If another effect is running then the targeted effect will not switch off.

Steps to Reproduce

execute the following:

const wait = (delay) => new Promise((resolve) => setTimeout(resolve, delay));

Hooks.call("fxmaster.switchParticleEffect", {
    name: "Man2LrOJLHbaIRnK",
    type: "snowstorm",
    options: {
       "density": 0.6,
       "direction": 55,
       "lifetime": 1.9,
       "scale": 0.4,
       "speed": 2.9,
       "tint": "#12f3ef"
       }
});

await wait(3000);

Hooks.call("fxmaster.switchParticleEffect", {
            name: "Man2LrOJLHbaIRnK",
            type: "snowstorm"
          });

If it behaves as my session behaves then the snowstorm effect will come on, last for 3 seconds, and then switch off

now execute the following:

const wait = (delay) => new Promise((resolve) => setTimeout(resolve, delay));

Hooks.call("fxmaster.switchParticleEffect", {
    name: "LvsafasfHbaIRnK",
    type: "snowstorm",
    options: {
       "density": 0.6,
       "direction": 55,
       "lifetime": 1.9,
       "scale": 0.4,
       "speed": 2.9,
       "tint": "#12f3ef"
       }
});

await wait(3000);

Hooks.call("fxmaster.switchParticleEffect", {
    name: "Man2LrOJLHbaIRnK",
    type: "snowstorm",
    options: {
       "density": 0.6,
       "direction": 55,
       "lifetime": 1.9,
       "scale": 0.4,
       "speed": 2.9,
       "tint": "#12f3ef"
       }
});

await wait(3000);

Hooks.call("fxmaster.switchParticleEffect", {
            name: "Man2LrOJLHbaIRnK",
            type: "snowstorm"
          });

In my session, the first snowstorm starts. then, 3 seconds later, the second part is run and more snow particles are added. Then, 3 seconds later, the switch to turn off the snowstorm with name "Man2LrOJLHbaIRnK" is executed. I would expect either all of the snowstorm to end at that point or just the portion that was added when the second part was run. However, no snowstorm particles are switched off.

For ease, my example uses the same effect. But this can be replicated with another particle effect running. For example, if birds are flying on my screen and I run the first test above, which creates the snowstorm once and then runs the hook to switch it off 3 seconds later, the snowstorm will not switch off.

Context

I also tested with passing in the options with the switch 'off' call for name "Man2LrOJLHbaIRnK" but that did not work.

let me know if you need anything more!

thanks

Dan

Version

v3.1.3

Foundry VTT Version

v10 testing 1 build 275

Operating System

Windows

Browser / App

Native Electron App

Game System

dnd5e (2.0.0 - alpha 2)

Relevant Modules

No response

@napolitanod napolitanod added bug Something isn't working to be confirmed labels Jul 24, 2022
@ghost91-
Copy link
Contributor

Thanks for the report, I’ll try to take a look this evening.

@ghost91-
Copy link
Contributor

@napolitanod I just released version 3.1.4 to address this issue. Can you verify that it works correctly now?

@napolitanod
Copy link
Author

Ya, works great now! thank!!!!!

ghost91- added a commit that referenced this issue Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed
Projects
None yet
Development

No branches or pull requests

2 participants