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

Question re: Drop-down menus and stuff in sheets

I'm trying to make a drop-down menu that will list a token's weapons, then roll for that weapon's attack. But it's not working. So a dropdown menu is ?{Menu|Selection 1 name, Selection 1 value|Selection 2 name, Selection 2 value} Then that can be called by ?{Menu} So this works: ?{weapon|@{selected|repeating_weapon_$0_name},@{selected|repeating_weapon_$0_name} |@{selected|repeating_weapon_$1_name},@{selected|repeating_weapon_$1_name}} The weapon in question is a(n) ?{weapon}. !power --name|?{weapon} Giving me the response: Falchion The weapon in question is a(n) Falchion. [Powercard named Falchion] So far, so good. Kinda sloppy actually but that's ok, that's not the point. Then I try this, wherein the value for ?{weapon} is a numeral: ?{weapon|@{selected|repeating_weapon_$0_name},0|@{selected|repeating_weapon_$1_name},1} The weapon in question is a(n) ?{weapon}. !power --name|?{weapon} Which gives the expected response: 1 The weapon in question is a(n) 1. [Powercard named 1] Again, so far so good. This is where I hit the wall: Why doesn't this work? ?{weapon|@{selected|repeating_weapon_$0_name},0|@{selected|repeating_weapon_$1_name},1} The weapon in question is a(n) @{selected|repeating_weapon_$?{weapon}_name} !power --name|@{selected|repeating_weapon_$?{weapon}_name} This gives me the response: No attribute was found for @{selected|repeating_weapon_$?{weapon} No attribute was found for @{selected|repeating_weapon_$?{weapon} 0 The weapon in question is a(n) selected|repeating_weapon_$ [Powercard named selected|repeating_weapon_$] I've tried various iterations with much the same results. Even this doesn't work, although it seems like it should: ?{weapon|@{selected|repeating_weapon_$0_name},@{selected|repeating_weapon_$0_attack-roll}|@{selected|repeating_weapon_$1_name},@{selected|repeating_weapon_$1_attack-roll}} Which should output: @{selected|repeating_weapon_$1_attack-roll} into the chat window but instead gives me [Falchion, &{template:pf_attack] as my single drop-down window option What I want is to list (in the drop-down) the various weapons (by name) available, and have it select the attack-roll button that corresponds to it. Maybe I'm just going about it the wrong way? Obviously I'm missing something, and I'm pretty sure this has been gone over before, but it's a new problem to me. Can you help?
1450750985

Edited 1450751282
Silvyre
Forum Champion
Phnord Prephect said: Why doesn't this work? ?{weapon|@{selected|repeating_weapon_$0_name},0|@{selected|repeating_weapon_$1_name},1} The weapon in question is a(n) @{selected|repeating_weapon_$?{weapon}_name} Due to the order of operations , Attributes must be parsed before Roll Queries can be executed. It's not possible to achieve the opposite (as you've attempted to do) without adding an additional step via API Command Buttons. i.e. [Generate](!
@{selected|repeating_weapon_$?{weapon|@{selected|repeating_weapon_$0_name},0|@{selected|repeating_weapon_$1_name}, 1}_name})
*Sigh* Yeah I figured it was gonna be something like that. Thanks for the code, I'll see what I can do with that.