Sense Walls Multisystem
A module for Foundry VTT that allows to add and remove walls based on the active effects applied on the token.
Just something i have done for understands how levels and other module work with WallLayer and Sightlayer.
This project is a started idea , maybe this can be evolved in something more articulate.
Installation
It's always easiest to install modules from the in game add-on browser.
To install this module manually:
- Inside the Foundry "Configuration and Setup" screen, click "Add-on Modules"
- Click "Install Module"
- In the "Manifest URL" field, paste the following url:
https://raw.githubusercontent.com/p4535992/fvtt-sense-walls-multisystem/master/src/module.json
- Click 'Install' and wait for installation to complete
- Don't forget to enable the module in game using the "Manage Module" button
libWrapper
This module uses the libWrapper library for wrapping core methods. It is a hard dependency and it is recommended for the best experience and compatibility with other modules.
socketlib
This module uses the socketlib library for wrapping core methods. It is a hard dependency and it is recommended for the best experience and compatibility with other modules.
Supported Systems
Features
Walls can be configured to only show up to a certain level of vision. For example, if the "Piercing Vision Level" is set to "Darkvision" then a character with darkvision or greater darkvision can see and move through the wall (depend on the configuration of the wall), but one with only low-light vision cannot.
You can set the value on the wall config dialog from a dropdown.
You can use any active effect where the name is founded from the following code
// regex expression to match all non-alphanumeric characters in string
const regex = /[^A-Za-z0-9]/g;
// use replace() method to match and remove all the non-alphanumeric characters
effectNameToCheckOnActor = effectNameToCheckOnActor.replace(regex, "");
effectNameToCheckOnActor.toLowerCase().startsWith(effectIdOfTheModule);
Tables
These tables are essential because they help the communtity to decide how to calculate a hierachy between the Active Effect
The calculation is done with this formula:
Maximum vision wall level >= token vision level (Active Effects) >= Minimum vision level
System Dnd5e
System Pf2e
API
This api is redundant it can be easily replace from other macros or modules, is advisable to use other module like CUB or Dfred convenient effects
addEffect(actorNameOrId: string, effectId: string, distance: number) ⇒ void
Calculate the distance between the source token and the target placeable objet Returns: void
-
Param | Type | Description |
---|---|---|
actorNameOrId | string |
The name or the id of the actor, if applied on a token must be linked to a actor. |
effectId | string |
The effectId used from this module |
distance | number |
OPTIONAL: explicit distance in units not grid to add to the Active Effects |
Example: SenseWalls.API.addEffect('Zruggig Widebrain','darkvision',60)
game.sense-walls-multisystem.API.addEffect('Zruggig Widebrain','darkvision',60)