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

Shocking Grasp

Hi, sorry if this kind of problem has been already solved or something like that, I looked and couldn't find the solution I'm trying to make an Ability to automaticaly roll the dices for a Shocking Grasp Spell (D&D3.5) based on Caster Level. I devised this: @{Nivel de Conjurador}-(@{Nivel de Conjurador}-5)*((floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1)*(floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1)) It makes 1 for "Nivel de Conjurador"=1 , 2 for 2, 3 for 3, 4 for 4, 5 for 5, 5 for 6, and keeps on 5, since is the limit dice for the spell. It works but when I try to make it roll the dice:  (@{Nivel de Conjurador}-(@{Nivel de Conjurador}-5)*((floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1)*(floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1)))d6 then it won't work, what I noticed (and is not documented on the wiki) is that floor() or ceil() won't roll dices in any way, you can make an expression to compute dice rolls, but these expressions can't contain floor() or ceil(). don't know if it's a bug, all I wanted was for an alternate way to make this roll. For now I'm using the above expression in line to inform about the roll, that would be made manually: roll [[@{Nivel de Conjurador}-(@{Nivel de Conjurador}-5)*((floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1)*(floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1))]]d6 for damage
1378500708
Gauss
Forum Champion
Im not sure I understand the question or problem. The last line in your post is how you need to roll a variable number of dice.  Example: /r [[variable number of dice]]d6  - Gauss
the question is about a way to make my expression work when determining the amout of dice to roll, because it isn't. if you put this expression in line it (using "[[]]")will work, if you roll it (using "/r" or "/roll") it works too, but if you put it in the place of the example you gave above (replacing "variable number of dice") it will not work. What I want is a way around it, a expression better than mine or an easier way to do it (or even an update, if this is a bug or something). again, the expression is this: @{Nivel de Conjurador}-(@{Nivel de Conjurador}-5)*((floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1)*(floor(1/(floor(@{Nivel de Conjurador}/5)+1))-1)) with "Nivel de Conjurador" being an attribute of a character (means "Caster Level" in portuguese), the result to the expression gives a number that equals the variable for Caster Level until 5, when it will keep resulting on 5, because shocking grasp makes 1d6 of damage per caster level, but it is limited to a maximum of 5d6 damage on caster level 5, so anything above caster level 5 will still do only 5d6 damage with this spell. Aniway, thanks very much for the fast replay and sorry if there is anything wrong with my english xD 
oops, sorry, i was mistaken, the /roll line you sugested actually works well with my expression, but what I really wanted was something to use completely in line, without the /roll, and that is not working, any expression that have no floor() or ceil() works well using ("expression")d6. the /roll is already better than my latest sollution, thanks for that ^^. If you know anithing more about the floor() ceil() problem, please let me know
1378632005
Gauss
Forum Champion
In the future, please boil the problem down to the smallest element. It took a lot of work for me to realize that your problem was the following:  Does not work: /r (floor(6/5))d6  Works: /r [[floor(6/5)]]d6 I will ask the Devs whether this is a bug or not.  - Gauss
So, to further clarify this, I've actually just gone and added some documentation to the Wiki on the order of operations for dice formulas: <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Operations" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Operations</a> As you can see, the floor()/ceil() functions are not executed until the very end of the process, after the dice are already rolled, which is why you can't use them before the "d6". However, inline rolls are fully executed prior to the parent roll being executed, which is why that works. Hope that clears things up.
thank you very much for the clarification Riley and Gauss. Sorry for the fuss, I tried explaining the whole problem expecting that maybe someone else had already gonne through this caster level limit problem and maybe existed an alternate, maybe easier way to do this =D. But I'm satisfied with the current sollution, thanks again =D
1380226142
Gauss
Forum Champion
Danilo, another user has come up with a simplified version of your maximum level formula. <a href="https://app.roll20.net/forum/post/364316/macro-to-restrict-the-maximum-modifier-per-level#post-366058" rel="nofollow">https://app.roll20.net/forum/post/364316/macro-to-restrict-the-maximum-modifier-per-level#post-366058</a> - Gauss