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

Nested Macros

1452756294

Edited 1452756697
I have an issue with nested macros. I am trying to set up the following macros: Edit: It looks like the editor is ignoring the code formatting and changing the HTML entity values back to their original characters. The second #roll-weapon-0 entry and second #roll-weapon-1 entry are supposed to have the characters %,{,|,} changed to their corresponding HTML entities. That is the test that I actually performed. The values (prepended by & of course), are as follows for quick reference: % &nbsp;#x25; { &nbsp; &nbsp;#x7B; } &nbsp; &nbsp;#x7D; $ &nbsp; #x24; | &nbsp; &nbsp;#x7C; #roll-weapon-0 %{selected|repeating_weapon_$0_attack-roll} OR #roll-weapon-0 %{selected|repeating_weapon_$0_attack-roll} and #roll-weapon-1 %{selected|repeating_weapon_$1_attack-roll} OR #roll-weapon-1 %{selected|repeating_weapon_$1_attack-roll} and then executing ?{Weapon|Sword,#roll-weapon-0 |Mace,#roll-weapon-1 } As per <a href="https://wiki.roll20.net/Macros#Nesting_in_a_Roll_Q" rel="nofollow">https://wiki.roll20.net/Macros#Nesting_in_a_Roll_Q</a>... and the Troubleshooting section in the next paragraph, one of these options should work. I have tried both leaving the text as is, as well as encoding potentially problematic characters. Please note that the final recommendation, " Note that macros which contain HTML entities may no longer function autonomously and must be saved as Abilities ." does not help at all. If I create an Ability with the HTML encoded version of the second line of each macro, I then still have to reference the ability in the Prompt macro. Specifying an ability requires exactly the same set of special characters that I just escaped. Specifying the macros with normal characters breaks the roll query altogether. When I replace the macro text with the HTML entity equivalents, the query then just dumps out the raw text based on which option I pick. It does not execute anything. I looked at the order of operations, and I understand that macros are expanded before roll queries are executed. However, it looks like the resulting commands are not being executed; they are just being printed as text.
Advanced Usage for Roll Queries said: Note: Due to the order of operations , @{Attribute}, %{Ability} and #Macro calls are converted to their assigned values before Roll Queries are executed. That is to say, the vertical bar and closing brace characters that exist as the syntax of Attribute and Ability calls are replaced before those characters are able to prove problematic to a Roll Query that they are nested within. On the flip side, if the assigned value of a nested Attribute, Ability or Macro contains any problematic characters, that nested item will cause its Roll Query to break as surely as if that item's assigned value was inserted directly into its Roll Query in place of its call. So, if the assigned value of your nested Attribute, Ability or Macro does contain problematic characters, consider replacing any or all instances of that nested item's call with that item's assigned value, and then subjecting that assigned value to the above character replacements. All said, subjecting any Attribute, Ability or Macro calls to any character replacements will, under most use cases, cause that call to fail. Does this help?