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

[Script] Dancing Light API - dim light distance?

Hello, I found a video discussing a script to create a token for spiritual weapon and it worked great.&nbsp; I'm trying to create one for dancing lights with the same setup and I have it working all the way to the dim light distance.&nbsp; I was able to enable low light in the dynamic light tab, but can't seem to move the distance from 0.&nbsp; Is there something I'm missing?&nbsp; Please see. &nbsp;createObj("graphic",{ &nbsp; &nbsp; &nbsp; &nbsp; left:tok.get("left")+70, &nbsp; &nbsp; &nbsp; &nbsp; top:tok.get("top"), &nbsp; &nbsp; &nbsp; &nbsp; height:70, &nbsp; &nbsp; &nbsp; &nbsp; width:70, &nbsp; &nbsp; &nbsp; &nbsp; pageid:tok.get("pageid"), &nbsp; &nbsp; &nbsp; &nbsp; layer:"objects", &nbsp; &nbsp; &nbsp; &nbsp; imgsrc:"<a href="https://s3.amazonaws.com/files.d20.io/images/281027886/5u_UzeitO3xGTPPR39qZIg/thumb.png?16502084885" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/281027886/5u_UzeitO3xGTPPR39qZIg/thumb.png?16502084885</a>", &nbsp; &nbsp; &nbsp; &nbsp; name:tok.get("name") + "'s Dancing Lights!", &nbsp; &nbsp; &nbsp; &nbsp; controlledby:player.get("id"), &nbsp; &nbsp; &nbsp; &nbsp; emits_low_light:true, &nbsp; &nbsp; &nbsp; &nbsp; light_dimradius:"10", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });
1650216319
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Wicket35! Which dynamic lighting system are you using? The attribute names are different.&nbsp;&nbsp;It's impossible to answer your question without knowing which.&nbsp; This page should help guide you for UDL or LDL .
1650223811

Edited 1650223990
Wicket35 said: Hello, I found a video discussing a script to create a token for spiritual weapon and it worked great.&nbsp; I'm trying to create one for dancing lights with the same setup and I have it working all the way to the dim light distance.&nbsp; I was able to enable low light in the dynamic light tab, but can't seem to move the distance from 0.&nbsp; Is there something I'm missing?&nbsp; Please see. &nbsp;createObj("graphic",{ &nbsp; &nbsp; &nbsp; &nbsp; left:tok.get("left")+70, &nbsp; &nbsp; &nbsp; &nbsp; top:tok.get("top"), &nbsp; &nbsp; &nbsp; &nbsp; height:70, &nbsp; &nbsp; &nbsp; &nbsp; width:70, &nbsp; &nbsp; &nbsp; &nbsp; pageid:tok.get("pageid"), &nbsp; &nbsp; &nbsp; &nbsp; layer:"objects", &nbsp; &nbsp; &nbsp; &nbsp; imgsrc:"<a href="https://s3.amazonaws.com/files.d20.io/images/281027886/5u_UzeitO3xGTPPR39qZIg/thumb.png?16502084885" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/281027886/5u_UzeitO3xGTPPR39qZIg/thumb.png?16502084885</a>", &nbsp; &nbsp; &nbsp; &nbsp; name:tok.get("name") + "'s Dancing Lights!", &nbsp; &nbsp; &nbsp; &nbsp; controlledby:player.get("id"), &nbsp; &nbsp; &nbsp; &nbsp; emits_low_light:true, &nbsp; &nbsp; &nbsp; &nbsp; light_dimradius:"10", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); If you can find Nick Olivo's youtube channel about guides for roll20, he has a video that showcases a script called Spawndefaulttoken API.&nbsp; He walks you through how to make exactly what you want without having to make your own script.&nbsp; The API mentioned is in the one click and the author is very active in the forums incase you run into any issues.&nbsp;&nbsp; <a href="https://youtu.be/9vp8ycxi3VA" rel="nofollow">https://youtu.be/9vp8ycxi3VA</a>
keithcurtis said: Hi Wicket35! Which dynamic lighting system are you using? The attribute names are different.&nbsp;&nbsp;It's impossible to answer your question without knowing which.&nbsp; This page should help guide you for UDL or LDL . Sounds I can't pull from both.&nbsp; One or the other.&nbsp; Good to know.&nbsp; In that case, let's say UDL.
DM Eddie said: Wicket35 said: Hello, I found a video discussing a script to create a token for spiritual weapon and it worked great.&nbsp; I'm trying to create one for dancing lights with the same setup and I have it working all the way to the dim light distance.&nbsp; I was able to enable low light in the dynamic light tab, but can't seem to move the distance from 0.&nbsp; Is there something I'm missing?&nbsp; Please see. &nbsp;createObj("graphic",{ &nbsp; &nbsp; &nbsp; &nbsp; left:tok.get("left")+70, &nbsp; &nbsp; &nbsp; &nbsp; top:tok.get("top"), &nbsp; &nbsp; &nbsp; &nbsp; height:70, &nbsp; &nbsp; &nbsp; &nbsp; width:70, &nbsp; &nbsp; &nbsp; &nbsp; pageid:tok.get("pageid"), &nbsp; &nbsp; &nbsp; &nbsp; layer:"objects", &nbsp; &nbsp; &nbsp; &nbsp; imgsrc:"<a href="https://s3.amazonaws.com/files.d20.io/images/281027886/5u_UzeitO3xGTPPR39qZIg/thumb.png?16502084885" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/281027886/5u_UzeitO3xGTPPR39qZIg/thumb.png?16502084885</a>", &nbsp; &nbsp; &nbsp; &nbsp; name:tok.get("name") + "'s Dancing Lights!", &nbsp; &nbsp; &nbsp; &nbsp; controlledby:player.get("id"), &nbsp; &nbsp; &nbsp; &nbsp; emits_low_light:true, &nbsp; &nbsp; &nbsp; &nbsp; light_dimradius:"10", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); If you can find Nick Olivo's youtube channel about guides for roll20, he has a video that showcases a script called Spawndefaulttoken API.&nbsp; He walks you through how to make exactly what you want without having to make your own script.&nbsp; The API mentioned is in the one click and the author is very active in the forums incase you run into any issues.&nbsp;&nbsp; <a href="https://youtu.be/9vp8ycxi3VA" rel="nofollow">https://youtu.be/9vp8ycxi3VA</a> I will check this out.&nbsp; Thank you Eddie.
1650233282
The Aaron
Roll20 Production Team
API Scripter
emits_low_light is for UDL and light_dim radius is for LDL. you need low_light_distance instead. For UDL properties, see:&nbsp; <a href="https://wiki.roll20.net/API:Objects#Graphic_.28Token.2FMap.2FCard.2FEtc..29" rel="nofollow">https://wiki.roll20.net/API:Objects#Graphic_.28Token.2FMap.2FCard.2FEtc..29</a>
What is strange is that I can change any other attribute in UDL....enable bright light, set the bright light distance, enable light vision, etc....just not low_light_distance.&nbsp; I tried setting it before the emits_low_light.&nbsp; I tried disabling the other APIs that are in this campaign thinking one is interfering.&nbsp; I can just use the bright light distance and should be fine for what I'm doing. Also will look into the !spawn token mod and see if it will do lighting as well.&nbsp; If it can, then I'm golden that way too.
!spawn for the win.&nbsp; Thanks everyone for the assist.