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 .
×

How to make an item not appear if it's not there.

So I've come across this. I lost the page of where I found it, so I cannot remember the Roll20 username of who to credit, so hopefully you will accept this as a credit.&nbsp; <a href="https://gist.github.com/AndruC/454c3242917050a0dadd44956dade699" rel="nofollow">https://gist.github.com/AndruC/454c3242917050a0dadd44956dade699</a> one macro I've made work but I wish the expand on is the spell list one: &amp;{template:default}{{name=@{selected|character_name} Spellcasting }}{{ Spell DC @{selected|spell_save_dc} = @{selected|spell_attack_bonus} to hit with spell attacks }}{{ Cantrips = [@{selected|repeating_spell-cantrip_$0_spellname}](~selected|repeating_spell-cantrip_$0_spell) }}{{ 1st (SLOTS) = [@{selected|repeating_spell-1_$0_spellname}](~selected|repeating_spell-1_$0_spell) }}{{ 2nd (SLOTS) = [@{selected|repeating_spell-2_$0_spellname}](~selected|repeating_spell-2_$0_spell) }}{{ 3rd (SLOTS) = [@{selected|repeating_spell-3_$0_spellname}](~selected|repeating_spell-3_$0_spell) }} all characters in the campaign are first level. So when I use this macro, I get a lot of messages saying no information exists. yes, I could edit it down to only show cantrips and first level spells. but how can I keep it as is, and only have it show whats there? so since there are no 2nd or 3rd level spells, it would show nothing.
1574651578
Kraynic
Pro
Sheet Author
I don't think there is with a regular macro.&nbsp; You can do it easily if you use an api script though.&nbsp; I use this one:&nbsp; <a href="https://app.roll20.net/forum/post/7474530/script-call-for-testers-universal-chat-menus/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/7474530/script-call-for-testers-universal-chat-menus/?pagenum=1</a> There is also this one:&nbsp; <a href="https://app.roll20.net/forum/post/7478947/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/7478947/slug%7D</a> As far as I know, they are only available on the forums and have no listing in the api dropdown.
The game that's doing this is free. so I have to limit myself to non API stuff
1574657067
Mike deBoston
Compendium Curator
You can hide chat error messages using Stylus. This is a pretty easy thing to do, BUT, it only hides them on your screen. Each of your players would also have to install the Stylus browser add-on. It something comes up and you want to see errors, it's easy to enable/disable this trick. The screen shots are from a test macro I wrote for Savage Worlds, so it doesn't look like yours will. Before, trying to list two spells when only one exists After, error messages hidden Here's the Stylus code: @-moz-document url("<a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a>") { /* Roll20, Chat, hide errors This hides all error messages in Chat. It's useful if you have a macro that lists 3 repeating_weapons or spells, but the character has only 2. */ div.message.error { display: none; } } You can install it here: <a href="https://userstyles.org/styles/177649/roll20-chat-hide-errors" rel="nofollow">https://userstyles.org/styles/177649/roll20-chat-hide-errors</a>
1574665105
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You can suppress those messages by&nbsp; adding the &amp;{noerror} code to your macro , as well. Depending on your macro, you can still get unwanted chat buttons, but it will suppress the orange box error messages.