maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Feature]: Add lumens to getInfo()

Open Lector opened this issue 1 year ago • 0 comments

Feature Request

Hi. I have a pretty complicated lighting-system. When attacking a token im calculating a modifier depending on how bright the target is illuminated. Thats worked fine so far. Now im going to add support for magical darkness. I mentioned that this is possible my adding a lumens-property to all my light-sources and it all works well for the visuals. But how do i get the lumens of a light in my script? I used getInfo() by now to determine the max range of the lightsource but now i need the lumens to differ between light and dark. https://wiki.rptools.info/index.php/getInfo

I have lumens in the light definition. It also works well in the visuals with negative lumens for magical darkness. When printing the lumens to the output i have no entry for lumens. thats what i get:

{"name":"Darkness QS1 1","max range":2,"type":"NORMAL","light segments":[{"paint":{"color":-11513776},"facingOffset":0,"radius":2,"arcAngle":90,"shape":"CIRCLE","isGM":false,"ownerOnly":false}]}

And that is my entry in the light-settings Darkness QS1 1: circle 2#505050 lumens=-1

The Solution you'd like

Add a field "lumens" to the data getInfo() generates for every lightsource.

Alternatives that you've considered.

The only alternative i can imagine is to determine the lumens in code manually by checking the name of the lightsource. But i do not like this solution because i have to change my code every time i add an additional source of light or darkness.

Additional Context

No response

Lector avatar Aug 30 '22 18:08 Lector