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

Token Mod and UDL - Directional Light Change in macro not Applying

Hi everyone, I have a macro (that relies on token mod) that I used to easily change token sight/light with a single click to represent darkvision, different types of light sources and magical effects. I was trying to update it to UDL yesterday and while most of it is fine, I am having an issue with the Directional Light. More specifically when I run the macro the directional light doesn't seem to be applied. However when I check the token the directional light has been switched on and a direction has been set. If I click into the direction box and click save settings then it works. Anyone have any ideas on whether this is fixable or a consequence of how UDL currently works? The macro code is (the directional element is currently only on the final line in the Bullseye Lantern part): ?{Light |Human,!token-mod --set has_night_vision|1 --set night_vision_distance|15 --set emits_bright_light|0 --set emits_low_light|0 ; |Half Darkvision,!token-mod --set has_night_vision|1 --set night_vision_distance|60 --set emits_bright_light|0 --set emits_low_light|0 ; |Full Darkvision,!token-mod --set has_night_vision|1 --set night_vision_distance|120 --set emits_bright_light|0 --set emits_low_light|0 ; |Torch,!token-mod  --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|20 --set low_light_distance|20 ; |Hooded Lantern Open,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|30 --set low_light_distance|30 ; |Hooded Lantern Closed,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|0 --set low_light_distance|15 ; |Candle,!token-mod !token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|5 --set low_light_distance|15 ; |Camp,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|35 --set low_light_distance|35 ; |Cantrip,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|20 --set low_light_distance|20 ; |Daylight Cantrip,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|60 --set low_light_distance|60 ; |Produce Flame,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|10 --set low_light_distance|10 ; |Flametongue,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|40 --set low_light_distance|40 ; |Holy Symbol of Ravenkind,!token-mod --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|30 --set low_light_distance|30 ; |Bullseye Lantern Test,!token-mod --set has_directional_bright_light|1 --set has_night_vision|0 --set emits_bright_light|1 --set emits_low_light|1 --set bright_light_distance|60 --set low_light_distance|60 --set directional_bright_light_total|60 --set directional_bright_light_center|0} Feel free to grab it if you like, however you will note that I used  |  instead of  |  in the rows, this is substituted when saving the macro, however a consequence of this approach is that if you open the macro it goes weird and you need to cut and paste back in again to get it to work.
1614256473
Andreas J.
Forum Champion
Sheet Author
Translator
There are some things for UDL that isn't yet supported in APIs, but not sure if this is one of them. When more UDL stuff becomes available to APIs in general, Aaron will be quick to update tokenmod to support these features.
1614258717
The Aaron
Roll20 Production Team
API Scripter
This is broken in Roll20's API UDL support. If you run the macro, then open the token properties and save, it should apply the change, as you've noted. (You shouldn't need to click in the input box). There was a fix for this in December, but it had to be rolled back. I know their are working on a new fix to it—I hope it will be our soon.  Side note, you can use # instead of | as a separator for TokenMod commands: !token-mod --set rotation#90 bar1#35 name#"Bob the Slayer" That lets you avoid all the | stuff.
Thanks for confirming, that's good to know. And thanks for the tip, will make it much easier to make changes in future!