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

Weapon Selection with macros?

Anyone know if you can create a macro that prompts you to select which weapon you are attacking/damaging with. I hate having to create a macro for each weapon's attack and damage that I add to my sheet. Plus it clogs up my quickbar.
Unfortunately you can't use a Query result to reference to call another attribute. You can query for the raw text to use in your description or the appropriate damage dice to use, but you can't say... query for weapon name, respond "longsword" and have it pull up 1d8 on its own. What I'll generally do is only keep the two most common weapons on my bars. If I need one of the less-frequently used ones, I'll open my character journal and find the macro/ability to roll it directly. If you're using custom macros and they're very compact, you could even consider combining two or more weapon attacks into one macro and just say which one you're actually using at the time of roll. When it comes to multiple attacks like Pathfinder high BAB, or D&D5e Attack Twice classes, I'll absolutely combine both attacks into a single macro so I don't have to hit it twice.
Unfortunately, what you're asking isn't quite doable with a simple macro, exactly. With the API (mentor-level feature) and a little programming, it's possible, and probably quite simple, but there's another option. A macro that asks for weapon attack bonus, damage roll, and crit range is fairly simple to make, and covers pretty much what you need for different weapons. For example: /me attacks with his ?{weapon|fists} and rolls a [[1d20+?{attack bonus|0}]] to hit, which crits on a [[?{crits on|20}+?{attack bonus|0}]]. If it hits, [[?{number|1}d?{sides|1}+?{bonus damage|0}]] damage is inflicted! This macro will put up a prompt for each bit with a "?" in it... if you just hit enter without inputting anything, the bit at the end of that bracketed section is the default. This one asks for, in turn, the weapon name , the bonus added to the d20 dieroll , the crit range of the weapon , the number and sides of the dice rolled for damage, and the bonus damage added to that dieroll. (I may have left something out; if so, I'm sure someone will be along soon enough to correct me.) Its output will look like this: Bill The Swordsman attacks with his Longsword and rolls a [18] to hit, which crits on a [21]. If it hits, [8] damage is inflicted! You can then hover the mouse over each part in [square brackets] in the output to see the actual numbers rolled. (this is Inline rolling ) Hope that helps. -Phnord PS: What MarkG said.
1429693236
Ziechael
Forum Champion
Sheet Author
API Scripter
Which system/sheet are you using?
You can torture these to match your system: Short Bow 0 to 5" /em @{selected|token_name} draws and fires at @{target|token_name} (AC:@{target|bar2}) Hits AC: [[@{selected|bar3} - (1d20 +2)]] /em Damage [[1d6]] if a hit Short Bow 5 to 10" /em @{selected|token_name} releases a shaft at @{target|token_name} (AC:@{target|bar2}) Hits AC: [[@{selected|bar3} - (1d20 +1)]] /em Damage [[1d6]] if a hit Short Bow 10 to 15" /em @{selected|token_name} aims & fires at @{target|token_name} (AC:@{target|bar2}) Hits AC: [[@{selected|bar3} - (1d20)]] /em Damage [[1d6]] if a hit You will need a bunch of macros, but if you put them on the character sheets and make them "token actions" they will only be visible to those who can use them. I use Bar3 for To Hit, and bar 2 for armor class.
I'm using D&D 3.5
1430298001
Ziechael
Forum Champion
Sheet Author
API Scripter
Ok, there isn't currently a way to choose a weapon as part of a macro and then use that weapons stats i'm afraid. I have high hopes for the future though with the upcoming nested inline rolling system! I currently (as a 3.5 GM) have macro's set up for EVERYTHING, i'm kind of addicted. However i tend to limit the ones that get put into the bar to the 2 main weapons. As long as there is an accessible macro for the others it isn't a hardship for a player to type #attack3 if they want to use the weapon in the third spot instead. The best thing is that all of your attack and damage macros can be identical using key queries such as @{selected|weapon1name} etc and just changing the weapon slot number to the appropriate one :)
There actually is a way to sorta 'select' your weapon choices (or any other choice) using Queries... but it results in a lot of pop-ups when you hit the macro. It probably wouldn't be something you edit on the sheet, but you can make your own macro with this and get fancy with templates and such. Attack: [[ 1d20 + ( 0 * ?{Using LongSword?|0} ) + (3 * ?{Using Bow?|0} ) + (1 * ?{Using GreatSword?|0} ) ]] Damage: [[ ( (1d8 + 3) * ?{Using LongSword?|0} ) + ( (1d8+2) * ?{Using Bow?|0} ) + ( (2d6+6) * ?{Using GreatSword?|0} ) ]] What this is essentially doing is giving you three pop-ups; Using LongSword? , Using Bow? , Using GreatSword? with a default response of " 0 ". To select the weapon you want to use, you change it to a 1 . Since the roll Queries in the damage section are exactly the same as the attack roll section, they will use the same value. Any portion where you responded 0 will be multiplied by 0 and not be added to the roll. Whatever weapon you responded 1 to, will be added. The arbitrary numbers in the attack roll (0, 3, 1) represent the attack bonus' for those weapons. The (1d8+3), etc in the Damage section represent the damage those weapons do. You can automate this a little bit if you store your weapon attack rolls and damage rolls as attributes, or replace the raw numbers in this examples with the appropriate calculations for the same. (ie: ( @{BAB} + @{DEX} + @{WeaponEnchantmentBonus} ) or similar.