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

ChatSetAttr - Few 'simple?' settings

April 01 (5 years ago)

Edited April 01 (5 years ago)

Hey girls/guys!

I'm hoping for a little bit of help.

I know that I can do this on a 'global scale' in the roll20 game menu somewhere, but I'm trying to create a short macro, using ChatsSetAttr that will update some of the settings for selected NPC's.

Set selected NPC's to:

Roll Queries: "Query Advantage"
Whisper Rolls to DM: Never
NPC Name in Rolls: Hide

Could anyone help me out with the correct code for this please? Thanks!

Edit: Sorry. Of course! I'm using the 5e Roll20 sheet. Is it still called OLG?

April 01 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

To even begin, we would need to know which sheet you are using. Different sheets use different attribute names.

April 01 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Hoping you are not talking about the Roll20 sheet. The option for query is actually a formula. You can see it on the attributes and abilities page. It would probably take some very specialized tweaking.

April 01 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Assuming the Roll20 5e D&D sheet:

This will hide the name:

!setattr --sel --npc_name_flag|0

This will set the whisper type to never:

!setattr --sel --wtype|1


These were easy because they are the default value of the sheet and you can just set them to 1. Setting them to anything else is setting them to a formula, and I don't know how to do that with ChatSetAttr without breaking things.

April 01 (5 years ago)

Edited April 01 (5 years ago)

Thanks Keith. I presume it's something to do with rtype or something?  

April 01 (5 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

That would seem to be correct. The value to set it to is:

{{query=1}} ?{Advantage?|Normal Roll,&#123&#123normal=1&#125&#125 &#123&#123r2=[[0d20|Advantage,&#123&#123advantage=1&#125&#125 &#123&#123r2=[[@{d20}|Disadvantage,&#123&#123disadvantage=1&#125&#125 &#123&#123r2=[[@{d20}}

But that breaks ChatSetAttr. Perhaps Jakob can give some insight. You can PM him, or post the problem to the ChatSettAttr feedback thread.