Skip to content

gioppoluca/foundry-beams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foundry-beams

  • Latest Release Download Count
  • Total Download Count
  • Forge Installs

A Foundry VTT module that lets tokens emit animated, styled beam segments — with support for reflections, shader effects, regions, and module API integration. The module is system independent.

Beam Scene

As shown in the image a beam is emitted from the statue it bounces on 2 walls and than hit a elk head trophy mount that triggers the opening of a secret door.

✨ Features

  • 🔦 Create directional, light beams from tokens: beams can have different styles
  • 🔁 Reflect off flagged mirror walls and pass through windows or open doors; wall/mirror can move and beam react accordingly
  • 📐 Generates Foundry v12 Region polygons matching the beam's path
  • 🔌 Provides API methods for other modules to control beam behavior
  • Integrated with Monk's Active Tiles with both actions dedicated and the capability to trigger tiles

📦 Installation

Install it as a Foundry VTT module from within the module section.

Requires Foundry VTT v12+ and Sequencer module

🚀 Usage

Enable Beam on a Token

  1. Open token configuration. token configuration
  2. Use the new "Beam" tab to configure:
    • Beam enabled
    • Width
    • Offset from the center of the token to align the beam start with the token shape
    • Color (hex)
    • Style: the style of the beam: actually available laser and lightning
    • If you want to activate a region on the beam
    • Configure the associate region: mind that the region will take a name associated with the token thus if you later change the token name the region at the moment is left orphaned of the beam.

Beam Types

LEGACY: laser and lightning are from the first implementation of the module and have the problem that they do not respect roofs CURRENT: laserSeq uses Sequencer to generate the beam. Is the new implementation that respect the roofs and also allows for nicer looking beams. more will come as also some fine tuning.

WARNINGS

Token MUST face east since the rotation of the token is used to move the beam and the rotation of 0 is the horizontal line/axes emitting on the right: thus the token part that emit the beam has to be rotated accordingly. You cannot use the rotation of the token to try to align it with the beam.

Make Walls Reflective

  1. Edit any wall and find the section where to opt for making the wall wall config
    1. a mirror (all sides become a mirror)
    2. reactive to beam both on enter or exit: will execute the macro names, macro UUID or trigger MATT tiles (UUID) in the input field
    3. the macro name to execute each time the beam enter or exit the wall, not if it moves along it

MATT triggering from wall

The selected tile (at the moment UUID) will trigger a MATT action to a specific landing that HAS to exist. The landing name convention is:

  • Beam-<token.name>-enter : for the enter landing
  • Beam-<token.name>-exit : for the exit landing

Automatically Generated Regions (v12)

  • Regions are created to match the full path of a beam and move with the beam.
  • Useful for triggering effects, hazards, etc.

🧪 API

Other modules can interact via APIs :

const beams = game.modules.get("foundry-beams").api;

// Enable/Disable/Toggle the beam: it means that the beam exists or not = region behaviour is deleted
await beams.enableBeamById("Token.UUID");
await beams.disableBeamById("Token.UUID");
await beams.toggleBeamById("Token.UUID");

// Activate/Disactivate the beam: it means that the beam exista, but could be disabled = region behaviour is kept
await beams.activateBeamById("Token.UUID");
await beams.disactivateBeamById("Token.UUID");
await beams.toggleActivationBeamById("Token.UUID");


// Set color
await beams.updateBeamColorById("Token.UUID", "#ff00ff");

// Get state
const state = await beams.getBeamStateById("Token.UUID");

// Rotate beam to a specific degree
await beams.rotateBeamByIdTo("Token.UUID", 90);

// Rotate beam of a specific increment
await beams.rotateBeamByIdOf("Token.UUID", 90);

Monk's Active Tile Triggers integration

The module offers some activities to use with MATT:

  • Rotate Beam Of action: to have the tile trigger the rotation of a specific emitter token
  • Rotate Beam Of action: to have the tile rotate an emitter at a specific direction
  • Toggle action: to have the tile toggle a specific emitter: use toggleActivationBeamById
  • Activate action: to activate the beam of a specific emitter: use activateBeamById
  • Deactivate action: to deactivate the beam on a specific emitter: use disactivateBeamById

Support

Please open issues on this repo for any problems that you can have using this module. For discussing on my modules please join my discord server:

If you want to support this work Buy Me A Coffee

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published