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

Targeting Map Squares/Hexes

So I had an idea but I figured it would already have been explored. Could anyone tell me why this idea might NOT work? Make an API script that fills any unoccupied hex/square with a transparent token. Allow collision and stacking with that token so it doesn't disrupt token drops and simply remove the token if any graphic is added to that location. If it then becomes unoccupied, replace the transparent token. The game would allow you to target the tokens, no?
1585231460
The Aaron
Roll20 Production Team
API Scripter
That would work.  The biggest problems I see are: Drag selecting for the GM wouldn't work as you'd constantly be selecting the invisible tokens and not beginning a drag Keeping those up-to-date might be a bit of an onerous task, particularly if any tokens are strangely sized.
1585231935

Edited 1585231982
could I just use  getElementById ( ). style . pointerEvents = "none"   (a piece of code that started this train of thought) to edit the tokens to only be clickable after a request for target selection?  EDIT: I'm not even sure we'd have access to attributes like that from API scripts
1585232116
The Aaron
Roll20 Production Team
API Scripter
We don't have access to those things from the API.  =D
Well if those are the biggest problems then I can just get around the dragging issue with a function that selects the corners. This would probably be better since it would allow polygon selections and radial selections from a single point
1585232536
The Aaron
Roll20 Production Team
API Scripter
I'm not sure we're talking about the same thing here.&nbsp; I'm talking about the GM moving the mouse over and clicking, then dragging the rectangle over a bunch of tokens.&nbsp; That's a UI thing on the Client, which the API does not have access to. You might find this suggestion of interest:&nbsp; <a href="https://app.roll20.net/forum/post/8004495/api-it-would-be-great-to-get-an-event-when-a-shift-ping-happens" rel="nofollow">https://app.roll20.net/forum/post/8004495/api-it-would-be-great-to-get-an-event-when-a-shift-ping-happens</a>
1585233144

Edited 1585233473
Yea I mean a bootleg way to replace that would be to have the MapClicker script have a [!selection --polygon x]&nbsp; command that prompts for targets and then uses those coordinates to make a box selection using those targets (the transparent tokens) as corners. That would circumvent the issue about not being able to drag select. And it would allow an option like [!selection radial x] to target one of the transparent tokens and make a selection that includes all coordinates x distance from the target (the transparent token) GMs could just include that in a macro bar and it'd be a fairly quick transaction