Register

Particles FX

An Add-on Module for Foundry Virtual Tabletop

Author: Jideon Project Source: Project URL Versions 10+ (Verified 10.291) Last Updated 1 year, 3 months ago

foundryVTT-particles FX

The module contains several methods to generate particles without needing premade video files. The particles are simples sprites textures managed by script, you can use or add some prefill templates for the emitter or customize it with a json input.



particlesFx.sprayParticles('breath', {source :token.id, target: target.id} )

Settings

  1. Avoid showing particle from other client (useful for minimal configuration) (Client setting)
  2. Save emitters when changing scene and retrieve when returning (World setting)
  3. Define minimal user role to manage the custom prefill templates (World setting)

Emission methods

The emission methods is used to interpret the input and manage the particles during their lifetime. The method returns its id.

Spray particles

The spray particles are emitted from a source and move with a velocity in a direction define by an angle.

Graviting particles

The graviting particles turn around the source with a velocity at a distance defined by a radius.

Missile particles

The missile method emits a spray particles that is used to emit sub particles.

Stop all emissions

To stop all emissions in the scene and reset the particle emitters ids index.

Stop a specific emission

To stop a specific emission, you need to use a macro to call the method particlesFx.stopEmissionById with an id parameter :

And a boolean parameter, true for instant delete of particles already emitted, false to stop only the emission (living particles are not killed).

 

How to call it

Call by chat

You can start or stop emission by chat with command "/pfx". It adds a message response in the chat.

Commands :

/pfx spray ray death

To stop a command, you can add the param --instant to not have to wait the end of the particles lifetime.

Call by script

Example To emit a missile particles with graviting sub particles that forming a trail particlesFx.missileParticles({source : {x:200, y:250} , target: token.id, subParticles : { type: "Graviting", particleLifetime: 1000, onlyEmitterFollow : true, particleAngleStart: '0_360'}})

Apis methods

All this methods can also be calls with the modules API 'game.modules.get("particule-fx").api' with the same parameters and behaviour:

 

Prefill template

The method emitting particles can be called with a prefill template. They are two kinds of template prefillMotionTemplate and prefillColorTemplate which can be combined. You can add an input to override some attributes of the prefill template. The order of the paramater is not important, for example particlesFx.sprayParticles('prefillMotionTemplate', 'prefillColorTemplate', {position: {x:100, y:'50_100'}}) is the same as particlesFx.sprayParticles('prefillColorTemplate', {position: {x:100, y:'50_100'}}, 'prefillMotionTemplate')

Prefill motion template :

Example particlesFx.missileParticles('wave', {source :token.id, target: target.id} )

Prefill color template :

Example /pfx spray breath fire

More details in the readme

To do more advanced thing please read the readme for more details :

V2 Breaking change

With the v2.0.0, all words containing particule has been rename particle. And the object exposing the modules methods (particuleEmitter) has been renamed particlesFx .

A compatibility management has been add with warning to show the bad names.

Categories

Available Versions

  1. Version 2.0.0

    1 year, 3 months ago
    Foundry Version 10+ (Verified 10.291) Manifest URL Read Notes
  2. Version 1.1.0

    Foundry Version 10+ (Verified 11.307) Manifest URL Read Notes
  3. Version 1.0.1

    Foundry Version 10+ (Verified 10.291) Manifest URL Read Notes
  4. Version 1.0.0

    Foundry Version 10 - 10 (Verified 10.291) Manifest URL Read Notes