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

TokenMod Setting Never Whisper?

1576878852
Nick O.
Forum Champion
Hi All Is it possible to use tokenmod to set a token so that it never whispers rolls? If so, can someone please provide an example of how to do that? Thanks, Nick
1576882554
GiGs
Pro
Sheet Author
API Scripter
tokenmod only adjusts token settings. Whether a character whispers rolls is character sheet setting, not related to tokens. The chatSetAttr script can modify character sheet attributes. You'd have to find what setting that is on your campaign's character sheet. If your sheet has a settings section, you might be able to switch it off without using a script, but a script can do it for multiple characters at once.
1576889202

Edited 1576951944
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There is an issue with ChatSetAttr for setting the whisper mode on the 5e official sheet. The drop down choice is not the same as the setting. I.e. the drop down menu triggers a sheetworker which changes the actual setting (as I understand it). You can change the attribute value (it's just the a bit of code that prepends the chat output: blank, '/w gm', or a query), but the user-facing drop down will still read whatever it did before. Frustrating. If someone can come up with a way around this, I'd be happy. So happy I would do a little dance of happiness. See below for the actual issue, typo on my part.
1576889926
Nick O.
Forum Champion
Thanks, GiGs - that explains why I couldn't find anything in the documentation. :) keithcurtis - thanks for letting me know about that issue. 
1576890729

Edited 1576951966
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Yeah. ChatSetAttr will actually do the job, but the sheet setting will no longer agree with the menu. I dropped it because although I could remember that, it would only confuse my players.
1576898285
GiGs
Pro
Sheet Author
API Scripter
Cant you use chatsetattr to change both settings?
1576918663
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I don't think so. When I use Inspect, the dropdown value is not an attribute. <select name="attr_wtype">                         <option value= "" data-i18n="never-whisper-roll"> Never Whisper Rolls </option>                         <option value= "@{whispertoggle}" data-i18n="toggle-roll-whisper"> Whisper Toggle </option>                         <option value= "?{Whisper?|Public Roll,|Whisper Roll,/w gm }" data-i18n="query-whisper-roll"> Query Whisper </option>                         <option value= "/w gm " data-i18n="always-whisper-roll"> Always Whisper Rolls </option>                     </select> In the code block above, the underlined parts art the attribute values, but the bolded parts are what displays in the drop down. If ChatSetAttr changes the value of wtype to "/w gm", rolls will be whispered, but the displayed dropdown option will not change to "Always Whisper Rolls". i.e. the macro works, but leads to confusing results.
1576941881

Edited 1576947080
GiGs
Pro
Sheet Author
API Scripter
There's a space after the "/w gm " in the select value. Have you tried setting it to that? selects will only update for exact matches.
1576950079

Edited 1576950130
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I thought I had, since the macro worked. Should that change the displayed drop down?
1576950465
GiGs
Pro
Sheet Author
API Scripter
It should, yes. I havent tried it, but this shouldnt be dependent on roll20's sometimes weird interactions with scripts and sheet workers. It should work the same as changing it manually. If it doesnt work, maybe there's some sheet worker interaction interfering, but I cant think offhand why that would be.
1576950694
Kraynic
Pro
Sheet Author
I know the whisper toggles on my sheet will change if the background value is changed by chatsetattr, but they are just radio buttons with no sheetworkers involved.
1576950989

Edited 1576951202
GiGs
Pro
Sheet Author
API Scripter
Ahh, i just tested it and I see the issue. The problem is the fact it ends with a space. ChatSetAttr doesn't recognise that as part of the value, it trims out the ending space. Looks like there's no way to use chatsetattar to assign an attribute value that ends with a space. Aha, it works. Make sure you wrap '/w GM ' in single quotes. Don't do this: !setattr --sel --wtype|/w GM  or this !setattr --sel --wtype|"/w GM " Do this: !setattr --sel --wtype|'/w GM '
1576951462
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Just ran through some tests. If you change wtype to any of the values, it will work properly, but whatever you change them to, the displayed dropdown label will become "Never Whisper Rolls". So yeah, the macro works, but the user-facing display is incorrect.
1576951560
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
And yes, I was using:  !setattr --sel --wtype|'/w GM ' Single quotes, with space.
1576951885

Edited 1576952069
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Derp! And I just discovered the actual problem. I'm used to capitalizing "GM". Should have been: !setattr --sel --wtype|'/w gm ' All along. Macro works top to bottom, now. Thanks for everyone's patience. I have gone up and struck through my incorrect conclusions, but preserved the text so the thread is still readable.
1576952041

Edited 1576954073
GiGs
Pro
Sheet Author
API Scripter
keithcurtis said: There is an issue with ChatSetAttr for setting the whisper mode on the 5e official sheet. The drop down choice is not the same as the setting. I.e. the drop down menu triggers a sheetworker which changes the actual setting (as I understand it).  I dont think its a sheet worker (havent checked). The way most sheets do this is to use an attribute reference in each button code. It'll start with something like @{wtype} ?{template:whatever} so when you update the wtype attribute, it is automatically part of all the roll macros, no sheet worker needed. When you changed the attribute to "/w gm" (without the ending space), the attribute was updated to that value, and so the roll macros worked. But the visible selection wasnt updated because the attribute's value didnt match the exact value of any of the select options.
1576953117
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nick O, to answer your original question, here is a macro to toggle whispering:  /w gm &{template:npcaction} {{rname=Whisper Types}}{{description=[Whisper to GM](!setattr --sel --wtype|'/w gm ') | [Public](!setattr --sel --wtype|'')}} It will give you this chat menu:
1576953955
GiGs
Pro
Sheet Author
API Scripter
yay, we got there in the end :)
1576959126
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I couldn't figure out how to parse creating the query through ChatSetAttr. Brain hurts.
1577029509
Nick O.
Forum Champion
Thanks, everyone! This is great and I really appreciate all the help! :)