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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Truncate or Modular Function for Macros

I was wondering if there were a function to mod values, that way I can just update my level instead of editing all my macros that scale with level.  ie: 3MOD2 = 1 If not, is there a way to truncate arithmetic ie: 5/2 = 2.5 to just make that value 2, instead of 2.5 Either of these functions would work, but I do not know if they exist. Much Obliged, J
1374183125
Gauss
Forum Champion
We recently added rounding functions:&nbsp; <a href="https://app.roll20.net/forum/post/242619/update-7-slash-16-transmogrifier-inline-rolls-3d-dice-fixes-rollable-tables-for-everyone-and-more#post-242619" rel="nofollow">https://app.roll20.net/forum/post/242619/update-7-slash-16-transmogrifier-inline-rolls-3d-dice-fixes-rollable-tables-for-everyone-and-more#post-242619</a> Regarding the mod values, I suggest using attributes in your Macros.&nbsp; Pathfinder type attack example (note: I am using @attribute instead of typing out the whole attribute):&nbsp; /roll 1d20 +(floor(@Level*0.75))[BAB] +@Str +@magic [BAB] is a comment indicating that (floor(@level*0.75)) is a rounded down calculation for your Base Attack Bonus. (floor(5*0.75)) would be the Base Attack Bonus for a medium progression BAB in the Pathfinder game system. If @Level were 5 then the result would be: (floor(5*0.75)) = (floor(3.75)) = 3 If you could be more specific about the kind of macro you would like I can help you design it.&nbsp; - Gauss
Thank you very much, that works great! Much Obliged J
1374186153
Gauss
Forum Champion
NP, let me know if you need any further help. :) - Gauss