module

Sequencer

Endorsements
0
Installs
0.22%
Comments
0
Latest version0.3.5
Minimum Core0.7.10
Compatible Core0.8.6
Last updated3 days ago
Created2 weeks ago
Authors
Languages
Systems All systems
Dependencies FXMaster
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.

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.then(async function(){

    do_something();

});

 

sequence.wait(200);

 

sequence.then(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()

    .then(async function(){

        do_something();

    })

    .wait(200)

    .then(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!

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