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

Shapeshifter token change

Hi all, I would like to be able to change a token for my player who is a druid shapeshifter. I have downloaded the ModifyTokenImage api, and it works great. My question is, if I create a macro button for him that will produce a drop down list of the animals he can change into, how do I use the submitted name to call the appropriate token from the handouts in his journal? I can do it manually, but would like to automate it a little. E.G. /r ?{Which animal are you changing to? |Leopard|Hawk|Wolf} !ModifyTokenImage --set ( ????? How do I get his choice here???) Any help very much appreciated
/r ?{Which animal are you changing to? |Leopard|Hawk|Wolf} !ModifyTokenImage --set ?{Which animal are you changing to? } You have to make sure that the query names match exactly .  In your first query you have a space between the ? and the |, so you need to have that space there when you reference the query again. 
Thanks Jarren K, this works when I run the macro, but when I put it as a token action button for the player, he gets the drop down menu, but then it doesn't change the token on selection. Is this something to do with the ModifyTokenImage api do you think?
1626165746

Edited 1626165879
Bast L.
Pro
API Scripter
Taking a look at the script, lines 11 and 124&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/blob/master/ModifyTokenImage/1.0.4/modifytokenimage.js" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/blob/master/ModifyTokenImage/1.0.4/modifytokenimage.js</a> I see that there's a setting for whether or not non-GMs can send commands, and the default is set to true. I'd check for a setting to change in a script menu, or barring that, copy and paste the script instead of using a dropdown, and change the value on line 11 to "false". Edit: maybe just typing " !ModifyTokenImage gm"
Bast L. - thanks, that worked a treat
1626167504
Bast L.
Pro
API Scripter
Yay
Bast L., it would appear I was a bit premature in my statement. Although I can get it to work, and if I select the token of the druid it will work, but if the player tries - it still doesn't work. I'm just learning how to do macro's, so scripting (or whatever it's called) is beyond me. I was just hoping there was an easy solution. Many thanks
1626239691
Bast L.
Pro
API Scripter
If the gm restricted setting is showing as changed, I wonder if it's not an art asset issue. IIRC, the wiki says something about not being able to manipulate non-uploaded art via the API, but I've had very inconsistent results for this. Sometimes I have been able to, other times not. One thought, regarding art manipulation, is to make another new character, assign it some new art, assign it to the player, and see if that one works when trying to change to another, entirely different image. IIRC, someone had trouble with my druid shift script, and we discovered that it was a specific sheet or art that was the issue, maybe. Also, just for testing, make sure to upload the art for both the new character, and the target image, rather than roll20 art (you could always copy the art, save it, re-upload, if this works out).
1626261342
David M.
Pro
API Scripter
Have you checked out the Wildshape script? It handles not only image/size, but changing attributes &amp; attacks, etc. No druids in my game, but lots of people swear by it!
Hi David, thanks for the reply. We play 2nd edition D&amp;D, would you know if that script works with that edition, or is it just 5th? Many thanks
1626299731
David M.
Pro
API Scripter
Hmm, yeah it's 5e-specific as I recall. Another option is to handle it with a rollable table token and something like this token-mod solution . Or just go with the ModifyTokenImage script as you were! :)