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

Set NPC Rolls to Query with a Mod? (5e by Roll20 Sheet)

March 06 (2 years ago)

I prefer to have all my NPCs rolls default to Query rather than toggle, so I don't have to open the character sheet and switch them individually.  I use Jarren's Macro Mule for my NPCs, so I rarely ever have to open the sheet after I have them set up.  I know I can use global settings for this, but in a purchased module all the tokens currently on maps don't seem to acquire these settings (maybe there's a trick for this that I need to learn).  

What I'm hoping to do is use ChatSetAttr or maybe Token-Mod to quickly switch that setting for tokens that are already on a map.  Is this possible?  I did a little research and found some discussion on the ChatSetAttr threads and it seems like maybe not, unless I missed the solution searching in the wee hours of the morning.

March 06 (2 years ago)
Kraynic
Pro
Sheet Author

It has been a couple years since I have used it, but ChatSetAttr does have a flag that you can use to apply a command to all sheets present in the game.  If I remember correctly, it should be in the instructions that show when you select that mod/script.  All you need is the attribute you need to change, the value it needs to become, and ChatSetAttr should be able to get it done for you.  I don't play 5E, so I'm not familiar enough with the sheet to easily give you the exact command.

If you can't figure it out (and no one else posts), then post back and I will see what I can put together in a test game.

March 06 (2 years ago)

Edited March 06 (2 years ago)

This should do it:

!setattr --silent --all --replace --advantagetoggle|'{{query=1}} \ques{Advantage\ques\|Normal Roll,&\#123&\#123normal=1&\#125&\#125 &\#123&\#123r2=[[0d20\|Advantage,&\#123&\#123advantage=1&\#125&\#125 &\#123&\#123r2=[[\at{d20}\|Disadvantage,&\#123&\#123disadvantage=1&\#125&\#125 &\#123&\#123r2=[[\at{d20}}' --rtype|'\at{queryadvantage}'

That sets the 'rtype' to call 'queryadvantage' and 'queryadvantage' attribute to the query form. It's also set to '--all' which will change all character sheets in the game. '--silent' is set because otherwise you'll get a fairly long output for each character that is in the game of what is being set.

I'd suggest testing it out in a game copy first just to make sure it does what you want. Or you can also change the '--all' to '--sel' to only affect selected tokens before using it on everything.

March 06 (2 years ago)

Thanks, Jarren.  I'll give it a try. 

Turns out that the global settings do (I think) update for all tokens.  I think maybe I was trying it WAYYYY past bedtime and I was having some flaky internet performance.  A quick check today seems to show that existing tokens did actually update.