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

[BUG] - Sequences fail to locate MeasuredTemplate#object immediately after a template is created. #192

Open
krbz999 opened this issue Jul 17, 2023 · 0 comments

Comments

@krbz999
Copy link

krbz999 commented Jul 17, 2023

Describe the bug
Sequences that are meant to play on a template fail to locate the correct coordinates. Most apparent using JB2A with a fireball animation targeting a newly created circle template, or a lightning bolt animation on a ray (line) template.

To Reproduce

  1. Enable JB2A, Sequencer, and dependencies in the dnd5e system (v2.2.2 and foundry v11.305).
  2. Run the below script for fireball and lightning bolt respectively.
  3. Cast fireball and place the template. The beam fires off into the corner.
  4. Cast lightning bolt and place the template. The animation does not play at all (see console for an error).
// quick and ugly script for a fireball anim
const tok = canvas.scene.tokens.find(e => e);
Hooks.once("createMeasuredTemplate", tem => {
  const beam = "jb2a.fireball.beam.orange";
  const expl = "jb2a.fireball.explosion.orange";
  const seq = new Sequence();
  seq.effect().file(beam).atLocation(tok).stretchTo(tem).playbackRate(2).waitUntilFinished();
  seq.effect().file(expl).atLocation(tem);
  seq.play({remote: true});
});
// and for lightning bolt
Hooks.once("createMeasuredTemplate", async function(templateDoc){
    const file = "jb2a.lightning_bolt.narrow.blue";
    return new Sequence()
      .effect()
        .file(file)
        .atLocation(templateDoc)
        .stretchTo(templateDoc)
      .play();
});

Expected behavior
Animations targeting the template objects.

Setup:

  • Foundry Version: 11.305
  • System Version: dnd5e 2.2.2
  • Sequencer Version: 3.1.2
  • Browser & version: Microsoft Edge, Version 114.0.1823.82 (Official build) (64-bit), but also local foundry install.

Active modules:

  • Sequencer
  • socketlib
  • jb2a patreon

Additional context
This issue did not appear in v10 to the best of my recollection.
Adding await new Promise(r => setTimeout(r, 50)) to the top of the above hooks seems to fix any issues from initial testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant