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

One drop down box to rule them all!

I just ran across drop down boxes as a new thing in macros this evening and I have been putting them to good use. As a macro creator I prefer making macros that make things easier without needing a new macro for each and every thing I do (I don't need a seperate macro for each and every weapon, save, or skill, etc). I started off with using drop down boxes to set weapon damage and multipliers, and then it hit me? Why am I having to input my weapon multiple times to query different pieces of information? What I really needed was one drop down box that would be repeated, but with a little twist. The twist is that the drop down box is a prefix. I want to use it to query and fill in the first half of all the variables I need. So by selection 'Longsword' I am really filling in a bunch of fields to the tune of ______ damage, ______ Crit chance, ______ crit multiplier, etc. While I could spend my gaming time selecting from drop down menus (I love them, but how many do you want to fill out per attack?), I'd rather set it and forget it (say it with me now, set it and forget it!).  I have a problem in my quest for new, easy to use macros. I can't make it work! I think my problem lies in the order of operations (the query is being completed before my drop down selection gets filled in, thus it isn't getting the full name for the query and it can't find the ability in question). I've tried using the code replacements for the curly brackets to get it to nest, but that hasn't fixed my issue. I'll post some of my macro code below so you can try and troubleshoot with me. D&D 3.5 Melee Attack & Damage Macro [[d20cs>@{?{Which Weapon?|Greatsword|Morningstar|Dagger}cs} + @{bab} [BAB] + @{selected|str-mod} [STR] - ?{Enter Power Attack Penalty|0} + ?{Other Modifiers}]] [[@{?{Which Weapon?|Greatsword|Morningstar|Dagger}dmg} + floor(@{Selected|str-mod} [STR]*?{How many hands?|Two Handed, 1.5| One Handed, 1| Off Handed Light Weapon, 0.5}) + (?{Enter Power Attack Penalty|0}*?{With|Two-Handed, 2| One-Handed, 1}) [Power Attack]]] This macro is customized for my character. It contains the melee weapons he carries and later on will have more information added once the weapons get upgraded. So instead of generic Greatsword it will have +2 Keen Greatsword. Thus I'm going to end up adding an enhancement bonus for the weapon, maybe extra elemental damage for enchants, etc.  For each weapon there is a set of attributes such as Greatswordcs, Greatsworddmg, etc. what can I do to get this idea of mine up and running? Thanks in advance for your help!
1462712389
Ziechael
Forum Champion
Sheet Author
API Scripter
Hi Steve, as you rightly surmised the order of operations is your enemy here. It is attempting to resolve the attributes a few steps before applying the result of the queries which makes this kind of thing impossible with standard macros. You could look into using an advanced, nested, query but the issue you will fall foul of is that you would either needs lots of queries for the different aspects or find a way of mathematically representing your weapon choice in order to use a value that could be applied for all subsequent queries (not fun, trust me). As a pro user I would recommend powercards but as you state you are a player it would require the creator of the game to be a pro user who is willing to run powercards on their game for you to use them. However if they are, and do, you can very easily create a universal weapon macro which, with a single query, allows you to choose the weapon being used. I even have some for things like sneak attack and dual wield that can allow the user to choose primary and secondary weapons as needed. Possibly not the answer you wanted and I'm happy to stand corrected if anyone knows a way to get this to work for Steve (Silvyre I'm looking at you...)
How do power cards allow you to do this kind of thing? I might be able to get access to them, but I'd need to know how to make it work if I did.
1462713139
Ziechael
Forum Champion
Sheet Author
API Scripter
They allow for conditional logic within macros, so in the first instance you could have a query that asks which weapon you are wanting to use after which you could compare the answer to pre-set conditions to output only the desired information taken from the correct attributes. Check em out.
1462723778

Edited 1462724292
Steve said: I have a problem in my quest for new, easy to use macros. I can't make it work! I think my problem lies in the order of operations (the query is being completed before my drop down selection gets filled in, thus it isn't getting the full name for the query and it can't find the ability in question). I've tried using the code replacements for the curly brackets to get it to nest, but that hasn't fixed my issue. I'll post some of my macro code below so you can try and troubleshoot with me. This is indeed a challenge all macro authors will inevitably face. Ziechael's suggestion is excellent—PowerCards is a wonderful API Script. Yet, I'll be more than happy to help get you started with Advanced Roll Queries : ?{Which Weapons?| Greatsword, Attack: [[ d20cs>@{selected|Greatswordcs} + @{selected|bab} [BAB] + @{selected|str-mod} [STR] - ?{Enter Power Attack Penalty|0} + ?{Other Modifiers|0} ]] Damage: [[ @{selected|Greatsworddmg} + floor(@{selected|str-mod} [STR] * ?{How many hands?|Two Handed, 1.5|One Handed, 1|Off Handed Light Weapon, 0.5}) + (?{Enter Power Attack Penalty} * [[ceil(?{How many hands?})]]) [Power Attack] ]] | Morningstar, Attack: [[ d20cs>@{selected|Morningstarcs} + @{selected|bab} [BAB] + @{selected|str-mod} [STR] - ?{Enter Power Attack Penalty|0} + ?{Other Modifiers|0} ]] Damage: [[ @{selected|Morningstardmg} + floor(@{selected|str-mod} [STR] * ?{How many hands?|Two Handed, 1.5|One Handed, 1|Off Handed Light Weapon, 0.5}) + (?{Enter Power Attack Penalty} * [[ceil(?{How many hands?})]]) [Power Attack] ]] | Dagger, Attack: [[ d20cs>@{selected|Daggercs} + @{selected|bab} [BAB] + @{selected|str-mod} [STR] - ?{Enter Power Attack Penalty|0} + ?{Other Modifiers|0} ]] Damage: [[ @{selected|Daggerdmg} + floor(@{selected|str-mod} [STR] * ?{How many hands?|Two Handed, 1.5|One Handed, 1|Off Handed Light Weapon, 0.5}) + (?{Enter Power Attack Penalty} * [[ceil(?{How many hands?})]]) [Power Attack] ]] } Note: I replaced ?{With|Two-Handed, 2|One-Handed, 1} with [[ceil(?{How many hands?})]] for convenience.
1462728105

Edited 1462728713
This is really great. Thank you! Any ideas for how I could get the output onto a power card to clean up the look a little bit? Normally I would just make attack and damage their own lines, but with the way we have it set i'm not sure if that is possible. I'm going to try doing each one as its own power card and see if that works. I'll post back with my results.