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

Saving throw macro help

Hey all, I'm sure I'm doing something wrong, but I'm not sure what. I'm trying to use a macro for a stun/shock save in Cyberpunk 2020. Basically, you roll a d10 under a character's Body score, which can be lowered by wound damage (negative numbers as modifiers). Here's what I wrote: /me Save roll: /roll 1d10<{@{selected|Body}+?{Modifier|0}} What I get in the chat box is: Could not determine result type of: [{"type":"M","expr":1},{"type":"C","text":"d10<(9+-1)"}] Can someone help? EDIT: The character the macro was pulling from had a Body of 9, and I put in a -1 as a modifier.
I'm not sure on how the system works but the greater than sign after the d10 might be messing up your macro. try removing it and see if you get the result you want
No, the less than sign is the operator which makes it a saving throw - I'm comparing the roll to a target number, which in this case is an operation (Body score - modifier). The result in the chat window should tell me the number of successes.
1415206389
The Aaron
Roll20 Production Team
API Scripter
Certainly, the < doesn't seem to like the portion to the right. You can replace the < with + and everything is fine, and you can use just @{selected|Body} as an argument and it works. It's just when the right hand side of < is more complicated than a simple number that it gets upset. Hopefully Brian will post. He has the best knowledge of the dice engine that I know of among players. =D
Yes, that's it. I can change the macro to where the modifier adds to the d10 roll, and it works, but then players are putting in what should be a negative value as a positive value. We can do that as a workaround, but I'm trying to keep it true to the rules.
1415206692
The Aaron
Roll20 Production Team
API Scripter
You could negate it in the formula as a workaround to keep the data correct on the sheet/input.
Maybe have the modifier on the dice? 1d10+?{mod})<@body or is it too early in the morning for me to think? I think this would work
@ The Aaron, how would I negate it, make it -? I don't think subtracting a negative makes a positive in this formula for some reason. @ Jake M., that would actually make a negative modifier make the save easier, when it's supposed to make it harder.
I think if you needed to get under the body mod, it would make it harder. So if your body is 8 and normally you need a 8 or less but with a -2 mod you'd need a six or less. With the + on the roll if you rolled a 7 it become 9 ... failing the check. This removes negatives from your players as the just enter the mod as a positive If i am understanding it correctly!
Yes, that works, if they input the modifier as positive, i was just trying to keep the mechanic the same as the game rules, so as not to confuse them.
Instead of modifier use {wounds} or something? Haha. I know what you mean thkugh
1415211410
The Aaron
Roll20 Production Team
API Scripter
Negating the modifier: /roll {1d10-(?{Modifier|0})}<@{selected|Body} You have to parenthesize the modifier, then it will flip the sign correctly.
Thanks, The Aaron - I think that will work for me!
I actually discovered a way to do it with an inline roll, in case anyone's interested: /me Save roll: [[{1d10-(?{Modifier|0}[MOD])}<@{selected|Body}[BOD]]] successes I added in the [MOD] and [BOD] texts so that it's easy to see what those numbers are for when you mouse over the formula. Thanks everyone for your help!
Actually, I reworded it to make more sense grammatically: /me Save roll successes = [[{1d10-(?{Modifier|0}[MOD])}<@{selected|Body}[BOD]]] seeing "1 successes" in the chat window just bothers me...
1415439006
Gauss
Forum Champion
Just a note: you cannot have more than one term on the right hand side of an inequality ("<" or ">") unless you put that term in inline brackets "[[ ]]". The solution of moving the modifier to the left hand side also works (as you discovered).
Ok, thanks, Gauss!
Well, now you have me curious, each term on the right needs to be in inline brackets, or the whole right side needs to be in inline brackets? Like this: /me Save roll successes = [[1d10 < [[ @{selected|Body} ]] + [[ ?{Modifier|0} ]] ]] Or like this: /me Save roll successes = [[1d10 < [[ @{selected|Body} + ?{Modifier|0} ]] ]] Actually, neither of them is giving me the output I want, so they both must be wrong.
When I do this: /roll 1d10<[[{@{selected|Body}+?{Modifier|0}}]] It works, but when I try to make the same expression an inline roll, like this: [[ 1d10<[[{@{selected|Body}+?{Modifier|0}}]] ]] It just doesn't do anything. Is it not possible to do this expression as an inline roll? The final formula I posted above works, but the output doesn't actually show that you're rolling a d10 against your BOD with a modifier. You're actually modifying the d10 roll. The results are fine, it's just when you mouse over the formula, it looks a little wonky. It's a nitpicky thing, I know, but I'm kinda nitpicky - just want to know if it's possible, and if not, I'll stick with the workaround formula I used above.
1415447960
Lithl
Pro
Sheet Author
API Scripter
You cannot nest inline rolls, and you cannot have an expression on the right side of an inequality (but an inline roll turns an expression into a scalar). Do note that in many cases, you can modify the roll so that you don't have an expression on the right side. For example, d10<Body+Modifier can be changed to (d10-Modifier)<Body .
Ok, that clarifies it. I'll stick with the formula Aaron gave me. Thanks again, everyone!