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

Roll Functions ceil() and floor()

I have a couple of situations where I would like to roll at a fraction of an attribute value, rounded down.  I have tried using the floor() function, but keep receiving an error. Not sure if the function isn't supported as i'm trying to use it, or if i have my () or {} incorrect as i'm not certain as to priority and roles of () and {}. An example would be to roll 1d6 for half of a character's level ie. a level 7 character would roll 3d6.  I receive an error "Could not determine result type". /roll floor(@{Level}/2)d6  Do I need to enter this a specific way (I've tried many)?  Or is the feature not intended to be used as I'm trying?  I know I could set up separate attributes for things like @HalfLevel and @OneThirdLevel, but would be convenient to only have to update one attribute for a level change.   Thanks!
Try /roll [[floor(@{Level}/2)]]d6 You need to use the inline roll feature to make sure that the "floor" stuff is calculated before it attempts to actually parse the "xd6" part -- otherwise it won't work.
Apparently, i didn't try all  the ways... This worked like a charm.  Combined inline with the /roll command, success. /roll [[ floor(@{Level} / 2 ) ]]d6 Thank you!