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

Showing Character Tokens in Templates

Hello. I want to have a character's Token show up when they use a certain macro. For example, if Bill was to attack I would want the resulting template showing up in the chat windo to begin with Bill's token image. Can this be done with a general macro pull (such as something like @{selected|token_img} or whatever? So I don't have to personalize it for each person?
The player can select their character name in the "As" box at the bottom of the chat. When they do anything that will populate into the chat, it will show their character name and token at the start. You, as the GM, can do the same as any monster or NPC.
1597968663

Edited 1597968896
Oosh
Sheet Author
API Scripter
If you want the token image in the actual macro, you will need to use the [img](image.location/filename.png) method to link it. Rather than hard code your macros, you're better off storing the image link as an Attribute on the sheet and referencing that from your macros: using @{selected|token_img} as an example: - open character sheet, click Edit in the top right - right click on the avatar/token artwork and Copy Image Location (depending on browser) - paste the address into a text editor, it should look something like: <a href="https://s3.amazonaws.com/files.d20.io/images/1021247521/8aoeifjgK3JWEQFvlDc7EQQ/max.png" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/1021247521/8aoeifjgK3JWEQFvlDc7EQQ/max.png</a> ?1580117032 - either remove the underlined bit off the end from the question mark on, or add #.png on the end. Either works - save that on the character sheet on the Attributes &amp; Abilities tab as an Attribute called token_img - you can now use [img](@{selected|token_img}) in a macro to output the token art for any character where you've set the Attribute to the image location You can also use a token bar to store the link, that way you can show artwork that isn't linked to a character sheet. It depends on whether or not you've got an unused bar. For example, if bar2 is AC, then bar2_max is probably unused, so you could store the link in @{selected|bar2|max}, and reference that in your macro.
Thank you Oosh. That did the job. Example 1 &nbsp; Example 2
1598450911
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Oosh said: If you want the token image in the actual macro, you will need to use the [img](image.location/filename.png) method to link it. Rather than hard code your macros, you're better off storing the image link as an Attribute on the sheet and referencing that from your macros: using @{selected|token_img} as an example: &lt;SNIP&gt; You can also use a token bar to store the link, that way you can show artwork that isn't linked to a character sheet. It depends on whether or not you've got an unused bar. For example, if bar2 is AC, then bar2_max is probably unused, so you could store the link in @{selected|bar2|max}, and reference that in your macro. That would make a nice little script. Particularly if it could cycle through the game and fetch/update everything.