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

How to use only one user Query to output different values with the given answer

Hello there! Trying to figure out some macros usage for "automate" a Fire Emblem game. Everything is in place except for ONE thing. A battle preview macro button. I don't know how to go forward with my current idea. The player is asked to select which Unit Attacks (One of his), and then select the one it will attack (and defend against the enemy counter attack if able). After that, he is prompted if he wants to use his Weapon # 1, 2 or 3 for the fight. Here is the Macro so far &{template:default} {{name=Fight Preview between @{target|Attacker|character_name} and @{target|Defender|character_name}!}} {{Weapon # Hit:=[[floor(((@{target|Attacker|Skill})*1.5 + (@{target|Attacker|Luck})/2 + ?{Weapon Used|1, @{target|Attacker|Weapon 1 Hit}|2, @{target|Attacker|Weapon 2 Hit}|3,@{target|Attacker|Weapon 3 Hit}} + @{target|Attacker|Bonus Hit} + ?{Attacker Bonus Hit|0}) - ((@{target|Defender|Speed})*1.5 + (@{target|Defender|Luck})/2 + @{target|Defender|Bonus Avoid}))]]}} I've put in Bold the important part. What I want to do is to reuse the answer given there (Let's say, 2) and later in the macro, use:  ?{Weapon Used|1, @{target|Attacker|Weapon 1 Damage}|2, @{target|Attacker|Weapon 2 Damage}|3,@{target|Attacker|Weapon 3 Damage}}. Replacing the "Hit" by "Damage". Right now, it doesn't just check what answer was given, it check the previous output of the query. Is there a way to bypass that? Thanks
1547445840
GiGs
Pro
Sheet Author
API Scripter
Unfortunately, it's impossible. The only way to do that (without a Pro-level subscription) is to add another query for the player to choose which weapon damage to use.
1547452477

Edited 1547452516
If two queries are totally identical, then they'll only get asked once, but in your case, they're not.  You might consider breaking your macro up into multiple parts, the first part gives you a neat header, and a query for which weapon, then the query calls one of 3 other macros, each of which is the preview for one weapon.  This idea would likely work better with 'chat menu' style buttons.