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

token-mod to change token image

Hi, I'm kind of new to coding macros and I am trying to have a macro give the player an option to change a token Image.  I found the various code that I want to combine.

This gives the looking and functionality I want:

!token-mod {{--set ?{Choose Setting

|Normal,currentside#1

|Werewolf,currentside#2

}

}}


These provide the function to change to image:

!token-mod --set imgsrc|https://s3.amazonaws.com/files.d20.io/images/346082247/7ktc0T9W_efWbZvMTIe7_A/med.png?1686708664

!token-mod --set imgsrc|https://s3.amazonaws.com/files.d20.io/images/350289433/NNprLdVicAV-KUA-AJMJBA/med.png?1689359604


I've tried multiple things and just can't figure it out. How do I combine them into one macro?

Thanks in advance!
July 16 (2 years ago)
Gauss
Forum Champion

You could just use a Rollable Token, the player can change the image on their own without an API script. 

I know, I was just trying to figure this out.  Individually these work.  I was just trying to combine them.

!token-mod --set imgsrc|https://s3.amazonaws.com/files.d20.io/images/346082247/7ktc0T9W_efWbZvMTIe7_A/med.png?1686708664

!token-mod --set imgsrc|https://s3.amazonaws.com/files.d20.io/images/350289433/NNprLdVicAV-KUA-AJMJBA/med.png?1689359604

I figured it out.


!token-mod {{--set imgsrc|?{Choose Form

|Normal,https://s3.amazonaws.com/files.d20.io/images/346082247/7ktc0T9W_efWbZvMTIe7_A/med.png?1686708664

|Werewolf,https://s3.amazonaws.com/files.d20.io/images/350289433/NNprLdVicAV-KUA-AJMJBA/med.png?1689359604

}

}}

July 16 (2 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

You can delete the cache busting codes if you like: ?1686708664

Also, you could check out the Faces script in One Click. It provides a graphic interface to change token images, as well as name, GM Notes, and Tooltip.