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

API Update 6/3: toFront/toBack, Optimized Saving

There's a new update out the API today. In particular: toFront/toBack You can now use the toFront(obj) and toBack(obj) commands to move objects to the front/back of the page. Note that this doesn't translate across layers, so for example calling toFront on a map layer object still doesn't put it above the GM Layer objects. This should be functionally similar to the way that right-clicking and hitting toFront/toBack in-game works. Better Optimized Saving Now if you rapidly update the same object really quickly (so for example, you issue a bunch of individual set() calls on an object in the same function), the API server will be smart enough to combine those into a single update call so that all of them are sent to the players at once. This is a small optimization that should just make it easier for you to not have to worry about grouping your set() calls together if it makes more sense to do them in different places throughout your scripts. Thanks!
TO THE API SCRIPT EDITOR!!! Thanks for adding those toFront/toBack functions... it's going to be a play day for me!
1370282604
Konrad J.
Pro
API Scripter
toFront/toBack, awesome.  That will help with a few ideas I've had.
I suppose this is why my "animations" are running a lot smoother now. Looks good.
Melvin McSnatch said: I suppose this is why my "animations" are running a lot smoother now. Looks good. I may have had those in mind when I made that optimization, it's true :-)