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

is Token Replace possible with the API?

Could you, for instance, have a token of a character model and then another one of the same image in greyscale, then, once that token takes its turn, have a script or macro that will automatically replace the color token with the greyscale one and carry over any attributes? I understand it may take a bit of work to make that script, I just want to know if it is possible.
You can change the imgsrc property of a token, but you can only set it to stuff that's in your library. So if the images in question are in your library, then it's quite doable; if they're from the marketplace or somewhere else, then you'd have to copy them into your library in order to do it.
well, having them in my library is easy enough I suppose, thank you for your reply. I think that does it for me, I will be a Mentor next week.
I'm not extremely familiar or savvy with them yet, but you may be able to use a token rollable table and an API for this. The table would tie the images together for the token, and I've seen API scripts that can switch between the images within a rollable table. <a href="https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Creating_a_Rollable_Table_Token" rel="nofollow">https://wiki.roll20.net/Card_Decks_and_Rollable_Tables#Creating_a_Rollable_Table_Token</a>
1432914692
The Aaron
Pro
API Scripter
That's a fantastic suggestion, but sadly the changes made to the side property of tokens (which changes when you adjust the rollable table token) are not respected by the system, so you still end up with the problem of not being able to set a marketplace asset url in the imgsrc of a token. I've brought this up, and I'm hoping change will be forthcoming. Also, just for complete clarity, it doesn't have to be in YOUR user library, just A user library.
I also notice that you lose stuff like the bars when you are using Rollable/Multiple Tokens. Hopefully that will be addressed as well. :)
1432916476
The Aaron
Roll20 Production Team
API Scripter
Ah! One of your charitable and loving moderators has actually documented the fix for that just for you (and others like you!): By default, a Rollable Table Token will be marked as Is Drawing . This prevents it from snapping to the grid, and hides it's bars, bubbles, etc. To make it behave like a normal Token, you'll need to right click it, choose " Advanced ", then click " Is Drawing ".
Wow... it is really that simple, Aaron? You're making me feel quite d'uh now. &gt;.&lt;
1432920415
The Aaron
Pro
API Scripter
Ha! yeah, it is really that simple, or !token-mod --off isdrawing If you want to do a whole bunch at once. =D Don't feel bad, it took me a while to figure that out, as it's simple, but not obvious.
That will work perfectly for my purposes! thank you very much.
1432925363
The Aaron
Pro
API Scripter
Great!