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 setting MAX Value on macro

September 17 (10 years ago)
OK, have been looking for a couple of days and can find nothing that works / applies to what I'm doing...
(Hope I'm posting in right place...)

First, the working Macro...


/em Damage Total @ Location
[[?{QoS}+?{DR}+?{BN/2}-?{Defenders Armor}]]
Level(s) of damage to location:
[[1d6]]


first bit of math takes diff inputs depending on Quality of successes (how many success rolls you made against opponent's roll) + Damage rating of weapon, + Brawn (STR) divided by 2 (crap, need to have all fractions rounded up...) - Defenders Armor rating.


Problem, is very easy to have a value of more than 6, so want the result to max out at six...


do-able???
September 17 (10 years ago)
Gauss
Forum Champion
Here you go: https://wiki.roll20.net/Dice_Reference#Keep_.2F_Dr...
In short: {whatever you want, 6}kl1
September 17 (10 years ago)
Been studing that page...

[[{6, (?{QoS}+?{DR}+?{BN/2}-?{Defenders Armor})} kl]]


not limiting to 6... when I put qos=1, DR=0, BN/2=4, DR=4 (result should be 1) it added both 1+6 for 7. obviously is a command syntac issue, as this is better than what I've been getting, so what am I doing wrong???

September 17 (10 years ago)
Lithl
Pro
Sheet Author
API Scripter

[[{6, (?{QoS}+?{DR}+?{BN/2}-?{Defenders Armor})}kl1]]

I removed the space before "kl" and added how many items you're keeping (1).

September 17 (10 years ago)
Sweet, syntax error...I kept looking at it and looking at it, thank you very much...now on to bigger and better macros...