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

Assistance getting chat menu correctly formatted

Thanks in advance for anyone that can point me in the right direction. My goal was to make a simple chat menu to be able to get some quick descriptive text of common conditions that come up in our 5E game (OGL sheet being used). I read this page to try to figure out the syntax, but don't seem to have understood it completely. The first part works, and I'm able to get the buttons in the chat window, but the second portion of the goal is clicking the condition name to bring up some descriptive text I've pasted into other macros. The setup is: A character sheet named "MacrosUtils" with an ability named "ConditionsList" which puts the buttons up, and then additional abilities/macros in the same character sheet with the descriptive text. Again, the buttons show up in the chat window, it's clicking on them which is problematic. And here's the content of the "ConditionBlinded" description macro: With the text you see above in ConditionsList, clicking the chat menu button causes the output to be the macro name only. If I change it to have the tilde (~) as mentioned on the linked page at the top (because they're on the same sheet) I get a "TypeError, cannot read property 'substring' of undefined." These are the two versions of the macro: /w gm **Conditions:** [Blinded](!
#ConditionBlinded) [Charmed](!
#ConditionCharmed) [Frightened](!
#ConditionFrightened) [Grappled](!
ConditionGrappled)[Incapacitated](!
#ConditionIncapacitated) [Paralyzed](!
#ConditionParalyzed) [Poisoned](!
#ConditionPoisoned) [Prone](!
#ConditionProne) [Restrained](!
#ConditionRestrained)  [Stunned](!
#ConditionStunned) [Unconscious](!
#ConditionUnconscious) /w gm **Conditions:** [Blinded](~ConditionBlinded) [Charmed](~ConditionCharmed) [Frightened](~ConditionFrightened) [Grappled](~ConditionGrappled)[Incapacitated](~ConditionIncapacitated) [Paralyzed](~ConditionParalyzed) [Poisoned](~ConditionPoisoned) [Prone](~ConditionProne) [Restrained](~ConditionRestrained)  [Stunned](~ConditionStunned) [Unconscious](~ConditionUnconscious) I'm obviously missing something, but this is a first attempt at doing anything like this, and I'd appreciate a pointer to where I'm not getting it. Thank you for any helpful advice or assistance, M
1593424864
GiGs
Pro
Sheet Author
API Scripter
It sounds like you have these macros as Character Abilities, not universal Macros. When you do this, you must use this syntax: [Blinded](~ConditionBlinded) but you must also supply a name for the character. [Blinded](~MacrosUtils|ConditionBlinded) You said If I change it to have the tilde (~) as mentioned on the linked page at the top ( because they're on the same sheet ) This is only true for abilities which are launched from  the same sheet. But when you send a button to chat, and it is launched later by clicking on the button, it's not actually being launched from the character sheet. It's being launched from the chat window. In that case, roll20 doesnt know which character the button came from, so it cant find the ability. Hence the need to supply the character name as above.
1593441272
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
In my experience, if the sheet creates the button using [button](~AbilityName) , and the button is sent to chat, that button will continue to call the correct character ability, no matter how much later the button is clicked. The character sheet call is only needed if the ability being called is on a different sheet than the one that created the button. I work this way for virtually every chat menu I have ever created. The problem above is as said though, using macro calling syntax to try to call abilities.
<forehead slap> Makes total sense now, thank you both for the guidance. M
1593469269
GiGs
Pro
Sheet Author
API Scripter
Even those of us who consider ourselves experts have fallen for this particular error on occasion :)