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

Need help with armor macro

1609763350

Edited 1609765966
EDIT:  Please disregard -- after a little reworking I have a usable code for this (see below). Feel free to close. &{template:default}{{name=ARMOR DICE 1AD}}{{DMG after Armor=[[?{Damage|0}-?{Armor Breaking|No,[[1d6]]|Yes,[[1d4]]}]]}}{{If AD Reduces DMG to 0, Attacker Rolls a Fumble and Your Armor Dice is Not Spent}} Greetings, adventurers and code-masters! I have a bit of a snag in a macro I'm trying to write, the purpose of which is to quickly calculate damage after reduction by armor (homebrew system, btw). The wrinkle is that the game mechanics include an Armor Breaking weapon/damage type. Normally armor dice would be 1d6, but vs Armor Breaking it's only 1d4. I put together the macro below but it isn't getting the results I need -- player should be able to select whether the DMG is Armor Breaking or not, then plug in the raw DMG and get a result reduced by the dice roll... &{template:default}{{name=ARMOR DICE 1AD}}{{DMG after Armor=?{Vs Armor Breaker|No,[[?{Damage|0}-1d6]]|Yes,[[?{Damage|0}-1d4]]}}}{{If AD Reduces DMG to 0, Attacker Rolls a Fumble and Your Armor Dice is Not Spent}} ... however I must've messed up order of operations somewhere, because instead of a 'no/yes' choice I'm getting a 'no/0' choice on the first drop-down. I'm still fairly green when it comes to macros, so any advice would be greatly appreciated!
1609827602
vÍnce
Pro
Sheet Author
Hi Ryan, more than likely you are running into an issue with nesting queries.&nbsp; Info on wiki: <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> Without using some special character substitutions for the nested query, your macro ends up breaking. Instead of using a nested query with special character substitutions, you might try rearranging your macro so you do not need to nest them. I think you'll get the same functionality without the pitfalls associated with character substitutions. Try this; &amp;{template:default}{{name=ARMOR DICE 1AD}}{{DMG after Armor= [[?{Damage?|0}-?{Vs Armor Breaker|No,[[1d6]]|Yes,[[1d4]]} ]]}}{{If AD Reduces DMG to 0, Attacker Rolls a Fumble and Your Armor Dice is Not Spent}} Cheers