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 Nesting Help

1450832040

Edited 1450832096
I have been working on macros for my game that I am DMing (D&D 5e) I tried doing the normal nesting stuff, but I think I ended up over confusing myself. I'm not sure if the macro-editor supports multi-line commands, but here is a breakdown of what I have designed. Am I doing anything wrong, or am I just doing the nesting wrong? Un-nested: [[{ { 1d20+@{STR} } > { @{target|AC} } } * { 1d8cs0cf0 +@{STR} }]] Nested: [[{{1d20+@{STR}}>{@{target|AC}}}*{1d8cs0cf0 +@{STR}}]] This would go inside of a ?{Modifier| value } (it won't let me type the escape sequences... XD)
It would be ideal if we could use [[ {1d20 + @{STR}}>@{target|AC} * (1d8cs0cf0 + @{STR}) ]] However, this leads to a "Cannot mix success and sum rolls in a single roll expression". So, we're unfortunately constrained to [[ {1d20 + @{STR}}>@{target|AC} * [[1d8cs0cf0 + @{STR}]] ]] or [[ [[{1d20 + @{STR}}>@{target|AC}]] * (1d8cs0cf0 + @{STR}) ]] or /r [[ {1d20 + @{STR}}>@{target|AC} ]] * [[ 1d8cs0cf0 + @{STR} ]]
Ok... so now it works on its lonesome, but I still get the following error after replacing all } with (&_#_1_2_5_;) and all | with (&_#_1_2_4_;) No character was found for 'STR } }>@{target | AC } * [[1d8cs0cf0 + @{STR }]] ]] damage.' Here is my macro: /desc Death Knight swings his Longsword with ?{Type|One-Handed, one hand and deals [[ {1d20 + @{STR &_#125; &_#125;>@{target &_#124; AC &_#125; * [[1d8cs0cf0 + @{STR &_#125;]] ]] damage.| Two-Handed, two hands and deals TO_BE_DETERMINED damage.} except without the _'s before the # signs.
Please let me know if you find the following helpful in this case. 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.
I had read that before... I am not quite sure what it means... Can you please explain it a bit? What does it mean by assigned value vs. call?
Joel H. said: What does it mean by assigned value vs. call? In the case of Attributes, the "assigned value" refers to value(s) that the Attribute has been assigned (i.e. its Current and/or Maximum values, if the latter exists). The "call" of an Attribute given the name "AC" can be @{AC} or @{selected|AC} or @{target|Target 1|AC|max} or @{Character Name|AC}, etc. Does that help?