Register

Enhanced Region Behavior

An Add-on Module for Foundry Virtual Tabletop

Author: TMinz Project Source Foundry Version 13 (Verified 13) Last Updated 1 week, 6 days ago
Enhanced Region Behavior is a Foundry VTT module that adds powerful new automation options to Scene Regions. With this module, you can trigger traps, play music, or play sound effects automatically when tokens interact with regions on your maps.

Features

- Trap Regions: Automatically roll saving throws and apply damage to tokens that enter, exit, or move within a region. Supports D&D 5e abilities and damage types, with optional MidiQOL integration for advanced automation.
- Music Regions: Play specific songs or playlists, or stop all music, when tokens interact with a region. Supports playing all songs or just the first match.
- Sound Effect Regions: Play a sound effect or sequencer effect when a region is triggered. Supports volume control and integration with the Sequencer module if available.
- Visual Effect Regions: Automatically play an image or animation effect when tokens interact with a region. Supports static images and animated files, with options for duration, scale, display layer. Requires Sequencer
- Elevation Regions: Automatically set the elevation of tokens when they enter or exit a region.
- Open Journal Regions: Automatically open journal or journal page when tokens interact with a region.

Requirements

- Foundry VTT v13+
- D&D 5e system (minimum 5.0.3) (optional, required for Trap Region)
- libWrapper (optional but highly recommended)
- MidiQOL (optional, for advanced trap automation)
- Sequencer (optional, for advanced sound effects)

Installation

You can install Enhanced Region Behavior using either of the following methods:

Option 1: Foundry's Module Installer (Recommended)

1. In Foundry VTT, go to Add-on Modules > Install Module.
2. Search for "Enhanced Region Behavior" in the module browser.
3. Click Install to add the module to your Foundry installation.
4. Enable the module in your world from the Manage Modules menu.

Option 2: Install via Manifest URL

1. In Foundry VTT, go to Add-on Modules > Install Module.
2. Paste the manifest URL from the GitHub Releases Page into the installer.
3. Click Install to add the module to your Foundry installation.
4. Enable the module in your world from the Manage Modules menu.

Usage

Trap Regions (5e)

1. Create or edit a Scene Region.
2. Set the Region Behavior type to Trap.
3. Configure the trap:
   - Automate Damage: Automatically apply damage
   - Save DC: The DC for the saving throw.
   - Save Ability: The ability score for the save (e.g., DEX, CON).
   - Damage: Damage formula if the save fails (e.g., `2d6`).
   - Damage if Saved: Damage formula if the save succeeds (e.g., `1d6`).
   - Damage Type: The type of damage (e.g., piercing, fire).
   - Save Failed/Success Message: Custom chat messages.
   - Disable After Trigger: If enabled, the region disables itself after triggering.

 

When a token triggers the region, the module will roll the saving throw and apply damage automatically.

 

MidiQOL Integration:
If the MidiQOL module is installed and enabled, Enhanced Region Behavior will use MidiQOL's workflow to handle saving throws and damage rolls for trap regions. This allows for advanced automation, including applying effects, rolling chat cards, and integrating with other automation modules. If MidiQOL is not present, the module will use Foundry's built-in mechanics for saves and damage.

Music Regions

1. Create or edit a Scene Region.
2. Set the Region Behavior type to Music.
3. Configure the music options:
   - Playlist Name: (Optional) Name of the playlist to use.
   - Song Names: Comma-separated list of song names to play.
   - Play All Songs: If enabled, all matching songs will play.
   - Stop All Current Music: If enabled, stops all currently playing music.
   - Play Full Playlist: If enabled, plays the entire playlist.

Sound Effect Regions

1. Create or edit a Scene Region.
2. Set the Region Behavior type to Sound Effect.
3. Configure the sound effect:
   - Path to sound file or sequencer effect: The file path or sequencer effect to play.
   - Volume: Volume level (0.0 to 1.0).

 

If the Sequencer module is active, it will be used for playback; otherwise, Foundry's built-in audio will be used.
 

Visual Effect Regions (Requires Sequencer)


1. Create or edit a Scene Region.
2. Set the Region Behavior type to Visual Effect.
3. Configure the visual effect:
   - Image or Animation Path: The file path to an image or animation (e.g., `.webm` or `.png`).
   - Duration: How long the effect should display (in milliseconds). Set to `0` to play the full effect.
   - Infinite: If enabled, the effect will persist until the region is deleted or deactivated.
   - Scale: (Optional) Scale the effect.
   - Below Tokens: (Optional) Display the effect below tokens.
   - Play At Token Location: (Optional) Play the effect at the triggering token's location instead of the region's shape.

Elevation Regions


1. Create or edit a Scene Region.
2. Set the Region Behavior type to Elevation.
3. Configure the elevation options:
   - Elevation: The elevation value to set for any token that triggers the region (e.g., `10`).
 

Open Journal Regions

1. Create or edit a Scene Region.
2. Set the Region Behavior type to Open Journal.
3. Configure the journal options:
   - Journal ID: (Optional) The unique ID of the specific journanl to open. Takes priority over Journal Name.
   - Journal Name: (Optional) The name of the journal to open. Used if Journal ID is not provided.
   - Journal Page ID: (Optional) The specific page ID to show within the journal.
   - Show to All Players: If enabled, the journal will be shown to all players. Otherwise, only to the triggering player or token owner.

The region will automatically open the specified journal when triggered. You can use either the Journal ID (for precision) or Journal Name (for convenience).


Region Clicked Event


A new custom event, regionClicked, is available for all region behaviors.
This event is triggered when a user clicks inside a region on the canvas.
You can use this event to trigger certain region behavior (Sound Effect, Visual Effect) in response to a click.

Localization

Currently, only English is provided. You can add additional languages by creating new files in the `languages/` folder.

Credits

Created by TMinz.

For bug reports or feature requests, please use the GitHub Issues Page.

Categories

Available Versions

  1. Version 1.4.4

    1 week, 6 days ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  2. Version 1.4.3.1

    3 weeks, 2 days ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  3. Version 1.4.2

    1 month, 2 weeks ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  4. Version 1.4.1

    1 month, 2 weeks ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  5. Version 1.4.0

    1 month, 2 weeks ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  6. Version 1.3.3

    1 month, 4 weeks ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  7. Version 1.3.2

    2 months ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  8. Version 1.3.1

    2 months ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  9. Version 1.3.0

    2 months, 1 week ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  10. Version 1.2.0

    2 months, 2 weeks ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  11. Version 1.1.0

    3 months ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes
  12. Version 1.0.0

    3 months, 2 weeks ago
    Foundry Version 13 - 13 (Verified 13) Manifest URL Read Notes