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

[MACRO] Trying to determine number of dice to roll from math

So I have a macro where I don't want to have to update the number of dice it rolls as my character levels. I have the math figured out, it goes: [[ ceil(@{Character|level}/2) ]] This returns correctly. If I try to use it to determine the number of dice to roll: [[ ceil(@{Character|level}/2) d6 +1 ]] or /r ceil(@{Character|level}/2) d6 +1 It fails. I'm using the syntax from the Dice Reference under Computed Dice Roll correctly as far as I can see, but it returns: Could not determine result type of: [{"type":"M","expr":"ceil(4/2)"},{"type":"C","text":"d6 +1 "}] Can anyone show me what I'm doing wrong? TIA.
1404245753

Edited 1404245885
Actoba
Pro
Sheet Author
It's not possible due to the order of operations - <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Operations" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Operations</a> Edit : /r (2+2)d6 would work but /r (ceil(2+2))d6 does not
: /
1404255414
Lithl
Pro
Sheet Author
API Scripter
Try [[(@{Character|level}/2+0.4)d6+1]]
1404257583
Actoba
Pro
Sheet Author
Ooo does the system just ignore the decimal fraction if you attempt to roll something like 2.35 d6......iiiiinteresting :)
1404262703
Lithl
Pro
Sheet Author
API Scripter
Well, rolling a fractional number of dice doesn't make sense. =) round() is automatically applied to the number of dice.
1404267173
Actoba
Pro
Sheet Author
/me puts chisel down and backs away from the dice bag slowly I guess I was just expecting it would bomb out instead of applying round to it....good to know...thanks! :)
@Brian: Thanks very much, that works like a charm.