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

Ctrl-Z a character graphic - not token

Putting this under API since I am sure it would take an API to do this. Is there a way to perform a popup (similar to Ctrl-Z for a token) that pops up the graphic on the Bio page of the character sheet?
1589227330

Edited 1589229127
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try this: on('ready', function() { on('chat:message', function(msg) { if (msg.type == "api" && msg.content.indexOf("!char-pic") !== -1) { var charid =msg.content.split(' ')[1]; var c = getObj('character',charid); if(c) { var fPart = "<div style='box-shadow: 3px 3px 2px #888888; font-family: Verdana; text-shadow: 2px 2px #000; text-align: center; vertical-align: middle; padding: 1px 1px; margin-top: 0.1em; border: 1px solid #000; border-radius: 8px 8px 8px 8px; color: #FFFFFF;"; var Pic = fPart + "background-color:#AAAAAA;'><img src='" + c.get('avatar') + "'></div>"; sendChat('', "/direct " + Pic); } }; }); }); Select token and give the command !char-pic @{selected|character_id} I don't have the source handy, but I will edit in when I get the chance.
Nothing happens. I am getting a "charid =  undefined" error
1589228821

Edited 1589229096
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I edited. Try that version. The one I copied was from a snippet I was planning to adapt to something else. Edit: Slowed down enough to take a look. The command requires the character id: !char-pic @{selected|character_id}
Oh. That's nice. This works. TYVM
Now I can pop up full graphics for things from my Monster Manual sheets!