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

Help with a roll logic

I am trying to create a roll logic for this: Each creature falling into the pit takes 11 (2d10) bludgeoning damage and is impaled on 1d4 spikes, each of which deals 3 (1d6) piercing damage and 5 (1d10) poison damage.  The closest i managed to get is this 2d10 + [[1d4]]*(d6+d10) but that means it is going to do 4 times a roll of 1d6+1d10.  I then tried   [[1d4]]d6+[[1d4]]d10 But now the roll is a random number of d6 and d10. Is there a way to make sure i only roll 1d4 times for each die? wanting to set this in a trap icon, but if all fails I will just manually roll. This is more for educational purposes in future scenarios.
1540606914
The Aaron
Pro
API Scripter
There isn’t really a way to save a roll forward like that in the Dice Syntax.  API script’s can do this (PowerCards surely has a way), but your only way to automate this without it is either to prompt for the number of spikes with a Roll Query, or create a Rollable Table with every possible combination of outcomes, properly weighted, and roll on that. 
You could possibly make a table, with 4 entries, and roll that once, and have that return 1-4d6 piercing and 1-4d10 poisons.
1540658716

Edited 1540659763
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try: Each creature falling into the pit takes [[2d10]] bludgeoning damage and is impaled on [[1d4]] spikes, dealing up to [[1d6[piercing]+1d10[poison]]], [[1d6[piercing]+1d10[poison]]], [[1d6[piercing]+1d10[poison]]], [[1d6[piercing]+1d10[poison]]] points of piercing and poison damage. and mentally add the numbers necessary. The hover tags will tell you each of the die rolls and what they were. Alternatively, if it is more likely to be important to break out the damage (which it probably is), go with: Each creature falling into the pit takes [[2d10]] bludgeoning damage and is impaled on [[1d4]] spikes, dealing up to [[1d6]], [[2d6]], [[3d6]], or [[4d6]] of piercing damage plus [[1d10]], [[2d10]], [[3d10]], or [[4d10]] of poison damage and just pick the first, second, third or fourth total depending on the result of the d4. Don't get hung up that different rolls produce different numbers, or that the totals do not consistently get larger (3 ones on a d4 could still be less than a single result of four). YOu are simulating completely different rolls, not adding a die to an existing total for each one. Finally, I'd look into putting the whole thing into a roll template or splitting it into different lines, to improve readability: &{template:default}{{name=Pit Trap}}{{description=Each creature falling into the pit takes}}{{bludgeoning=[[2d10]] and lands on  [[1d4]] spikes, dealing up to:}}{{piercing=[[1d6]], [[2d6]], [[3d6]], or [[4d6]], plus}}{{poison=[[1d10]], [[2d10]], [[3d10]], or [[4d10]]}} or Each creature falling into the pit takes [[2d10]] bludgeoning damage and is impaled on [[1d4]] spikes, dealing up to: [[1d6]], [[2d6]], [[3d6]], or [[4d6]] of piercing damage, plus [[1d10]], [[2d10]], [[3d10]], or [[4d10]] of poison damage though either one could still stand some cleaning up. This was quick and dirty.
All good guys. Mainly wanted to use it in the it's a trap section. I can probably create a script and do it there and just use the script in the trap modules. I just dont want to do too much coding after doing so at work.