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

Purging Tokens From Map Layer

Hello all, I've searched extensively for an easy method to clear the map layer of specific tokens. To clarify, I use the Blood and Honor script to add blood pools and trails as my PCs take damage. It's a neat script, but aside from going in and removing the blood by hand there doesn't seem to be any way to delete these. If there is a quick and easy way to do this, I would really appreciate if someone could point me to a script that can accomplish this. 
In the thread&nbsp;<a href="https://app.roll20.net/forum/post/1477230/script-blood-and-honor-automatic-blood-spatter-pooling-and-trail-effects-lightweight/?pageforid=1477230" rel="nofollow">https://app.roll20.net/forum/post/1477230/script-blood-and-honor-automatic-blood-spatter-pooling-and-trail-effects-lightweight/?pageforid=1477230</a> It says: The !clearblood command will move all of the blood splatter graphics to the top left corner of the map so that they can be quickly deleted.
I really appreciate that, not sure how I missed it.
It can be hard to keep track of the commands for all the MODS we use. I'm always going back to the script-related threads looking for stuff that I forgot.
So to be absolutely clear, is there not a way for javascript to delete the graphics instead of just moving them into the corner? The fact it moves them all to one spot is nice, but after a long battle you can spend a great deal of time selecting blood tokens and pressing delete. Also, the fact they lie on the map layer means that it's possible to select your map instead of one of the tokens and you could easily poof your map.
1682890912
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If the script can collect and move them, it must be possible to delete them. If it collects them in an object, the function would be something like: &nbsp; &nbsp; &nbsp; &nbsp; foo.forEach(o =&gt; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o.remove(); &nbsp; &nbsp; &nbsp; &nbsp; });
That worked, thank you Keith that's a lot of work taken care of with a push of a&nbsp; button. Appreciated.
1682893742
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Huzzah! I had to be instructed on the use of .remove, since it is a regular old JS function, and not something (as I thought it would be) specific to Roll20's implementation.