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 .
×

Macro for swapping (speaking as) characters as GM

Hi there, I have several NPCs and I want to swap between them very fast (so that my players can always see the picture of the NPC currently talking). I know that I can search for the NPCs in the "Speaking as" dropdown list, but this takes some time and slows down the talking of me as GM. I wonder if there is a possibility to swap characters using a macro? Perhaps by writing a macro for every single NPC which activates my NPC wehn I run the macro? Does anyone have an idea on how to do this? Thanks in advance!
1616424802

Edited 1616425045
As GM you can use the /as functionality . You could make these universal Token Action macros: /as "@{selected|token_name}" ?{What do they say?} /as "?{Who is speaking?}" ?{What do they say?} And if you want to be able to use the selected token name in a query, use this: !?{ Who is speaking |@{selected|token_name}} /as "?{ Who is speaking }" ?{What do they say?}
1617542484

Edited 1617542550
Eike
Pro
Thanks for your response, Jarren K. I know this functionality. Actually, I meant that I want to swap the avatar picture so that the NPC I SPEAK (not: write) as is visible. Actually, I really want to use my voice and talk. But I want that the picture of the NPC for which I talk is shown. For example, I want to speak through the microphone as NPC "Armon" and I want that the picture of "Armon" is shown as my avatar. So I can select Armon in the "As" dropdown menu. Then the following is shown: Next, I want to talk through the microphone as NPC "Geshmine" and I want that her picture is shown as my avatar. To do this, I can select Geshmine in the "As" dropdown menu. Then, the following is shown: Because I am swapping every few seconds between five NPCs, I want to have a macro button, that does this change for me. Is there a possibility to do this? Thanks in advance!
1617543845
The Aaron
Roll20 Production Team
API Scripter
Here's an API script that will switch your speaking as: You need to call it with the character id like this: !switch @{bob the slayer|character_id} Code: on('ready',()=>{ on('chat:message',(msg)=>{ if('api' === msg.type && /^!switch/i.test(msg.content)){ let p = getObj('player',msg.playerid); if(p){ let a = msg.content.split(/\s+/); if(a.length>1) { let c = findObjs({ type: 'character', id: a[1] })[0]; if(c){ p.set({ speakingas:`character|${a[1]}` }); sendChat('',`/w "${p.get('displayname')}" Switching to <b>${c.get('name')}</b>.`); } else { sendChat('',`/w "${p.get('displayname')}" No character found for ID <b>${a[1]}</b>!`); } } else { p.set({ speakingas: '' }); sendChat('',`/w "${p.get('displayname')}" Switching to self.`); } } } }); });
Oh yes, that works great. Thank you very much! :-)
1617884541
The Aaron
Roll20 Production Team
API Scripter
No problem! =D