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 .
×

Calculating Macros

Hi guys! This is my first post in this forum, so I want to introduce myself: My name is Chris, 33 years old. I'm from Germany (Bavaria to be precise) and have been playing p&p and LARP for roughly 20 years. Me and my group have settled to roll20 due to the ongoing pandemic, and I vounteered to manage the softeware side of things. As I recently started playing arround with macros I encountered a problem. As we have simplyfied the dice-rolling-mechanism in our ruleset to use only one instead of 3d20 to be more convenient and beginnerfriendly we came up with this formula: [1d20 < (attribute1+attribute2+attribute3)/3 ] = success As I understood the syntax the macro utilising an inline-roll should theoretically look like this: [[1d20< (@{MU}+@{GE}+@{KO})/3]]  The formula above uses the attrubite-names from the German "Das Schwarze Auge"-Charsheet. If I now execute the macro like this the outcome is always 1, e.g. success. Here comes the question: Is it possible to perform what I want the macro to do with some code-wizardry, or do I have to do the math myself? thanks for helping out, best regards, Chris
1617024575
Kraynic
Pro
Sheet Author
I think that should work, but you will likely need another set of brackets. [[1d20<[[(@{MU}+@{GE}+@{KO})/3]]]] The inner set of brackets should force the addition/division to be resolved to a number before comparing it to the d20 roll.
Thank you very much! that works just fine! is there a way to automatically upround the resolved equation to a straight number?
I just figured out myself, that there is the "ceil" function. The complete expression looks like this now: /w gm &{template:default} {{name=Fulminictus}} {{ ?{Variante| Schaden, Erfolg:[[1d20<[[ceil((@{MU}+@{GE}+@{KO})/3)]]]]=[[2d6]]TP| Welle der Schmerzen, Erfolg:[[1d20<[[ceil((@{MU}+@{GE}+@{KO})/3)]]]]=[[2d6+15]]TP-A| } }}