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 help on drop-downs highly appreciated. (Give out Label and Value in one statement)

1453207261

Edited 1453219234
Hey folks, this is my first post. So excited :-) Anyway, I have a question concerning selection. I am trying to nest the hell out of the system but I've come to a point were I fail. What do I want? I want an Emote, using /em with an inline dice roll (using Savage Worlds mechanics). That is easy so far but I want to give the player the opportunity to select the appropriate skill first. What I tried so far: /em rolls a skill and receives [[1d?{Skill|Stealth,@{Stealth}|Climbing,@{Climbing}|Notice,@{Notice}}!]]. This works good so far, and even the wild card variation /em rolls a skill and receives [[{1d?{Skill|Stealth,@{Stealth}|Climbing,@{Climbing}|Notice,@{Notice}}!,1d6!}k1]]. works great. It lacks, however, which Skill was actually rolled and I fail to find a method to make it work. I tried to use variables: /em rolls ?{Skill|Stealth|Climbing|Notice} and receives [[1d@{?{Skill}}!]] I tried to use Abilities (each Skill has its own Ability) %{GenericOrc|?{Skill|Stealth|Climbing|Notice}} I tried some combinations of this and even tried to use macros but I had no success yet. Has anyone an idea, how I might approach my problem to receive the name of the skill as well as the roll? Thanks in advance! I would really appreciate some feedback or further sources where I can find examples on how to work with the roll20 engine besides the wiki.
Thanks to Silvyre and a bit of searching, I believe, I've found my solution here: <a href="https://app.roll20.net/forum/post/2845467/help-with-query-group-macro" rel="nofollow">https://app.roll20.net/forum/post/2845467/help-with-query-group-macro</a>
1453213089

