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 .
×

Deleting tokens in code

On one of my pages, I had three tokens all representing the same character. I could only actually see one (I think I deleted the image that the other two used). In code, I can see these two degenerate tokens, and they get picked up by code and interfere with my scripts. I can reassign images to them, move them, and do other things....(maybe...it is hard to tell whether you are having an effect when you can't see the tokens)....but I just want them gone. Is there a delete method I can use?
I think the API is incapable of deleting things, but I will let much smarter people give you a better answer hopefully soon
By both reassigning the image and settiing the sizes to 70 and the location to a known place I was able to see and manually delete the troublesome wights, but I'd still like to know if there is an automated way to delete them.
1410650080
The Aaron
Roll20 Production Team
API Scripter
Jake is correct. The API currently cannot delete anything. Many of my scripts move "deleted" things to the upper left corner of the GM layer and size them in a single grid.
1410650698
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
We need delete... has the rationale for not having delete been given?
1410652015
The Aaron
Roll20 Production Team
API Scripter
I don't know if it has, but my guess is that it's to prevent accidentally seriously pwning your campaign. I was considering writing a script that would handle create and delete of objects (including the fire base fix) by having a page it moved "deleted" objects to, then checking if objects of the right type exist there first and providing them as kind of a reuse pool when create is called.
I had a similar issue before on one of my maps where an API insisted the token was invisible and in the center of the map, even though the real token was visible and moving around. It seemed to clear itself up when I did an overall map and script clean-up.
1410657063
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Aaron said: I don't know if it has, but my guess is that it's to prevent accidentally seriously pwning your campaign. I was considering writing a script that would handle create and delete of objects (including the fire base fix) by having a page it moved "deleted" objects to, then checking if objects of the right type exist there first and providing them as kind of a reuse pool when create is called. _pageid is read only :/ So you can't move them off page. You could duplicate the page... (minus what you don't want) and archive the page.... but player book mark or being on the page might hose you. And still... doesn't help with attributes, character sheets, etc... and you would have double of a bunch of stuff. If the reason is screwing up your campaign.... 1) If its your API that is on you. 2) If its someone else's API you used.... make a campaign property that turns off the delete feature that is read only to API (set in campaign settings.) If you flipped that switch and ran an API... that is on you. Wonder if its bandwidth thingy.