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

Compare the Values of a role to a variable with math to determine a success

1741456807

Edited 1741459515
Hello I have a macro question I want to Build a shadowrun Macro to determine if a Contact will pick up when you try to call them. The logic for this is that you start with a dice pool of 13 from that you subtract the Contacts Connection rating (First number variable) that number of dice get thrown and everything above a and including a 5 is a success. That number of successes than should be put against a base value of 6 - The contacts Loyalty (Second Number Variable) No dice here just simple math. So far I did this with people having to use brains, like this: /me rolls to Call ?{Handle} [[(13 - ?{Connection})d6>5]] hits to a threshold of [[(6 - ?{Loyalty})]] What I would like is something like this (I know this doesn't work like this but i am fairly new  to the Macro game so please forgive me, I am sure the whole problem is formatting/syntax based anyway.):  /me rolls to Call ?{Handle} {{[[(13 - ?{Connection})d6>5]] > [[(6 - ?{Loyalty})]]}=Success} Any help is greatly appreciated.
No, you have it almost right, [[ { [[(13 - ?{Connection})d6>5]], 0 }>[[6-?{loyalty}]] ]] returns you 1 if the number of successes on the first roll is greater than 6-loyalty. EDIT: And here's a bit fancier version: &{template:default} {{name=Calling ?{Handle}... [ ](#" hidden null=) }} {{[0](#" hidden)= }} {{[1](#" hidden)=They do not answer. }} {{[[[ { [[(13 - ?{Connection})d6>5]], 0 }>[[6-?{loyalty}]] ]]](#" hidden)=They answer. }} {{[0](#" hidden)=[ ](#" hidden null=) }}
Hey thank you this looks really nice and seems to work, but there is one small error with your honestly very fancy version! When it works it displays both answers. Any idea how to fix that out ?
It shouldn't display both, and doesn't in my testing - are you sure you copied it exactly?
1741466343

Edited 1741466487
Ahh I found the error. Its not in your code but my testing, to see if it would work positively, I put in Loyalty 6, which is the maximum for this in this system. But with the math, I then get both answers, with smaller loyalty's it work. Any idea how to catch that specific case ? Edit: I actually realized that it is not relevant because you cannot fail at that point. So yes this works great! Thank you a lot!
Oh, I see how that happens (if 6-loyalty is 0, it catches the extra 0 as a success and the result ends up out of range), that can be fixed either way: &{template:default} {{name=Calling ?{Handle}... [ ](#" hidden null=) }} {{[0](#" hidden)= }} {{[1](#" hidden)=They do not answer. }} {{[[[ { [[(13 - ?{Connection})d6>5]], -1 }>[[{6-?{loyalty},0}kh1]] ]]](#" hidden)=They answer. }} {{[0](#" hidden)=[ ](#" hidden null=) }} This way, the group filler can never be counted as a success. EDIT: To explain the behavior a little, the template rows overwrite each other from the bottom if they share the name (the part left of the =), so by using the roll to make the success row's name either 0 or 1, we control which of the two are shown (as if it resolves to 1, it overwrites the fail row, if it resolves to 0, it is overwritten by the bottom row and the fail row is shown).
Thanks a lot. It works great and thank you for the explanation as well!