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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Multiple use out of one query

1385354904

Edited 1385355146
Sam
Sheet Author
One thing that I've noticed that would really help would be the ability the assign the result of a query to a variable so that you can use that result multiple times in the same macro. Example 1: Melee Attack which incorporates One handed or Two handed weapon damage + power attacking [[1d20+@{BAB} +@{Dex} +2+5+?{Attack Bonus|0} + ?{Power Attacking?|0} *@{Power Attack} ]] vs AC. [[2d6+@{Str}+?{Damage Bonus|0}+ ?{Power Attacking?|0} *@{Power Damage}+ ?{Two Handed Attack?|0} *(floor(@{Str}*1.5)-@{Str})+ ?{Two Handed Power Attack?|0} *(floor(@{Power Damage}*1.5)-@{Power Damage})]] damage. Example 2: AC Check /me is displaying current AC Bonuses Main AC: [[10+@{Armor} + @{Shield} + @{Dex} + @{Int} + @{Ring of Protection} - ?{Sword Not Drawn?|0} *@{Int} - ?{Holding Weapon in Both Hands?|0} *1 ]] Touch AC: [[10+@{Dex} + @{Int} + @{Ring of Protection} - ?{Sword Not Drawn?|0} *@{Int} ]] Flat-Footed AC: [[10+@{Armor} + @{Shield} + @{Ring of Protection} - ?{Sword Not Drawn?|0} *@{Int} - ?{Holding Weapon in Both Hands?|0} *1 ]] ( I tried to format the macros to make them more readable but the code tags I tried to use didn't work) These are just two examples of my macros that would seriously benefit from having the ability to ask a certain query once, being able to assign the answer to a variable and then using that variable in the multiple locations that need it.
1385355278
Gauss
Forum Champion
This has already been done in the Rugged Reroll on the Dev server. Rugged Reroll is expected to reach the Prod server December 16th. <a href="http://blog.roll20.net/post/65696743157/context-is-key-rugged-reroll-dev-blog-5" rel="nofollow">http://blog.roll20.net/post/65696743157/context-is-key-rugged-reroll-dev-blog-5</a>
1385359216

Edited 1385359237
Sam
Sheet Author
That's awesome! I had read that dev post but since that part was just a section in a paragraph I didn't grasp the full implications. Thank you for pointing that out.