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

Weird Query Macro Help

So I added a query macro to one of my player's attack macros... It's use is the following: If 0, leave the rolls alone. If 1, reduce attack rolls by 2. If 2 or higher, reduce attack rolls by twice the query input. If 2 or higher, increase max range indicator by twenty times query input - 1. (So a 2 would add 20 to the range indicator) Functions 1-3 work perfectly, having issues with 4. Here's what I coded for it, but it's simply making the macro not show up: [[@{repeating_weapon_0_range}+(((0d0+?{Rapid Fire?|0})>2)*(?{Rapid Fire?|0}-1)*20)]] what do wrong
1426612504

Edited 1426613346
?{Rapid Fire?|0}) > 2) You can't mix math and success checks unfortunately... I'll mess around with it and see if I can find a solution to get you the result you want though. Edit: Try this [[@{repeating_weapon_0_range}+({({?{Rapid Fire?|0},2}kl1)-1, d0}kh1)*(?{Rapid Fire?|0}-1)*20)]] This will compare your input to 2 and if it's under 2 it will keep the input and subtract 1 then compare that to 0 if the input -1 is -1 it will keep 0 and multiply that by the rest of the rest of the equation resulting in only outputting your @{repeating_weapon_0_range} value. so 0 and 1 will both only output @{repeating_weapon_0_range} 2 and up will compare to 2 and keep the lowest (which will be 2) and then subtract 1 and compare that to 0 and keep the highest (which will be 1) and multiply that by the rest of the equation to get @{repeating_weapon_0_range} + ((?{rapidfire}-1)*20)
Holy guacamole, that works. Mad props to you, kind human. I am in your debt!
1426620455

Edited 1426620492
No problem... I actually had a similar issue with one of my macros... unfortunately this solution wouldn't have solved my particular problem but it works for yours so that's still a success. just remember in the future that you can't mix math and success checks... unless the math is only on the left side and surounded by { } brackets such as {2d6+2}>8 any math on the right side or out outside of those brackets will break the roll