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

Is there a way to calculate flat bonuses?

I'm doing some finagery where a cantrip gains a increasing attack and damage bonus instead of extra dice, but when I try and copy-paste [[round((@{level} + 1) / 6 + 0.5)]]  into the attack and damage bonus fields it seems to be ignored. Anybody more familiar than I know how to solve it?
1602237235
Oosh
Sheet Author
API Scripter
Is this 5e? It should work in the damage section, though you don't necessarily need the [[ ]] brackets around it. It won't hurt, but it'll mean you won't get the tooltip info on mouseover since the whole damage field is wrapped in brackets by the sheet. The attack section is harder - I'm also confused about what you're trying to do. You're not using the spellcasting modifier for spell attack rolls? Or this is a bonus which only applies to cantrips? Either way, you can't stuff math into those tiny + 0 bonus fields for attack and damage, they only take flat numbers. Given the extremely small number of cantrips with an attack roll that a player is likely to use, you're probably best off just making custom macros for each one. Copy the one straight from the sheet, edit the attack rolls, then make it/them a macro bar button for that player. The alternative would be to just put the flat number in that +0 section and remember to update it at 5, 11 and 17.
I am using the spellcasting modifier, but I want the cantrip to be a +1, +2 and +3 weapon at higher tiers. Can just update it manually if this won't work, no biggie.
1602247526

Edited 1602247822
Oosh
Sheet Author
API Scripter
Dammit, I'm an idiot. There is a way to add custom math to individual attack rolls.... I'd just forgotten about it. Well, a few ways really. Put this into the Crit Range field for your cantrips (assuming the crit range is supposed to be the default 20): 20 + [[round((@{level} + 1) / 6 + 0.5)]][SCALE] Change the SCALE label to something that makes more sense to you, if you like. It makes the tooltip much more readable having something there though. The Damage version you just want to add on to the existing Damage roll, so: 2d10 + [[round((@{level} + 1) / 6 + 0.5)]][SCALE] for example. If you want the full math for the bonus to be readable in the tooltip formula, remove the [[ ]] inline brackets from around the Floor operation. Hopefully that works for you.
Gave it a try. I have ABSOLUTELY NO IDEA why it works if I put it into the crit range but it does. Only problem is, it doesn't display in the total tohit tooltip, but the math works.
1602286279
Oosh
Sheet Author
API Scripter
Hrmmm... do you have a screenshot? Are you using the exact code from above? That shows up in the tooltip on mine. If you've changed it, then post what you're using and I'll have a look. Also, it works because of where the sheet inserts that "20" crit range when it assembles the roll template: {{r1=[[@{Bob|d20}cs> 20 + 4[STR] + 3[PROF]]]}} @{Bob|rtype}cs> 20 + 4[STR] + 3[PROF]]]}} It's the only place in that calculation where you can put some math without affecting any other attacks - for example, you could mess with @{strength_mod) or @{pb} if you wanted to, but that would obviously have an unwanted effect on every other roll that calls those Attributes. That @{rtype} is a bit tricky, but the end of it is essentially the start of roll 2, so {{r2=[[@{bob|d20}
Sorry, I misspoke, when I say tooltip I mean the part where it says, for example, "Magic Stone (+6)" when it's actually +7
1602460073
Oosh
Sheet Author
API Scripter
Ohhhhh yep, the {{mod}} section. Well, now.... how hacky do you want to get? We can use the {{range}} field to do an overwrite on the version of {{mod}} the sheet puts together. So (obviously adjusting the range and the @{ability_mod} to be correct for the cantrip in question), try putting this in the range field: 60 feet}} {{mod=[[round((@{level} + 1) / 6 + 0.5) +@{pb} + @{charisma_mod}]] Note that you don't need the closing }} handlebars on the end, the sheet inserts those automatically, thinking it's closing the "60 feet" range field. Since our {{mod}} field occurs after the sheet's version, it overwrites it.
1602575960

Edited 1602575976
good god that's hacky I love it. Works fine, and I'm glad I know enough to put in the changes I needed (a + for making pretty, a - so it scales 0/1/2/3 instead of 1/2/3/4, and the right attribute mod) Now only place it's wrong is on the sheet itself and that's not a problem.
1602588936
Oosh
Sheet Author
API Scripter
Pffft... what does the sheet know?