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

Using @{selected|-} with /as and showing a characters portrait in the chat

I have a token macro that I want to fire a message in the chat, currently I'm doing this: /em @{selected|token_name} swings against @{target|token_name} But I want to use /as. However, when I use /as I don't get a portrait, only the name (even if I use /as @{selected|character_name}. Can it be done?
1398871267
Alicia
Sheet Author
Well.. first of all you can use /emas "@{selected|token_name}" to emote as that selected token (I put quotations around @{selected|token_name} as I've found if there's a space in the name it doesn't format correctly) However, I've never had a token image appear when using /as or /emas. I actually created a macro called EMAS that will include /emas "@{selected|token_name}" so all I have to type is #EMAS and then the emote I want to appear for NPCs I don't want to create a journal entry for. I've never actually tried creating a NPC token linked to a journal entry to see if /emas or /as would work as you want. The images in the chat are pulled from the Journal entry so it would be interesting to see...
1398884859
Lithl
Pro
Sheet Author
API Scripter
/as and /emas do not show character avatars; they are designed to be used for nonexistent characters (eg, minor NPCs that do not need a character sheet)
But is there something that does, for existing characters?
1398907234
Alicia
Sheet Author
Heilemann said: But is there something that does, for existing characters? Using the drop down and making sure there's an image in the character entry.
In a macro...
1398915714
Lithl
Pro
Sheet Author
API Scripter
As a mentor, you could create an API script to send messages as a character, which will display the character's avatar in chat. For example: var character = // getting a reference to the character object left as an exercise to the reader sendChat('character|' + character.id, '/em takes a long walk down a short pier'); You could create an API command to do this, and use that command in a macro. Note that there is a bug with sendChat which causes it to not display the avatar if you use, eg. sendChat('player|' + player.id, message); but it works fine for characters.