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

Radar Script isn't highlighting tokens when I run it.

1690667621

Edited 1690776135
I got the transparent token setup and the script to work, but it doesn't highlight any tokens, only show them on chat radar image. I tried new tokens from the compendium and even other pages and targets, but it's not working. I get this on chat messages: (From Radar): Unhandled exception: Cannot read properties of undefined (reading 'id') And this on my output console: "ERROR: You must specify a valid layer to create this object type." This is my current macro: !radar {{   --range|       10u   --wavespacing|  30   --wavedelay|    50   --wavelife|     200   --pinglife|     3000   --layers|       token, gm, map   --charfilter|       class: Espirito#yellow, Demonio#red, Zumbi#blue, -nondetection   --title|        Radar Mistico   --silent|       no gm   --units|        u   --graphoptions| grid circle reticle   --output| graph   --LoS| false }} Can somebody help me please?
did you check that the "player's ribbon" is on the page you trying to get the radar activated ?
Hi, Lionel! I did it, and even when my players use the radar they get this message. (From Radar): Unhandled exception: Cannot read properties of undefined (reading 'id') Lionel V. said: did you check that the "player's ribbon" is on the page you trying to get the radar activated ?
i see that you translated the npc types, did you check that the npc character sheet have the same appelation ? espirito, demonio etc...
1690748264

Edited 1690748298
David M.
Pro
API Scripter
Hmm, this sounds like a problem that was showing up in my Spawn script a while back. IIRC some time ago Roll20 changed the information in the default token JSON to no longer include a value for the layer property. I changed the Spawn script to explicitly set the layer but neglected the fact that the Radar script used a similar assumption. If your default token was created before the change, then no errors would show, but those created after the change crapped out. Try disabling your current Radar installation and manually installing the one found here . I added a single line that hardcodes the layer prior to object creation. If this works for you, I'll push this version out to one-click.
1690768663

Edited 1690775986
Yeah, I put the same data on my "class" attribute. But still doesn't work. Lionel V. said: i see that you translated the npc types, did you check that the npc character sheet have the same appelation ? espirito, demonio etc...
1690768888

Edited 1690769486
Hello, David! I tried your new code, but still the same, it shows tokens on radar image, but it doesn't highlight any tokens on map. Nothing pops on my console log, but this is the new message I get on chat: (From Radar): Unhandled exception: Unexpected token N in JSON at position 1 David M. said: Hmm, this sounds like a problem that was showing up in my Spawn script a while back. IIRC some time ago Roll20 changed the information in the default token JSON to no longer include a value for the layer property. I changed the Spawn script to explicitly set the layer but neglected the fact that the Radar script used a similar assumption. If your default token was created before the change, then no errors would show, but those created after the change crapped out. Try disabling your current Radar installation and manually installing the one found here . I added a single line that hardcodes the layer prior to object creation. If this works for you, I'll push this version out to one-click.
one last check, is the grid enabled on your map ?
Yes, I have grid enabled too. :( Lionel V. said: one last check, is the grid enabled on your map ?
1690891603
David M.
Pro
API Scripter
Dang, ok. I'll take a look at it tonight. Probably some oversight on my part. Guilherme said: Hello, David! I tried your new code, but still the same, it shows tokens on radar image, but it doesn't highlight any tokens on map. Nothing pops on my console log, but this is the new message I get on chat: (From Radar): Unhandled exception: Unexpected token N in JSON at position 1 David M. said: Hmm, this sounds like a problem that was showing up in my Spawn script a while back. IIRC some time ago Roll20 changed the information in the default token JSON to no longer include a value for the layer property. I changed the Spawn script to explicitly set the layer but neglected the fact that the Radar script used a similar assumption. If your default token was created before the change, then no errors would show, but those created after the change crapped out. Try disabling your current Radar installation and manually installing the one found here . I added a single line that hardcodes the layer prior to object creation. If this works for you, I'll push this version out to one-click.
Thank you so much, David! David M. said: Dang, ok. I'll take a look at it tonight. Probably some oversight on my part. Guilherme said: Hello, David! I tried your new code, but still the same, it shows tokens on radar image, but it doesn't highlight any tokens on map. Nothing pops on my console log, but this is the new message I get on chat: (From Radar): Unhandled exception: Unexpected token N in JSON at position 1 David M. said: Hmm, this sounds like a problem that was showing up in my Spawn script a while back. IIRC some time ago Roll20 changed the information in the default token JSON to no longer include a value for the layer property. I changed the Spawn script to explicitly set the layer but neglected the fact that the Radar script used a similar assumption. If your default token was created before the change, then no errors would show, but those created after the change crapped out. Try disabling your current Radar installation and manually installing the one found here . I added a single line that hardcodes the layer prior to object creation. If this works for you, I'll push this version out to one-click.
1690925698
David M.
Pro
API Scripter
Ok, so my bad. I was in a hurry before and didn't notice the new error I had created. Sorry for the inconvenience.  I've updated the temp version here . Tested it with a brand new instance of the RadarPing character to insure the layer was being assigned properly.   I'm optimistic that this will solve your problem, but let me know if it's still not working for you correctly (there could still be other unrelated issues to resolve).
1690943558

Edited 1690943717
David, you solved it! It's working for me now, the radar is highlighting tokens on map! Thank so much! Sometimes I get some waves stuck on screen, but if I restart API Sandbox and refresh my browser,  it disapears. Nothing pops on chat or on my console log. I don't know if my players can see it too. David M. said: Ok, so my bad. I was in a hurry before and didn't notice the new error I had created. Sorry for the inconvenience.  I've updated the temp version here . Tested it with a brand new instance of the RadarPing character to insure the layer was being assigned properly.   I'm optimistic that this will solve your problem, but let me know if it's still not working for you correctly (there could still be other unrelated issues to resolve).
1690971514
David M.
Pro
API Scripter
Great! Can't say I've ever seen waves get stuck like you mentioned. It's interesting that a browser refresh makes them go away.. I'll have to think about that one for a bit.
Thank you so much for your help, you were amazing! Will you put this into One-Click install? So I can get updates when they come. David M. said: Great! Can't say I've ever seen waves get stuck like you mentioned. It's interesting that a browser refresh makes them go away.. I'll have to think about that one for a bit.
1690989449
David M.
Pro
API Scripter
Yes, though the earliest this would push out would be Tuesday of next week, based on Roll20's typically schedule. 
1691008575
David M.
Pro
API Scripter
Regarding the wavefront path objects not disappearing until a browser refresh: I asked a couple more knowledgeable folks about it.  With the information given so far, the leading thought is some kind of browser-related issue, or possibly a Roll20 race condition. If it happens again, can you try to look in the developer console of your browser for any errors? For example, if using Chrome you can right-click-> inspect and then navigate to the Console. What browser are you using, btw?
1691014382

Edited 1691014587
Ah sure, I can do it, no problem. Thanks again for solving this, Radar script is so nice! And I'll be waiting for one-click install as well. I'm using Firefox Browser 116.0 (64 bits) if I get waves stuck again, I'm gonna check the console. David M. said: Regarding the wavefront path objects not disappearing until a browser refresh: I asked a couple more knowledgeable folks about it.  With the information given so far, the leading thought is some kind of browser-related issue, or possibly a Roll20 race condition. If it happens again, can you try to look in the developer console of your browser for any errors? For example, if using Chrome you can right-click-> inspect and then navigate to the Console. What browser are you using, btw?
1691327254
David M.
Pro
API Scripter
Ok, I put in the pull request for the latest version. Assuming all goes well this should go through during this week's merge by Roll20 staff (usually by EOB Tuesday).
David, I tested on Sunday the Radar script is highlighting tokens for me, but it's not working for my players. They can't see any highlights, just radar img on chat. David M. said: Ok, I put in the pull request for the latest version. Assuming all goes well this should go through during this week's merge by Roll20 staff (usually by EOB Tuesday).
1691614389
David M.
Pro
API Scripter
The script sets the controlledby property of the momentary RadarPing tokens to the playerID that initiated the api call. So the pings will only be visible to the person that ran the macro (and any GMs). If only the GM runs the macro, then only they will see the ping tokens. If you want a player to see the pings, then have them run the macro. Related: the wavefronts have to be visible to everyone (as they are just drawings on the map), and chat output can be configured to be whispered to the player (with optional cc to the GM) or public to everyone.    
1691614436
David M.
Pro
API Scripter
FYI, I got a notification that the latest version of the script was pushed out to 1-click.
If this suggestion for an aura to only display the outer border  was implemented, then it would be possible to have the Radar script create a transparent token with permissions for only the players who should see the pings, and then use the aura outline to show the pings only to those players.  So please upvote it and see if it is something that Roll20 can implement!  With the recent update to the Measure tool, perhaps it is already on the horizon.
I got it! But I gave permission to my players use the Radar Macro. They see the chat outputs, but anyone but me (GM) can see highlights on map. They also can see the waves from the radar. David M. said: The script sets the controlledby property of the momentary RadarPing tokens to the playerID that initiated the api call. So the pings will only be visible to the person that ran the macro (and any GMs). If only the GM runs the macro, then only they will see the ping tokens. If you want a player to see the pings, then have them run the macro. Related: the wavefronts have to be visible to everyone (as they are just drawings on the map), and chat output can be configured to be whispered to the player (with optional cc to the GM) or public to everyone.