Edited 1453216272
Hm. No. Still failing :-) Tried this (in German): ?{Skill| Heimlichkeit,%{Beispielcharakter|Heimlichkeit}| Werfen, %{Beispielcharakter|Werfen} } The Abilities are similar in Style (e.g. Heimlichkeit: /em macht eine Heimlichkeit -Probe und würfelt eine [[ {1d@{Heimlichkeit}!, 1d6!}k1 -@{Wunden} -@{Erschöpfung}]]. Second guess was: ?{Skill|Heimlichkeit,/em macht eine Heimlichkeit -Probe und würfelt eine [[ {1d@{Heimlichkeit}!, 1d6!}k1 -@{Wunden} -@{Erschöpfung}]].|Werfen,/em macht eine Werfen -Probe und würfelt eine [[ {1d@{Werfen}!, 1d6!}k1 -@{Wunden} -@{Erschöpfung}]].} Can someone give me a hint on how to solve this? I can't make sense out of this statement: <a href="https://wiki.roll20.net/Macros#Advanced_Usage_2" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_2</a> I want to sum up my thoughts: If I am starting with the first example: ?{Skill|Heimlichkeit,%{Beispielcharakter|Heimlichkeit}|Werfen, %{Beispielcharakter|Werfen} } My expectation is, that a prompt is appearing telling me to select the skill in question. After I select the skill the chosen Ability is executed (which wraps up my whole skill roll in a neat package). If I take the Order of Operations into account, I think it should work like this: 0. The Ability ?{Skill|Heimlichkeit,%{Beispielcharakter|Heimlichkeit}|Werfen, %{Beispielcharakter|Werfen} } 1. Expand Abilities -&gt; Actually, I fail to reach this step! ?{Skill|Heimlichkeit, /em macht eine Heimlichkeit-Probe und würfelt eine [[ {1d@{Heimlichkeit}!, 1d6!}k1 -@{Wunden} -@{Erschöpfung}]]. |Werfen, /em macht eine Werfen-Probe und würfelt eine [[ {1d@{Werfen}!, 1d6!}k1 -@{Wunden} -@{Erschöpfung}]]. } 2. Variables are substituted (example: Heimlichkeit) - Does this even work? /em macht eine Heimlichkeit-Probe und würfelt eine [[ {1d6!, 1d6!}k1 -0 -0]]. 3. Roll queries are executed /em macht eine Heimlichkeit-Probe und würfelt eine 4 . Is this correct? And where is my error? I think I have to change some of the entities into html entities, but I failed to figure out which one.
Razortide said: Is this correct? And where is my error? I think I have to change some of the entities into html entities, but I failed to figure out which one. It is correct. :) All you should have to do to get this working is replacing all the commas and closing curly braces that are part of keep/drop functions with HTML entities (&amp;#44; and &amp;#125; respectively).
Hey Silvyre, thanks for your reply. Didn't work though :-) I used: ?{Skill|Heimlichkeit , /em macht eine Heimlichkeit-Probe und würfelt eine [[ {1d@{Heimlichkeit&#125;!&#44; 1d6!&#125;k1 ]].|Werfen|/em macht eine Werfen-Probe und würfelt eine [[ {1d@{Werfen&#125;!&#44; 1d6!&#125;k1 ]].} And the chat responds: No character was found for 'Heimlichkeit}!, 1d6!}k1 ]].' SyntaxError: Expected "(", "f" or [0-9] but "H" found. SyntaxError: Expected "(", "f" or [0-9] but "H" found. Since I want to use the Abilities on it's own I am unable to change the comma and curly braces there since it won't accept the Ability then /em macht eine Werfen-Probe und würfelt eine [[ {1d@{Werfen&#125;!&#44; 1d6!&#125;k1 -@{Wunden} -@{Erschöpfung}]] No attribute was found for @{Beispielcharakter|Werfen&#125;!&#44; 1d6!&#125;k1 -@{Wunden} SyntaxError: Expected "(", "f" or [0-9] but "B" found. I really appreciate your help :-)
Hm, looks like you're subjecting Attribute calls to character replacements? The following directly addresses why that should almost never be done: Advanced Usage for Roll Queries said: 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! If you want to use Abilities, on their own, you might wish to follow this advice: 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. Please let me know if anything is unclear/confusing, or if you might word anything here better. Thanks!
Ah. Thanks for clarificating that! Yeah so, what I want to do is obviously not possible :-( But I've learned a lot. In that case, I'll work with Token Actions and the chat function to call abilities :-) Now, on to Target actions. Thank you very much! You have helped me grasp the concept!
Razortide said: Yeah so, what I want to do is obviously not possible :-( Yeah, unfortunately, you'd need to use (and maintain) two different copies of the Abilities... I'm glad it makes sense. :)
I am trying to confirm what is being asked and what answer was given here as I believe I have the same question. I am wanting to be able to print the label and value of the drop down query variable. ?{Variable|label1,value1|label2, value2} I know you can use the selection to change the output of the rest of the macro by nesting and using the HTML Ascii Code. &nbsp;But that is not what I am wanting. I want to be able to output both the label and value of the query variable. I.E: (using above variable) ?{Variable(label} : ?{Variable(value)} Obviously the () bits are not correct. This is both to format the info within a template and then to use the value in the rolls. I know this works... &{template:default} {{name=name}} {{Dice Pool:= ?{Variable|label1,value1|label2,value2} + ?{Variable2|label1,value1|label2,value2}&nbsp;}} {{Result:= [[(?{Variable} + ?{Variable2})d10&gt;8]]}} But I would like the drop downs to be at the beginning of the macro (farmed out to other macros at another time like C++ includes) and then be able to use the labels to format the Dice Pool row along with the values and use the values in the Result line. Can I do this without using token or sheet attributes to store the info?
1453868499

Edited 1453868651
Jason P. said: This is both to format the info within a template and then to use the value in the rolls. I know this works... &{template:default} {{name=name}} {{Dice Pool:= ?{Variable|label1,value1|label2,value2} + ?{Variable2|label1,value1|label2,value2}&nbsp;}} {{Result:= [[(?{Variable} + ?{Variable2})d10&gt;8]]}} But I would like the drop downs to be at the beginning of the macro (farmed out to other macros at another time like C++ includes) and then be able to use the labels to format the Dice Pool row along with the values and use the values in the Result line. Sorry, but I don't think I'm quite understanding what you'd like to do, here, so I'll take a blind swing. &{template:default} {{name=name}} {{Dice Pool:= ?{RQ1|A, [A] 1|B, [B] 2} + ?{RQ2|C, [C] 3|D, [D] 4} }} {{Result:= [[ ?{RQ1}d10&gt;8 + ?{RQ2}d10&gt;8 ]]}} This will effectively "output both the label and value of the query variable". Am I close?