module

Sequencer

Endorsements
1
Installs
24.38%
Comments
1
Latest version2.1.7
Minimum Core0.8.9
Compatible Core9.000
Last updated1 week ago
Created1 year 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
1 Comment
Inline Feedbacks
View all comments
ghost
4 months ago

The mother of all effect modules! This let’s me easily script cool little animation sequences, including things like opening a door and playing the corresponding sound, playing special effects like having a token of the evil sorcerer teleport away right infront of the eyes of the PCs, or just have spell animations for the (n)PCs spells. A very nice Addition!
Thank you, Wasp, for making this!

1
0
Would love your thoughts, please comment.x
()
x