Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Scripts that use Status Markers to indicate cover & light level in combat?

Hey folks, Apologies if I'm missing an obvious solution in my searches - I'm running Starfinder campaign for the first time, and there's a lot of rules about cover & lightning. I'm trying to find a script / combination of scripts to handle the following tasks: Update all token's status markers dynamically based on their current light level. Update all token's status markers based on the level of cover they have against the selected token when the turn tracker is open and it's that token's turn. I know some of the criteria for determining cover & light would be different from Starfinder/Pathfinder, but this would be pretty helpful for my more combat-focused D&D5e group as well. Anyone have any ideas on how to accomplish this? I'm aware of Dynamic Lighting Tool, but that seems to be a chat-based solution rather than an on-token option, and my players are jabronis who won't use any macros or other tools I give them (and I'm lazy).
Short answer: updating status markers based on current light level should be possible. Updating status markers based on 'level of cover' is likely not possible. Oosh created the checkLightLevel script , which will provide the amount of light that is currently on the token. It can also be called by other scripts, so it should be possible to use it with Metascripts and Tokenmod to update status markers based on current light level. I can't think of any way to determine level of cover for tokens, as that is dependent on too many arbitrary factors - is your character fully behind a tree? Is the tree big enough to give 1/2 cover or 3/4 cover?   Token line of sight is one thing that could be possible for a script to determine if there is a character providing half cover, but that might not always be true simply based on token placement.    And as far as map features providing cover, there's no way for a script to interpret a map image to know whether cover should be granted or not.
Jarren said: And as far as map features providing cover, there's no way for a script to interpret a map image to know whether cover should be granted or not. Apologies, I should have clarified - ideally the script would use Dynamic Lighting walls/doors/windows (and maybe tokens?) to determine cover based on the amount of another token that would be visible to the selected token. But I think checkLightLevel is a good starting place. Looks like I'll have to start digging into some code. Thanks for the tips!
1695087762

Edited 1695088158
timmaugh
Pro
API Scripter
checkLightLevel is built into Fetch , so like Jarren said you can retrieve those properties at meta-speed, run conditional checks on them, and pass the result on to TokenMod. The formations are: @(selected.checklight_isbright) @(selected.checklight_total) Where you can use pretty much any token identifier in place of selected (tracker, Token Name, token id, Character Name, etc.). Post back if you can't figure out how to do that to satisfy what you're looking for.
Hi, Dit you manage to get this working? Since I am not a script writer I am very interested if you managed to get this working. I'm using TokenMod and CheckLightLevel, so I guess for someone who knows how to write scripts it would be possible to make a specific player get a custom token marker assigned whenever he is in complete darkness, and gets the marker removed when in any kind of light. Thanks in advance!