Frstrm / TokenLightCondition

Determine the lighting conditions of a token based on placed lights and token lights
MIT License
1 stars 4 forks source link

Hi - Flags for the effects? #26

Closed nirurin closed 1 year ago

nirurin commented 1 year ago

Hi there, I'm currently looking at modifying the 'patrol' module to get the 'alert' and 'spotted' behaviour to be more compatible with a wider range of conditions, such as 'stealthy' parameters and light levels.

By default the patrol module just works by whether there is direct line of sight between the spotter and spotted, but it ignores things like the token being invisible or hidden or in darkness, so it makes it pretty poor for stealth based gameplay!

So the first question becomes - rather than the effects themselves being on the token for the surrounding light level, could you let me know the code syntax for the flags, so I could try and use the variables to determine if the target is in darkness or a lit area (and therefore use it to determine if darkvision is required to 'spot' them)

Thanks :)

Frstrm commented 1 year ago

the light condition can be retrieved from the token: token.actor.getFlag('tokenlightcondition','lightLevel') it should return one of these ( 'dark','dim','bright' )