module

Sequencer

Endorsements
1
Installs
17.69%
Comments
0
Latest version2.0.10
Minimum Core0.8.9
Compatible Core9.000
Last updated1 day ago
Created7 months ago
Authors
Languages English
Systems All systems
Dependencies socketlib
Project source Project URL
Report bugs Bug tracker URL
Read-me Readme URL

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/MidiQOL-&-JB2A-Fire-Bolt

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)

        .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)

        .randomRotation()

    .play();

 

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

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x