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

VERY minor bug: api object placement accepts strings for top and left, but dynamic lighting layer expects numbers.

1484302971

Edited 1484303002
plexsoup
Marketplace Creator
Sheet Author
API Scripter
When creating and setting parameters for graphic objects using the API, "top" and "left" expect numbers but accept strings. However, for purposes of dynamic lighting, the engine only responds well to numbers. The strings seem to get converted to numbers, but only once the object is selected or moved by someone. --- From  other thread :  When i drop tokens, the light doesn't show up. If I look at the token details, they appear to have all the correct settings for light radius and dim light radius. If I then select the (unlit) tokens on the map, they suddenly start emitting light. Here's a video of the strange behaviour in action  ----------------- Found my bug! For anyone curious... var movementPath = token.get("lastmove"); // produces a string of comma delimited numbers. var travelLocationsArray = token.get("lastmove").split(","); // produces an array of strings, not numbers. //var X = travelLocationsArray[0]; // is a string. var X = Number(travelLocationsArray[0]); // works better // don't try creating dynamically lit objects with strings as parameters for "left" and "top". They'll go where you expect, but won't be lit until moved.
1485809458
Gid
Roll20 Team
My apologies for the delay on my response to this. This past week I was in the process of completely restructuring our bug ticket system to be, hopefully, more orderly. Thank you for bringing this to my attention. I'll add a ticket for this, so that we can filter out strings for those DL values.