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

Macro Problem, Nested Multi-input w/multiple macros via drop down.

August 14 (8 years ago)
The goal of this macro is to store 3 values on the Character Sheet (FortSave / RefSave / WilSave) and use those in called Macros with a flavor /me text. I have successfully made such a macro. The following is my basic macro.
/me Attempts to dodge nimbly! [[1d20+@{<Character Name>|<Type>Save}]]

Where each of the <> is replaced with the respected string for character name and save type (Fort/Ref/Wil) and that works with this Master Macro:
?{Save Type:|Fortitude,#FortSave | Reflex,#ReflSave  | Will,#WillSave }

That pops up a Query for a drop down and you select your Save Type and it rolls it for you, quite a bit faster than typing out Boolean. However while each on their OWN can handle having the following added:
?{Adjustment: Positive(+) / Negative(-)|0}?{Amount?|0}
This line lets Players input a + or - symbol to add an addition or subtraction to the roll parse and then it queries the amount of that. This prevents players from having to remember to write a -2 Penalty to Reflex from the Dexterity Penalty suffered by the Entangled Condition for example.

The issue is when I try to then use the Master Macro...
Akii Dencrawler Braces herself!47 | Reflex,/me Attempts to dodge nimbly! 26 | Will,/me Steels her will! 5 
This is what I get from the Master Macro. As you can see it's parsing properly however... the Dropdown gives me is a broken dropdown it shows the Fortitude option but instead of having Reflex and Will available it reads the ForSave Attribute from the Character. The rest of the macro runs out it's respective #Call and even  has accurate Results but as you can guess it's a mess.

I'm looking for help on how to get this Macro to work so that a Player can select what Save they wish to roll, then select if they have a Bonus or Penalty then how much that Bonus or Penalty is. 
Since the game parses the macro before running, it can't parse the part where it asks the user, and never makes it to the other user parts of the other macros. it causes crazy behavior because of this. best plan is to not nest macros that contain user queries inside macros that will call them.
August 14 (8 years ago)

Edited August 14 (8 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It is totally possible to do this. You will need to replace the bars, commas and curly end braces in the nested query with their html entities. Do not replace anything that is part of an ability or attribute call. See advanced roll queries in the wiki for more details.
I would recommend saving these as abilities within a character sheet rather than as global macros because the global macros will parse the html entities (ruining the nesting) whenever you open them back up to edit them again; this doesn't happen for character abilities.
Alternatively, if you don't want to deal with html entities, you could make your selection macro an ability command button menu instead.

EDIT: Forgot to mention: once you start doing html entity replacement, those macros will ONLY work from within a roll query.
August 15 (8 years ago)

Edited August 15 (8 years ago)
Scott C. said:
It is totally possible to do this. You will need to replace the bars, commas and curly end braces in the nested query with their html entities. 

So I have to convert the | and , and } over to their HTML values and the macro chains would work? I've been messing for about an hour and I am getting just the HTML replacements spat out into the main window. If fully spelled out the Master Macro reads like this. Without the +/- Query or the Amount query this works fine. Replacing the | , } just results in having random "| " or " ," or "}" resulting in the outer lines of output on the parse/chat log.

I'm extremely curious how to do these nesting as honestly it's something new and I feel learning it could open up quite the few Macro possibilities for my games.

?{Save Type:

|Fortitude, /me Braces herself! [[1d20+@{Akii Dencrawler|FortSave}?{Adjustment: Positive(+) / Negative(-)|0}?{Amount?|0}]] 

| Reflex,  /me Attempts to dodge nimbly! [[1d20+@{Akii Dencrawler|RefSave}?{Adjustment: Positive(+) / Negative(-)|0}?{Amount?|0}]]   

| Will,  /me Steels her will! [[1d20+@{Akii Dencrawler|WillSave}?{Adjustment: Positive(+) / Negative(-)|0}?{Amount?|0}]] }
August 15 (8 years ago)

Edited August 15 (8 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
It looks like your post fell prey to the html parser of the forums, so I'm not sure where you were putting your replacements in exactly, but I've bolded the characters that should have been replaced. Remember it is any |, }, or comma that is past the first level of the query and is not part of an ability/attribute call. I would also recommend removing anything (like your "/me") that is common to all the roll queries, and just put that outside the query.

?{Save Type: |Fortitude, /me Braces herself! [[1d20+@{Akii Dencrawler|FortSave}?{Adjustment: Positive(+) / Negative(-)|0}?{Amount?|0}]] | Reflex, /me Attempts to dodge nimbly! [[1d20+@{Akii Dencrawler|RefSave}?{Adjustment: Positive(+) / Negative(-)|0}?{Amount?|0}]] | Will, /me Steels her will! [[1d20+@{Akii Dencrawler|WillSave}?{Adjustment: Positive(+) / Negative(-)|0}?{Amount?|0}]] }

I'd also recommend combining your adjustment and amount queries into one, you can simply type +2 or -2 into the single query and have fewer prompts. You could also just put a plus before the query and then just type in the number as 2 or -2.
August 15 (8 years ago)

Edited August 15 (8 years ago)

Scott C. said:

I've bolded the characters that should have been replaced. Remember it is any |, }, or comma that is past the first level of the query and is not part of an ability/attribute call.

I would also recommend removing anything (like your "/me") that is common to all the roll queries, and just put that outside the query.

I'd also recommend combining your adjustment and amount queries into one, you can simply type +2 or -2 into the single query and have fewer prompts. You could also just put a plus before the query and then just type in the number as 2 or -2.
I was considering rewording the Amount Prompt as:

Positive (+) or Negative (-) Bonus?
Must Enter + or - before your Value: <Input Box>

I've got players who... are bad at tracking numbers so I am trying to make it as easy for them as I can. I'll try replacing the bolded parts after my session tonight and get back to you.

Oh before I forget the /me prompt was to organize the result it's not part of the Drop-Down Macro it's only part of the Macro's that are called #FortSave / #RefSave and #WillSave only have the /me commands. So can I put this at the front of the WHOLE macro and have it come through? The issue with that I can see is each /me is flavored for the save type.

I tried inputing it just on the Fortsave macro and I got this result: 
1d20+3+?{Amount?
when I replaced the | with & #124; and the } with & #125; (I put spaced to prevent the Forum Parser)

August 15 (8 years ago)

Kellen M. said:

I was considering rewording the Amount Prompt as:

Positive (+) or Negative (-) Bonus?
Must Enter + or - before your Value: <Input Box>

I've got players who... are bad at tracking numbers so I am trying to make it as easy for them as I can.

Here's my suggestion:
[[ 1d20 + @{FortSave} + (?{Adjustment|0}) ]]
Saves a Query, and positive adjustments do not require a plus sign.
August 15 (8 years ago)

Edited August 15 (8 years ago)

Silvyre said:


Here's my suggestion:
[[ 1d20 + @{FortSave} + (?{Adjustment|0}) ]]
Saves a Query, and positive adjustments do not require a plus sign.
Thanks, I have it now asking which is simple. Players seem to automatically put -2 or just 2 for example.
[[1d20+@{<CharacterName>|FortSave} + ?{Adjustment?|0}]]
August 15 (8 years ago)
Ok good news I got it to work!

/me ?{Save Type: |Fortitude, braces for impact! [[1d20+@{Akii Dencrawler|FortSave} 

| Reflex, attempts to avoid danger! [[1d20+@{Akii Dencrawler|RefSave} 

| Will, steels their mental defenses! [[1d20+@{Akii Dencrawler|WillSave}}  +  ?{Adjustment?|0}]]

Each enter line is just to dictate the | breaks on the Drop Down menu and ease of forum  reading.
August 15 (8 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Glad you got it to work.

Happy rolling.