Conditional Visibility (Reborn 2022)
If you want to buy me a coffee
Invisible Stalkers should only be seen by players that have cast See Invisibility. Stealthy Goblins should only be seen by players with high perception. And when that Drow casts Darkness, players should need Devil's Sight to see any tokens inside.
Conditional Visibility allows you to set conditions on tokens that will display them only to players whose senses meet the conditions necessary to see the token.
IMPORTANT: This module will work very good with the ligthing setting "Token vision" of scene configuration set to true, otherwise is still work, but is not advisable
NOTE: If you are a javascript developer and not a typescript developer, you can just use the javascript files under the dist folder
Before open any issue
- Enable the module setting "Enable debugging"
- Click F12 go to the console tab
- make the test you want and replicate the error
- Go to the tab console open on point 2) and just right click and click 'Save as' and 'Save'.
- attach the text file on the github issue
- Wait for a response
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/conditional-visibility/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.
ATE (old ATL)
This module uses the ATE library for wrapping methods. It is a hard dependency and it is recommended for the best experience and compatibility with other modules.
Known Issue\Limitation
- HELP WANTED FOR PF2E INTEGRATION, it's seems from my last visit to the PF2E sytem to many things are chnaged, i need some PF2E developer for help me with the intgration (the problem is always the time...)
- HELP WANTED FOR BETTER PANEL INTEGRATION This is just a "fast to make" module maybe someone a little more expert than me with form application and hud layer can do a better form for a better user experience.
- [FUTURE FEATURE MAYBE] This module used many feature of the Dfred convenient effects module, but is not multisystem (yet) i invite you to support Dfred for is marvelous work and beg him to make that module multisystem.
- [WORKING IN PROGRESS] With levels module enabled and active, if the scene is with "Token vision" set to false (unchecked box), after selected a token and click on the canvas with the option "Release on left click" enable the hidden token are visible for a small instant this is a incompatibility with the Levels module i cannot solve, the simple solution is just enable the token vision on the current scene.
- [NOT SOLVED] There is a small incompatibility with the Dfred convenient effects module, for some strange reason the passive effect are applied has temporary effect here the issue related DFreds/dfreds-convenient-effects#137, it's seem Dfred manage only temporary effect so we leave this issue not resolved
- [PATCHED] The module "less fog" breaks the dm view of tokens. The gm still see an invisible token as other tokens, but the players don't so is a minor issue. The solution is just make sure the module 'Less Fog' settings 'Reveal Tokens' and 'Reveal to All Players' are set to false (uncheked box) both.
- [TODO] Better integration with ATE for now yu must do some manual settings... hoope for the future to do a better automatize.
Usage
A usage documentation on how the active effect are managed is reachable
↓↓↓↓↓
Details on active effects
↑↑↑↑↑
before anything give it a look there and let me know howmuch bad is the documentation.
These modules are suggested for a better user experience with this one :
- Status Icon Tweaks
- Temporary Effects as Token Statuses
- DFreds Convenient Effects
- Combat Utility Belt or CUB
- Times up
- Dae
- Sense Walls Multisystem (working)
Conditions and sense combination by system default
System Dnd5e
System Pathfinder 2e (work in progress)
Did you want ot help with your system prepare some table like the one i do it for Dnd5e for help me to define some rule for your system
Features
Module compatibility
-
Integration with Shared vision: The module just wrap on
wrapper
mode this two methodSightLayer.prototype.testVisibility
andSightLayer.prototype.tokenVision
so it should be no conflict with this module. -
Integration with Perfect Vision: The module just wrap on
wrapper
mode this two methodSightLayer.prototype.testVisibility
andSightLayer.prototype.tokenVision
so it should be no conflict with this module.
-
[Small incompatibility] Integration with Levels: The module just wrap on
wrapper
mode this two methodSightLayer.prototype.testVisibility
andSightLayer.prototype.tokenVision
so it should be no conflict this module. -
Integration with DFreds Convenient Effects: documentation work in progress, but is basically all automatic so it should work for all senses and conditions are present on the graphic ui of this module.
All the sense and condition are automatically imported, you can disavle this on the module settings if you want.
- Integration with Combat Utility Belt or CUB: If you use Combat Utility Belt you can use the new active effect management for sync with this module.
If each condition is added to the CUB set, Conditional Visibility will again function, even if CUB has removed the default set. The pairs would be:
Apply sense and condition from Token Config
Every sense and condtion can be setted on the token config vision tab, remember the 0
value is the deactivate/default/nullable value, the value <=-1
(a negative number) is the infinite, for tell to the module to avoid any check because i won anyway. Depends on the value you set the module will automatically create, updated and remove the active effect on the current token, you can anyway go to edit the active effect manually and change the value and these settings are updated either way.
NOTE: Limitation do not use multiple active effects with the same key on the change values ATCV.<sense or condtion id>
, checkout the Active effect paragraph on the tutorial
Auto-applied the 'hidden' condition from Stealth Rolls like the old "auto appplied hidden"
IMPORTANT: to manage the multisystem and the other three thousand modules from which you can roll the stealth I apply the value of the stealth that appears in the chat, so make sure that each player who launches the stealth roll can see their own chat.
NOTE: The 'auto stealth' is a token only feature, so if you roll from a 'actor' on the sidebar is not applied .
This is been tested with these modules:
Apply sense and condition from Token HUD
Stop immediately! Thinking of doing a stealth roll right? Well you can't do it from here! this is a generic tool for applying active 'sense' and 'condition' effects on tokens. Stealth shooting can be done in many ways from the character sheet, with TAH, with LMRTFY, with MTB, with DAE + Item Macro, but not with this form. The form uses the stealth values as a basis for applying a value for the AE you select in the dropdown the end does nothing else ,stop thinking that what you shoot here is a stealth roll
Conditional Visibility contains an setting to auto-apply the hidden condition based on a stealth roll. The reuslt can be differnete depends on the current game system ,contributions for other systems are welcomed.
When this setting is true, then rolling stealth form the HUD config of that token's character sheet will apply the hidden condition based on the value of that roll.
NOTE: if the system no have the property set on the module setting or the system no support a stealth enviroment it's just roll classic 1d20, you can still manually insert the desired value
Set up a distance checking for see hidden tokens like for lantern of revealing
Add new active effect change ATCV.conditionDistance
for a distance check to add to the active effect. Just edit the active effect data and apply the ATCV.conditionDistance
change with a numeric value that value is used like unit distance for the distance checking.
[On developing or maybe never...] Integration with Combat utility belt
CUB already manage the connection with active effect and a management with the DFreds Convenient Effects add a third module is just redundancy, but if anyone has some suggestion just open a issue or better a PR.
Customize you own sense or condition
Customize for each token specific image for specific token
NOTE: You must enable the module setting "[EXPERIMENTAL] Enable draw CV Handler" for activated this.
Api
The API documentation is reachable here API