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

API Script to globally default all spell descriptions to on/off

Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri",sans-serif; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Is there a way to globally default all spell descriptions (for both PC and NPC character sheets) to display in the chat when a spell is cast? Many times a spell will be cast and it will show just the damage output without any description about the spell. It's handy when the spell description always shows in the chat so that I, as the DM, don't have to look up what the spell does in the middle of combat. I was looking at the campaign settings page and I don't see this option. A great example of this problem is the spell Inflict Wounds. Its default setting has the Include Spell Description in Attack turned Off. (see attached screenshot). I want this and all other spells to have this to be set to On. I don't want to always have to manually set it to On for each spell after importing from the compendium. I want a game setting, macro or API script that turns them all on. Thanks, Rob
 The api that might be able to do it is called chatsetattr.  However it may not be a full perfect solution part of the reason being is that these are repeating section abilities, and unless there is global toggle to turn it on off it would have to be done for each repeating section on each character sheet in the game. those with more experience with the 5 e sheet might be able to add more  but that would be the place to start. 
1591075445
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It can be set. However, it is one of the several attributes on the official sheet that does not toggle properly when set by the API. Here is a macro that sets them, but it will likely give unsatisfactory results. Use on a test character first. !setattr --sel --mute --repeating_spell-1_$0_includedesc|on !setattr --sel --mute --repeating_spell-1_$1_includedesc|on !setattr --sel --mute --repeating_spell-1_$2_includedesc|on !setattr --sel --mute --repeating_spell-1_$3_includedesc|on !setattr --sel --mute --repeating_spell-1_$4_includedesc|on !setattr --sel --mute --repeating_spell-1_$5_includedesc|on !setattr --sel --mute --repeating_spell-1_$6_includedesc|on !setattr --sel --mute --repeating_spell-1_$7_includedesc|on !setattr --sel --mute --repeating_spell-1_$8_includedesc|on !setattr --sel --mute --repeating_spell-1_$9_includedesc|on !setattr --sel --mute --repeating_spell-2_$0_includedesc|on !setattr --sel --mute --repeating_spell-2_$1_includedesc|on !setattr --sel --mute --repeating_spell-2_$2_includedesc|on !setattr --sel --mute --repeating_spell-2_$3_includedesc|on !setattr --sel --mute --repeating_spell-2_$4_includedesc|on !setattr --sel --mute --repeating_spell-2_$5_includedesc|on !setattr --sel --mute --repeating_spell-2_$6_includedesc|on !setattr --sel --mute --repeating_spell-2_$7_includedesc|on !setattr --sel --mute --repeating_spell-2_$8_includedesc|on !setattr --sel --mute --repeating_spell-2_$9_includedesc|on !setattr --sel --mute --repeating_spell-3_$0_includedesc|on !setattr --sel --mute --repeating_spell-3_$1_includedesc|on !setattr --sel --mute --repeating_spell-3_$2_includedesc|on !setattr --sel --mute --repeating_spell-3_$3_includedesc|on !setattr --sel --mute --repeating_spell-3_$4_includedesc|on !setattr --sel --mute --repeating_spell-3_$5_includedesc|on !setattr --sel --mute --repeating_spell-3_$6_includedesc|on !setattr --sel --mute --repeating_spell-3_$7_includedesc|on !setattr --sel --mute --repeating_spell-3_$8_includedesc|on !setattr --sel --mute --repeating_spell-3_$9_includedesc|on !setattr --sel --mute --repeating_spell-4_$0_includedesc|on !setattr --sel --mute --repeating_spell-4_$1_includedesc|on !setattr --sel --mute --repeating_spell-4_$2_includedesc|on !setattr --sel --mute --repeating_spell-4_$3_includedesc|on !setattr --sel --mute --repeating_spell-4_$4_includedesc|on !setattr --sel --mute --repeating_spell-4_$5_includedesc|on !setattr --sel --mute --repeating_spell-4_$6_includedesc|on !setattr --sel --mute --repeating_spell-4_$7_includedesc|on !setattr --sel --mute --repeating_spell-4_$8_includedesc|on !setattr --sel --mute --repeating_spell-4_$9_includedesc|on !setattr --sel --mute --repeating_spell-5_$0_includedesc|on !setattr --sel --mute --repeating_spell-5_$1_includedesc|on !setattr --sel --mute --repeating_spell-5_$2_includedesc|on !setattr --sel --mute --repeating_spell-5_$3_includedesc|on !setattr --sel --mute --repeating_spell-5_$4_includedesc|on !setattr --sel --mute --repeating_spell-5_$5_includedesc|on !setattr --sel --mute --repeating_spell-5_$6_includedesc|on !setattr --sel --mute --repeating_spell-5_$7_includedesc|on !setattr --sel --mute --repeating_spell-5_$8_includedesc|on !setattr --sel --mute --repeating_spell-5_$9_includedesc|on !setattr --sel --mute --repeating_spell-6_$0_includedesc|on !setattr --sel --mute --repeating_spell-6_$1_includedesc|on !setattr --sel --mute --repeating_spell-6_$2_includedesc|on !setattr --sel --mute --repeating_spell-6_$3_includedesc|on !setattr --sel --mute --repeating_spell-6_$4_includedesc|on !setattr --sel --mute --repeating_spell-6_$5_includedesc|on !setattr --sel --mute --repeating_spell-6_$6_includedesc|on !setattr --sel --mute --repeating_spell-6_$7_includedesc|on !setattr --sel --mute --repeating_spell-6_$8_includedesc|on !setattr --sel --mute --repeating_spell-6_$9_includedesc|on !setattr --sel --mute --repeating_spell-7_$0_includedesc|on !setattr --sel --mute --repeating_spell-7_$1_includedesc|on !setattr --sel --mute --repeating_spell-7_$2_includedesc|on !setattr --sel --mute --repeating_spell-7_$3_includedesc|on !setattr --sel --mute --repeating_spell-7_$4_includedesc|on !setattr --sel --mute --repeating_spell-7_$5_includedesc|on !setattr --sel --mute --repeating_spell-7_$6_includedesc|on !setattr --sel --mute --repeating_spell-7_$7_includedesc|on !setattr --sel --mute --repeating_spell-7_$8_includedesc|on !setattr --sel --mute --repeating_spell-7_$9_includedesc|on !setattr --sel --mute --repeating_spell-8_$0_includedesc|on !setattr --sel --mute --repeating_spell-8_$1_includedesc|on !setattr --sel --mute --repeating_spell-8_$2_includedesc|on !setattr --sel --mute --repeating_spell-8_$3_includedesc|on !setattr --sel --mute --repeating_spell-8_$4_includedesc|on !setattr --sel --mute --repeating_spell-8_$5_includedesc|on !setattr --sel --mute --repeating_spell-8_$6_includedesc|on !setattr --sel --mute --repeating_spell-8_$7_includedesc|on !setattr --sel --mute --repeating_spell-8_$8_includedesc|on !setattr --sel --mute --repeating_spell-8_$9_includedesc|on !setattr --sel --mute --repeating_spell-9_$0_includedesc|on !setattr --sel --mute --repeating_spell-9_$1_includedesc|on !setattr --sel --mute --repeating_spell-9_$2_includedesc|on !setattr --sel --mute --repeating_spell-9_$3_includedesc|on !setattr --sel --mute --repeating_spell-9_$4_includedesc|on !setattr --sel --mute --repeating_spell-9_$5_includedesc|on !setattr --sel --mute --repeating_spell-9_$6_includedesc|on !setattr --sel --mute --repeating_spell-9_$7_includedesc|on !setattr --sel --mute --repeating_spell-9_$8_includedesc|on !setattr --sel --mute --repeating_spell-9_$9_includedesc|on !setattr --sel --mute --repeating_spell-9_$5_includedesc|on !setattr --sel --mute --repeating_spell-9_$6_includedesc|on !setattr --sel --mute --repeating_spell-9_$7_includedesc|on !setattr --sel --mute --repeating_spell-9_$8_includedesc|on !setattr --sel --mute --repeating_spell-9_$9_includedesc|on !setattr --sel --mute --repeating_spell-9_$10_includedesc|on
Thanks Mark and thanks Keith.  I appreciate you both taking the time to answer. Keith - how would I use this on a test character? Wouldn't this script globally affect all spell settings on all character sheets (PC and NPC)?  Sorry for the stupid question here, but I'm still getting used to macros and API scripts. Thanks, Rob
1591166592
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The --sel in each line constrains the command to work only on characters representing the sel ected tokens.
1591184389
Jakob
Sheet Author
API Scripter
Hmm. ChatSetAttr should have a wildcard to affect a given attribute in all rows of a repeating section.
Hi Keith, Ok.  I think I got it.  If I wanted to run it globally, should I just removed the --sel in each line?  I obviously will test this first. Jakob - you mention ChatSetAttr.  In Keith's script, he's using setattr, is this a different command or just an abbreviation of ChatSetAttr? Thanks guys
1591193749
GiGs
Pro
Sheet Author
API Scripter
Jakob said: Hmm. ChatSetAttr should have a wildcard to affect a given attribute in all rows of a repeating section. That would be very handy. I'm not seeing it listed in the documentation here:&nbsp; <a href="https://github.com/roll20/roll20-api-scripts/blob/master/ChatSetAttr/README.md" rel="nofollow">https://github.com/roll20/roll20-api-scripts/blob/master/ChatSetAttr/README.md</a>
1591197739
Jakob
Sheet Author
API Scripter
Yep, it should , but doesn't :D. I'll see what I can do.
1591198772
GiGs
Pro
Sheet Author
API Scripter
ahhh i misunderstood, lol. Great idea.
Rob C. said: Hi Keith, Ok.&nbsp; I think I got it.&nbsp; If I wanted to run it globally, should I just removed the --sel in each line?&nbsp; I obviously will test this first. Jakob - you mention ChatSetAttr.&nbsp; In Keith's script, he's using setattr, is this a different command or just an abbreviation of ChatSetAttr? Thanks guys That one of the many commands ChatSetAttr recognizes. The helpfile Gig's pointed on he github has a run down of all its features but do not fret to much. It may seem a little overwhelming at first but with some example such as keith has given and other in the community you will pick it up in&nbsp; no time.
1591201773
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jakob said: Yep, it should , but doesn't :D. I'll see what I can do. Hah, I was thinking that last night while pasting. That would be extremely useful, but also dangerous. You could wipe out a lot of data if not careful. I'd certainly appreciate the option, though.
Awesome!&nbsp; Thanks for your help guys.&nbsp; It's greatly appreciated.&nbsp; I love learning this stuff!
Keith - I copied and pasted this into a macro and ran it with a couple test characters (I made sure their token was selected) and it didn't work.&nbsp; For example, Eldritch Blast still does not have the Include Spell Description In Attack option on.&nbsp; Maybe I'm doing something wrong?
1591234987
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Did you try running the actual spell? Like I said, the D&amp;D 5th Edition by Roll20 sheet does stuff in a roundabout way that keeps some things from being set properly. I can't remember what the issue was with that macro, but I did retire it. I was hoping the recent JS upgrades they did would fix it, but no dice, I guess.
Hi Keith, yeah I tried running the spell and still the same result.&nbsp; Just a quick question - should I have expected a return result to show in the chat window showing that the script had executed?&nbsp; When I ran the macro, nothing returned in the chat (not that it needed to) and I saw no result in the Roll20 Sheet.
Rob C. said: Hi Keith, yeah I tried running the spell and still the same result.&nbsp; Just a quick question - should I have expected a return result to show in the chat window showing that the script had executed?&nbsp; When I ran the macro, nothing returned in the chat (not that it needed to) and I saw no result in the Roll20 Sheet. You can run the command with out the --mute and will displays an errors or issues. I did this within a test game and the sheet and it could not find ability for the selected character.&nbsp; I believe attribute is correct based on the sheet so I am not exactly sure why those with greater experience with this sheet might be able to tell you.&nbsp;
Thanks Mark.&nbsp; I appreciate you taking a look.&nbsp; I'll try it without the mute. Thanks for your help!