Package Description

Sequencer

This module implements a basic pipeline that can be used for managing the flow of a set of functions, effects, sounds, and macros.

It implements a fluid and very readable interface so that even common users can read exactly what the Sequencer will do.

 

Guides

Here's a guide how to create a Fire Bolt effect using the Sequencer and a few other modules:

https://github.com/fantasycalendar/FoundryVTT-Sequencer/wiki/Basic-Macro

 

How to use

First you have to define a sequence:

let sequence = new Sequence();

Then, you can add functions and effects to it.

let sequence = new Sequence();

 

sequence.thenDo(async function(){

    do_something();

});

 

sequence.wait(200);

 

sequence.thenDo(async function(){

    do_something_else();

});

The Sequencer uses a method-chaining fluent interface, meaning you can continuously call functions on the sequence object, like so:

let sequence = new Sequence()

    .thenDo(async function(){

        do_something();

    })

    .wait(200)

    .thenDo(async function(){

        do_something_else();

    });

To start the sequence off, you simply call .play() on the sequence.

Advanced Examples

If you have Animated Spell Effects installed (https://foundryvtt.com/packages/animated-spell-effects), you can select two tokens and run this macro:

new Sequence()

    .effect("modules/animated-spell-effects-cartoon/spell-effects/cartoon/water/acid_splash_CIRCLE_01.webm")

        .atLocation(canvas.tokens.controlled[0])

        .scale(0.3, 0.6)

        .center()

        .randomRotation()

    .effect("modules/animated-spell-effects-cartoon/spell-effects/cartoon/water/acid_splash_CIRCLE_01.webm")

        .atLocation(canvas.tokens.controlled[1])

        .scale(0.3, 0.6)

        .center()

        .randomRotation()

    .play();

 

You can read more about the module on the github page, which also contain more examples!

Tagged Categories

  1. Automation Enhancers
  2. Audio Improvements
  3. Tools and Controls
  4. Visual Effects

Available Versions

  1. Version 0.3.1

  2. Version 0.3.2

  3. Version 0.3.3

  4. Version 0.3.4

  5. Version 0.3.5

  6. Version 0.3.6

  7. Version 0.3.7

  8. Version 0.3.8

  9. Version 0.3.9

  10. Version 0.3.10

  11. Version 0.3.11

  12. Version 0.3.12

  13. Version 0.3.13

  14. Version 0.4.0

  15. Version 0.4.1

  16. Version 0.4.2

  17. Version 0.4.3

  18. Version 0.4.4

  19. Version 0.4.5

  20. Version 0.4.6

  21. Version 0.5.0

  22. Version 0.5.1

  23. Version 0.5.2

  24. Version 0.5.3

  25. Version 0.5.4

  26. Version 0.5.5

  27. Version 0.5.6

  28. Version 0.5.7

  29. Version 0.5.8

  30. Version 0.5.9

  31. Version 0.6.0

  32. Version 0.6.1

  33. Version 0.6.2

  34. Version 0.6.3

  35. Version 0.6.4

  36. Version 0.6.5

  37. Version 0.6.6

  38. Version 0.6.7

  39. Version 0.6.8

  40. Version 0.6.9

  41. Version 0.6.10

  42. Version 0.6.11

  43. Version 0.6.12