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

Do "toBack" and "toFront" work in Jumpgate?

In setting an area of effect using the RPGMaster !rounds --aoe command, I use a toBack(graphic_object)  call using the Roll20 utility function call to push the area of effect graphic under the other tokens on the token layer.  However, in testing RPGMaster with Jumpgate I have found this call does not seem to be doing anything.  The exact same code works fine in the Classic desktop, and I was expecting it to port without change? Has anyone else seen this with their APIs?  Do I need to change the call so that it works with both Classic and Jumpgate?
1747382517

Edited 1747382730
Richard @ Damery
Pro
API Scripter
Update:  playing with this a bit more, there seem to be some conditions that I can't put my finger on that seem to affect the success of a toBack() call.  After a few uses and me manually pushing the area of effect graphic to the back using the right-click menu, the graphic now seems to always appear at the back of the drawing stack for the token layer.  This was a newly created campaign in Jumpgate, using the module "Tammeraut's Fate", so a number of tokens were already on the map, the ones that came with the module. I'll play a bit more and see if I can recreate the conditions that cause the initial issue. But in the mean time, if anyone has any pointers please do post them here.
Further Update: I can reliably recreate the issue in Jumpgate by dropping two new characters onto the token layer to drop their tokens, then running the !rounds --aoe  command to create a circular area of effect that covers all the tokens (which calls the toBack(graphic_object)  command), and the area of effect graphic appears but is not pushed to the back of the token layer, so that two of the three tokens are underneath it and are not selectable without manually pushing the area of effect graphic to the back using the right-click menu.
Hi, I've had the same issue for a while now on a newly game created as a jump gate game. I'm hoping this something that will get fixed at some point
1747502775
Gold
Forum Champion
Hopefully Roll20 Team The Aaron will see this question and be able to answer it or fix it 
1747778652

Edited 1747778716
Seb
Pro
Taking a shot in the dark here. But could this issue also be related to Samart AoE not properly working in Jumpgate? <a href="https://app.roll20.net/forum/post/12349884/smartaoe-controltoken-spawns-behind-its-colored-squares" rel="nofollow">https://app.roll20.net/forum/post/12349884/smartaoe-controltoken-spawns-behind-its-colored-squares</a> <a href="https://app.roll20.net/forum/post/12193888/script-smartaoe-anyone-using-it-in-a-jumpgate-campaign-successfully" rel="nofollow">https://app.roll20.net/forum/post/12193888/script-smartaoe-anyone-using-it-in-a-jumpgate-campaign-successfully</a>
1748624001

Edited 1748624941
Richard @ Damery
Pro
API Scripter
Fixed my issue So I have found a difference in how Jumpgate &amp; Legacy works with toBack() and toFront() and perhaps also with obj.set().&nbsp; The following code works well in Legacy: crossHair = createObj('graphic', { _type: 'graphic', _subtype: 'token', _pageid: pageid, isdrawing: 1, name: fields.crossHairName, imgsrc: chImg, layer: 'objects', width: 70, height: 70, left: chLeft, top: chTop, rotation: chRotation, represents: chOwnerID, }); if (crossHair &amp;&amp; !confirmedDrop) { crossHair.set({aura2_color:colors.GREEN,aura2_radius:range}); } toFront(crossHair); // ... many lines of other code ... sometimes with player interaction hence the toFront() call crossHair.set({tint_color:(colors[aoeImage.toUpperCase()] || 'transparent'), &nbsp; &nbsp;left:chLeft, &nbsp; &nbsp;top:chTop, &nbsp; &nbsp;height:chHeight, &nbsp; &nbsp;width:endWidth, &nbsp; &nbsp;imgsrc:chImage, &nbsp; &nbsp;represents:charID}); toBack(crossHair); However, in Jumpgate, clearly the timings of the createObj(), obj.set() and toBack(obj) are different, and perhaps have become asynchronous (?).&nbsp; Whatever the case, things are not happening in the same order that they do in Legacy.&nbsp; So I have changed the code to the following: crossHair = createObj('graphic', { _type: 'graphic', _subtype: 'token', _pageid: pageid, isdrawing: 1, name: fields.crossHairName, imgsrc: chImg, layer: 'objects', width: 70, height: 70, left: chLeft, top: chTop, rotation: chRotation, represents: chOwnerID, }); if (crossHair &amp;&amp; !confirmedDrop) { crossHair.set({aura2_color:colors.GREEN,aura2_radius:range}); } toFront(crossHair); // ... many lines of other code ...&nbsp; &nbsp; sometimes with player interaction hence the toFront() call setTimeout( () =&gt; crossHair.set({tint_color:(colors[aoeImage.toUpperCase()] || 'transparent'), &nbsp; &nbsp;left:chLeft, &nbsp; &nbsp;top:chTop, &nbsp; &nbsp;height:chHeight, &nbsp; &nbsp;width:endWidth, &nbsp; &nbsp;imgsrc:chImage, &nbsp; &nbsp; represents:charID}), &nbsp;500); setTimeout( () =&gt; toBack(crossHair), 1000); Everything then works absolutely fine in Jumpgate - the area of effect graphic is snapped underneath the tokens once the toBack() executes.