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 !setattr to update wtype and rtype

Good afternoon. I'm trying to use the following to update whether a 5th Ed OLG sheet rolls advantage and queries whispers but I'm finding that instead of updating the existing attributes wtype or rtype, the ChatSetAttr script is creating new wtype and rtype attributes. Sample: !setattr --sel --replace --wtype|'\ques{Whisper\ques\|Public Roll,\|Whisper Roll,/w gm }' The correct values get entered into wtype, but in a NEW wtype which doesn't change the existing attribute or the existing behavior of the sheet. Any help would be appreciated! Thanks!
1722016198

Edited 1722016707
Is this in a Jumpgate game?  Your code is working for me in my test game (non-Jumpgate).
I do not have beta features turned on. (If that's what qualifies for Jumpgate. I haven't been following that closely.)
You have to deliberately create or copy the game as a Jumpgate game: And when the game loads you'll see a brief loading image showing that it's a Jumpgate version: Do you have more than one character with the same name? (I don't think this is the issue, but it's worth checking.) What happens if you delete all instances of 'wtype' then run the command again? Does it keep creating new duplicate attributes? Does this happen in other games or just this game?
For some more insight: I've tested this across multiple different games of multiple different ages. All 5E OLG. I find that I have 3 different WTYPE fields in the Attributes column in the Abilities and Attributes tab. It appears that the field that appears first in the list is what the sheet is using for the WTYPE variable. When I used !setattr to set the WTYPE value, it sets it in the last appearance in the list. Again, consistent behavior across 3 different campaigns of various ages. ¯\_(ツ)_/¯
I am definitely NOT using Jumpgate then.
I think I've identified the issues that I've been experiencing. When I create new campaigns from market place purchases, the character sheets have been defaulting to "Always Whisper" rolls. I don't play this way. I have the games settings set to Query Whisper. As part of my setup I will use the Apply Defaults tool to force NPC/mob character sheets to Query Whisper. However I've noticed that after logging out and then back in, my character sheets revert to Always Whisper, so I use the Apply Defaults again. This appears to be creating new wtype attributes on the character sheets instead of updating the existing ones. I have some sheets that have 5 different wtype values. When I use the following command: !setattr --sel --replace --wtype|'\ques{Whisper\ques\|Public Roll,\|Whisper Roll,/w gm }' It works like it is supposed to, but it updates the last appearance of wtype in the list of attributes on a character sheet. The character sheet uses the FIRST appearance of wtype to set behavior. I guess the macro forum really isn't the place for this thread any longer so I'll close this post. Thanks for your help Jarren!
If extra wtype attributes are being created, you should be able to use ChatSetAttr to delete the extraneous ones first.  If you want to update ALL characters in the game to be Query Whisper, then you could use this several times to delete all instances of the extraneous wtype attribute on all characters: !delattr --all --wtype Then use your command from above but swap out --sel for --all to add the Query Whisper to all the character sheets. 
Jarren, That's what I've decided to do. I'm going to use the --allgm switch though so I don't muck up my player's sheets.