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

Expanded Rolls and Roll Template Work-around

1426180142

Edited 1426180161
Toby
Pro
I've been attempting to format my spells using the roll templates, but I have found that nearly all the spells that deal damage require a rolling formula that is completely incompatible with the roll templates. Most damaging spells deal an amount of damage relative to how many Caster Levels up to a maximum amount. That cannot be done using inline rolls it requires the following formula: /r ([[{@{casterlevel},10}dh1]])d6[Fire] <--- Fireball I was wondering what work-around there might be for this.
1426181632
Diana P
Pro
Sheet Author
Only inline rolls work with the roll templates at the moment. :( But I did find this suggestion for nested inline rolls. Maybe if it gets enough votes, we will get them? <a href="https://app.roll20.net/forum/post/1702982/nested-inline-rolls-or-better-helper-functions/#post-1704141" rel="nofollow">https://app.roll20.net/forum/post/1702982/nested-inline-rolls-or-better-helper-functions/#post-1704141</a>
Yes, but there has to be some work around otherwise it would kinda defeat the purpose for even having spell sheets like what are used for the pathfinder legacy.
1426181882

Edited 1426181966
Toby
Pro
Perhaps like doing a pre-roll of some sort and then sending it to the template to be parsed.. I dont care if you cant see the contents of the roll. Just so long as I don't need to use API.. I can barely use scripts that other people create and I find I generally have more problems after using them then they are made to fix.
Honestly, given how relatively few spells have the level cap, I've always just used a @{Level} attribute until I hit that cap and use a raw 10 or 0d0+10 at that point. Not every piece needs an elegant programmatic solution. You use your level attribute up till 10 and you change the macro once when you hit 11 and never have to touch it again.
Um... the majority of the useful damaging spells have a cap in 3.5. I do not desire elegance, I am the first to use spaghetti code if I dont know another way to do things. But that is why they added a max dice argument to the rolls.
1426188974

Edited 1426189360
You can put both the rolls inside like this maybe [[{@{casterlevel}d6,10d6}dh1]][Fire] &lt;--- Firebal That will always have the lowest die roll total of the two so not exactly what you want especially if you roll all ones on one of them.
1426195068

Edited 1426196018
@{casterlevel}d6k10 should also work... it insures you only ever get a result of 10d6 or less, but once your CL passes 10 you'll tend to roll higher results due to keeping the 10 highest rolls... (@{casterlevel}/2)d6k5+(@{casterlevel}/2-0.5)d6kl5 will give a more average result by keeping the 5 highest and 5 lowest rolls... rolling only half of your CL worth of die on each... CL/2 on one and CL/2-0.5 on the other to insure that you roll the correct number of die prior to level 10 example: at CL5 this method will roll 3d6+2d6 keeping all since neither group contains more than 5 die at CL 6 it will roll 3d6+3d6 again keeping all at CL 11 it will roll 6d6+5d6 keeping the 5 highest from the first set and all 5 from the second set at CL 13 it will roll 7d6+6d6 keeping the 5 highest from the first set and 5 lowest from the second set I spent a month asking for the same functionality a while back and this method (at least in my opinion) gives the best result without making your rolls feel too high or too low once you pass CL10
Thank you, Chell, your second one seems like it would be the best bet... But, I'll have to talk to the players about it and try out the rolls a few to see if it gives reasonable results for my game.
It's the calculation I use in my macros... to me all of the other options make spells like Fireball feel either too weak or too powerful past CL10 if you don't manually change it to 10d6 at CL10... That in mind though keeping the 10 highest rolls out of Xd6 does work for making high level spellcasters feel more powerful... while keeping the 10 lowest does the exact opposite and makes the spell feel progressively weaker with every level after 10... Other options such as keeping the lower result of 10d6 & Xd6 often yields the same feeling of growing progressively weaker. It's for this reason that I felt a 50/50 split of Highest/Lowest rolls would be the best option... it does have the drawback of making particularly high rolls unlikely however...
Hrm, I like this it seems to be the best and only option for created a fully automated roll. I have players who are really terrible at fiddling with all of the complicated roll mechanics. And want nothing to do with meddling with the macros. At first I was running into an issue with the roll functioning with the proper fields and inputing the correct fractional max CL with of dice to roll. I still have a fractional output issue. But I think I can probably fix that with a floor or ceil command, I just have figure out what would produce the most accurate results given how this already altering the rolls in a significant way. /em casts @{name}! &{template:pf_spell} {{name=@{spellName}}}{{school=@{spell-school}}} {{level= 0}} {{casting_time=@{castingTime}}} {{components=@{components}}} {{range=@{spellRange}}} {{target=@{targets}}} {{duration=@{spellDuration}}} {{saving_throw=@{saveDC}}} {{sr=@{spellResist}}} {{mel_attack=[[1d20+@{meleeattackbonus}]]}} {{rng_attack=[[1d20 + @{rangedattackbonus}]]}} {{damage=([[(@{casterlevel}/2)@{spelldamDice}k@{spellnumMaxDice}/2+(@{casterlevel}/2-0.5)@{spelldamDice}kl@{spellnumMaxDice}/2]]) }} {{spell_description=@{description}}} This uses the same template as the pathfinder (legacy) game. Running on a heavily customized version of the original 3.5 sheet crafted by Diana P. I still have a few other issues to work through, like getting the Dropdown menu I have for spell school to function as text for the card and as a numeric value for the Spell DC (and interact with spell focus fields.) And after that I have to rewrite some of the code so I can turn it into 11 repeating sections (cantrips, 1-9 and one repeating section for epic spells).
1426276996
Gen Kitty
Forum Champion
Do your very best to avoid using floor/ceil. (X/Y) automatically applies 4|5 rounding, so be creative with your math, adding a fraction here or there so that the rounding goes the direction you like.
Why avoid? Is some technical aspect, or is it just about having the least amount of code?
They don't work with inline rolls
1426294383

Edited 1426295147
the reason for avoiding floor/ceil is two fold... 1) you cannot include floor/ceil for rounding any equation based dice rolls... such as floor(@{casterlevel}/2)d6 will calculate CL/2 and then roll the result of that rounded UP as the number of d6... this is because of reason 2) the order of operations that roll20s dice roller follows has floor/ceil as one of the last processes to run so most anything that needs a result always rounded in one direction will use the unrounded number when possible and auto round to the nearest whole when not possible. It's generally better practice to add/subtract a fractional amount based on your divisor to get the proper rounding from the system without using floor/ceil to force rounding... until the order of operations is fixed to resolve floor/ceil on the fly rather than at the end this will remain a better practice. So floor(X/2) becomes (X-0.5)/2 and floor(Y/3) becomes (Y-0.66)/3.... the goal is to shift all fractional results that you want rounded down to under 0.5 the next whole number will become the first fractional above .5... you can also do ((Y/3)-0.5) since (5-0.66/3=1.44 and will round the same way as ((5/3)-0.5)=1.16 both results are under 0.5 and thus will round down if applied to a dice roll. Only use floor/ceil when working with straight math, any time dice rolls are involved use the above mentioned methods instead. Now, as I mentioned in my first post, that particular equation requires that either the high or the low uses the fractional result in it's roll to get the correct number of dice rolls prior to level 10. If both sides use (CL-0.5)/2 then you'll only roll 4 dice at CL 5 and if neither do then you'll roll 6... so either the high or the low must roll the fractional result to give a total of 5 dice rolls. I don't know if it will actually change anything for you but I find it's best practice to wrap any equations for either side of the dice roll in () to insure that the proper dice are always rolled... and since keep/drop is considered to be a dice roll this would apply to any equation for determining the number to keep. So you might want to change k@{spellnumMaxDice}/2 to k(@{spellnumMaxDice}/2) to be certain that you're not keeping 10 then dividing the total of those 10 rolls by 2... you want to divide 10 by 2 not the result of 10 rolls by 2. This would most likely be the root of your fractional results issue.