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

Simple nested macro format problem

Me again.  I have a token action "Cast Spell" which I want to offer a list of spell schools, then refer to the macro for the selected school to select a spell from that list.  They look like this @{selected|character_name} ?{Select School|  Chronomancer, **Chronomancer:**  #C-Chron | Elementalist, **Elementalist:**  #C-Elem| } @{selected|character_name} ?{Cast Chronomancer Spell|  Crumble, **Crumble:** [[1d20>@{selected|crumble}]]| Decay, **Decay:** [[1d20>@{selected|decay}]]| Fast Act, **Fast Act:** [[1d20>@{selected|FastAct}]]| Fleet Feet, **Fleet Feet** [[1d20>@{selected|FleetFeet}]]| Petrify, **Petrify** [[1d20>@{selected|Petrify}]]| Slow, **Slow** [[1d20>@{selected|Slow}]]| Time Store, **Time Store** [[1d20>@{selected|TimeStore}]]| Time Walk, **Time Walk** [[1d20>@{selected|TimeWalk}]]| } But when the first pulldown is opened, I get this Obviously I've done at least one thing wrong, two if you see where it's duplicated Time Store somehow. Probably a misplaced bracket somewhere. Any help much appreciated! Thanks
1603196645
GiGs
Pro
Sheet Author
API Scripter
Are you sure the TimeStore attribute includes a number and only a number? Regardless, this macro is doomed to failure until you use html entities. See here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> My advice is to look into using a Chat Menu instead:&nbsp; <a href="https://app.roll20.net/forum/permalink/5927072/" rel="nofollow">https://app.roll20.net/forum/permalink/5927072/</a>
Chat menu looks good, but I don't understand what goes where. I pasted the example into a macro and it does nothing.
1603232667
GiGs
Pro
Sheet Author
API Scripter
You could replace your launching macro with /w "@{selected|character_name}" &amp;{template:default} {{name=Spell Menu}} {{[Chronomancer]( !&amp;#13; #C-Cron) [Elementalist]( !&amp;#13 #C-Elem)]] }} The above macro will create a menu in chat for the player who owns the selected character, and that will have buttons for the c-cron and c-elem macros. This is very important: &nbsp;After you save this macro, if you reopen it, it will stop working. This is because it needs a html entity (this part:&nbsp;&amp;#13;) to work. Html entities each represent a character - that one represents a line break. When you open &nbsp;a macro containing a html entity, roll20 process the entity and turns it into the character it represents. But it needs to be in html form for the macro to work.&nbsp; So make sure you have a backup copy of the macro saved somewhere. The post I linked mentions how to set up such mactos as character abilities, which don't have this issue.
1603252355
Oosh
Sheet Author
API Scripter
Setting up the chat menu as character abilities is definitely the better way to go, however if for some reason you do need to the macros to be in Collections, you can sidestep the issue by putting the entity on a character sheet as an Attribute. So [Chronomancer]( !@{bob|br} #C-Cron) will create a Collections macro button that won't break on re-opening it, and just needs the character sheet bob to have the Attribute: br - &amp;#13;
1603258115
GiGs
Pro
Sheet Author
API Scripter
That's clever, Oosh. Has it been suggested in the stupid tricks thread?
1603258603
Oosh
Sheet Author
API Scripter
I have no idea... I thought the clever version was "use a macro character sheet" :)
1603263081
GiGs
Pro
Sheet Author
API Scripter
Using a macro sheet is old hat :) Your post give me the idea to make a Utilities sheet, that worked the same as a macro sheet, except it's used for various utility functions - like your attribute there that bridges a macro sheet and the macros collection. So [Chronomancer]( !@{utilities|br} #C-Cron) or, if just combining with a traditional macro sheet but also needing to use collection macros for some reason: [Chronomancer]( !@{macros|br} #C-Cron) Its a good way to use macros in chat menus without having to bother with html entities.
1603289681
Oosh
Sheet Author
API Scripter
That's clever, GiGs. Has it been suggested in the stupid tricks thread?
The light begins to dawn - thanks all! One question from the first answer The post I linked mentions how to set up such mactos as character abilities, which don't have this issue. If I do that, though, don't I have to set it up on each character individually?
OK, I really am well behind. What are macro sheets or utility sheets?&nbsp;
I tried this and it gives me&nbsp; SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "\"" found. GiGs said: You could replace your launching macro with /w "@{selected|character_name}" &amp;{template:default} {{name=Spell Menu}} {{[Chronomancer]( !&amp;#13; #C-Cron) [Elementalist]( !&amp;#13 #C-Elem)]] }} The above macro will create a menu in chat for the player who owns the selected character, and that will have buttons for the c-cron and c-elem macros. This is very important: &nbsp;After you save this macro, if you reopen it, it will stop working. This is because it needs a html entity (this part:&nbsp;&amp;#13;) to work. Html entities each represent a character - that one represents a line break. When you open &nbsp;a macro containing a html entity, roll20 process the entity and turns it into the character it represents. But it needs to be in html form for the macro to work.&nbsp; So make sure you have a backup copy of the macro saved somewhere. The post I linked mentions how to set up such mactos as character abilities, which don't have this issue.
1603317660
GiGs
Pro
Sheet Author
API Scripter
Oosh said: That's clever, GiGs. Has it been suggested in the stupid tricks thread? I cant tell if you're joking. It's just a rephrasing of your suggestion.
1603325494
Oosh
Sheet Author
API Scripter
There's a couple of stray ]] squackets after #C-Elem. They got lost on their way to an inline roll somewhere. Hugh Foster said: I tried this and it gives me&nbsp; SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "\"" found. GiGs said: You could replace your launching macro with /w "@{selected|character_name}" &amp;{template:default} {{name=Spell Menu}} {{[Chronomancer]( !&amp;#13; #C-Cron) [Elementalist]( !&amp;#13 #C-Elem)]] }} GiGs said: Oosh said: That's clever, GiGs. Has it been suggested in the stupid tricks thread? I cant tell if you're joking. It's just a rephrasing of your suggestion. Yep, just being an idiot and quoting your own post back at you :)
1603325947
Kraynic
Pro
Sheet Author
Hugh Foster said: OK, I really am well behind. What are macro sheets or utility sheets?&nbsp; At the top of this forum, there is a pinned thread called Stupid Roll20 Tricks.&nbsp; The first post is an index, and you will find chat menus and macro characters in that list. As an example, I mostly run games in an unsupported system.&nbsp; I have a "character" with a macro for every clerical ability.&nbsp; I have another for wizard spells, another for each of the 4 element warlocks, another for diabolist symbol magic, etc.&nbsp; These macros are all written to work off of attributes of the selected token, meaning that they will work for any character as long as the related spell casting attributes are filled in on the sheet.&nbsp; I then have a chat menu on each of those sheets that is the entire list of abilities/spells.&nbsp; When I make an npc (or a player creates a pc) that uses that type of spell/ability, I copy the chat menu to their sheet, and edit the menu to only show what their character knows.&nbsp; I set that chat menu as a token action so that it is available when their token is selected (which means all the attributes should then work for the individual macros).&nbsp; Then when they cast a spell or use an ability, they click the token action that brings up the menu, then click the exact ability that they want to use.&nbsp; Clicking the entry on the menu triggers that macro to roll. Showing the exact macros probably won't be much good because I am using a sheet and template different that what you are likely to use, but the way the buttons are created is pretty simple.&nbsp; Let's say the Negate Toxins macro is an ability called NegTox on a "character" sheet named Healer Abilities.&nbsp; The button in the menu that called that macro would look like:&nbsp; [Negate Toxins](~Healer Abilities|NegTox) That displays Negate Toxins as the button that links to the Healer Abilities sheet and triggers the ability macro named NegTox. I have a sheet for poisons, which allows me to add a button for that poison to the description of someone's weapon attack.&nbsp; If they make the first hit, they can click the button to roll the poison damage, so these buttons don't have to just be used in a menu.&nbsp; You may find quite a few odd little uses for this particular trick.
That is much closer. I now get this.. Menu works, but it doesn;t call the macro. Do I need to HTML the #? Oosh said: There's a couple of stray ]] squackets after #C-Elem. They got lost on their way to an inline roll somewhere. Hugh Foster said: I tried this and it gives me&nbsp; SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "\"" found. GiGs said: You could replace your launching macro with /w "@{selected|character_name}" &amp;{template:default} {{name=Spell Menu}} {{[Chronomancer]( !&amp;#13; #C-Cron) [Elementalist]( !&amp;#13 #C-Elem)]] }} GiGs said: Oosh said: That's clever, GiGs. Has it been suggested in the stupid tricks thread? I cant tell if you're joking. It's just a rephrasing of your suggestion. Yep, just being an idiot and quoting your own post back at you :)
1603425745
Oosh
Sheet Author
API Scripter
That's the result you'll get if the macro doesn't exist. Collections macros are case-sensitive, is there one called (exactly) C-Cron in your Collections tab?
Yeah, I thought of that :) Pity I spelled Chron differently! It works!!!&nbsp; Thank you all. I still have the oddness around Time Store but I can simply muck out the lower half of the table macro and retype it.&nbsp;