Hey I'm making a subclass for wizard where at lvl 3 they get a d6 resource that increases to a d8 at lvl 5, a d10 at lvl 11 and a d12 at 17. How would the snippet code go thanks
Hey I'm making a subclass for wizard where at lvl 3 they get a d6 resource that increases to a d8 at lvl 5, a d10 at lvl 11 and a d12 at 17. How would the snippet code go thanks
Snippets just display info calculated off of a handful or variables. What you're asking for isn't pulling from any variable. You can put 2d6+1d10 in a snippet field and it'll display appropriately.
@Mairondil Am I ******* this up, or do snippets just not work on homebrew items?
I have an item that gives an ability, and I'm trying to force the Save DC to calculate. it would be savedc:characterlevel+cha+proficiency and another dc for a different effect which is savedc:characterlevel+str+cha+proficiency yet I can't seem to get them to work no matter what I do. I even got rid of characterlevel and just tried a flat "10" in case character level wouldn't work just like how class level only works on subclass features (though character level SHOULD work, just tie it to whoever has the item... but I don't know if the backend has that written up in the code). There's another effect that kicks in at HP of 75% or less, so I put in {{maxhp*(3/4)}} so the player can just always see the exact number instead of needing to math it out, but that doesn't seem to work either.
I've tried all kinds of variations to see if I'm just doing it wrong or what but... no dice.
Maybe I'm just not writing the language right somehow, but I've tried:
and several other ways just to see if it was a language problem... am I missing something stupid? I haven't messed with snippets in a long time and might have forgotten something about the formatting.
Rollback Post to RevisionRollBack
The "Judge My Homebrew" thread, a place to share your homebrew and get comments on it from people before you publish!
@Mairondil Am I ******* this up, or do snippets just not work on homebrew items?
I have an item that gives an ability, and I'm trying to force the Save DC to calculate. it would be savedc:characterlevel+cha+proficiency and another dc for a different effect which is savedc:characterlevel+str+cha+proficiency yet I can't seem to get them to work no matter what I do. I even got rid of characterlevel and just tried a flat "10" in case character level wouldn't work just like how class level only works on subclass features (though character level SHOULD work, just tie it to whoever has the item... but I don't know if the backend has that written up in the code). There's another effect that kicks in at HP of 75% or less, so I put in {{maxhp*(3/4)}} so the player can just always see the exact number instead of needing to math it out, but that doesn't seem to work either.
I've tried all kinds of variations to see if I'm just doing it wrong or what but... no dice.
Maybe I'm just not writing the language right somehow, but I've tried:
and several other ways just to see if it was a language problem... am I missing something stupid? I haven't messed with snippets in a long time and might have forgotten something about the formatting.
There is no place to use snippet codes on homebrew items.
If you're wanting to use a snippet code in a subclass, species, feat, or a custom action, wagnarokkr's suggestion should point you in the right direction.
Okay, I've made a homebrew action: Action type is General, Constitution as it's ability modifier, 1d10 as the dice count/value, a fixed value of +1, and Display as Attack.
Whenever I click the button on my character sheet for it to roll digital dice, it doesn't add the Constitution modifier to the roll. Can anybody help me out?
@Mairondil Am I ******* this up, or do snippets just not work on homebrew items?
I have an item that gives an ability, and I'm trying to force the Save DC to calculate. it would be savedc:characterlevel+cha+proficiency and another dc for a different effect which is savedc:characterlevel+str+cha+proficiency yet I can't seem to get them to work no matter what I do. I even got rid of characterlevel and just tried a flat "10" in case character level wouldn't work just like how class level only works on subclass features (though character level SHOULD work, just tie it to whoever has the item... but I don't know if the backend has that written up in the code). There's another effect that kicks in at HP of 75% or less, so I put in {{maxhp*(3/4)}} so the player can just always see the exact number instead of needing to math it out, but that doesn't seem to work either.
I've tried all kinds of variations to see if I'm just doing it wrong or what but... no dice.
Maybe I'm just not writing the language right somehow, but I've tried:
and several other ways just to see if it was a language problem... am I missing something stupid? I haven't messed with snippets in a long time and might have forgotten something about the formatting.
"savedc" is for calculating a saving throw DC based on a specific ability score using the normal calculation method (which is 10 + proficiency bonus + ability modifier, and doesn't incorporate a character level or class level). You just give it the ability score to use; you don't need to do the calculation yourself. To calculate it based on charisma, it would be:
{{savedc:cha}}
If you want to calculate a save DC using this alternative method you've described, then you don't use the "savedc" snippet, you just do the calculation:
Though I will stress again that that's not how saving throw DCs typically work.
And remember that snippet code like this only works in snippet fields, not in description fields.
Awesome, thanks! It's definitely not a "typical" DC yeah. It's a special thing I'm making for a high level (15+) Curse of Strahd campaign so... let's just say it's fully intended to be quite broken.
I'm looking at this calculation stuff, and my brain isn't wanting to brain, what would you put for an species ability that starts at 1d4, then at 5th lvl goes to 1d6, 11th lvl to 1d8, and 17th lvl to 1d10?
Edit: Nevermind, got some rest and figured it out!
So I want a weapon to have a special abilty of adding Xd6 lightning damage, where X is paladin level. Is this a snippet or something more in order to do this?
Let's ask a more complicated question - Can a snippet do something like min/max but with its simple math? For example, I have a feature that for a class that has 1 use at level 4 and gains 1 additional use at levels 5, 9, 13, and 17 (so max 5 uses). However, I want those uses capped at the character's wisdom modifier.
If the "max" in snippets worked with more than just flat numbers, that'd be easily written as {{(classlevel/4)@roundup,max:modifier:wis}}. But the parser doesn't seem to be replacing those template values and then evaluating, it evaluates the basics first and then replaces (so max and min MUST be hard-coded numbers, like 1, 2, 3, 6). Also, for anyone who doesn't know - min and max don't think 0 is a number. Fun times.
Since snippets don't have access to functions like min or max, is this even possible?
Let's ask a more complicated question - Can a snippet do something like min/max but with its simple math? For example, I have a feature that for a class that has 1 use at level 4 and gains 1 additional use at levels 5, 9, 13, and 17 (so max 5 uses). However, I want those uses capped at the character's wisdom modifier.
If the "max" in snippets worked with more than just flat numbers, that'd be easily written as {{(classlevel/4)@roundup,max:modifier:wis}}. But the parser doesn't seem to be replacing those template values and then evaluating, it evaluates the basics first and then replaces (so max and min MUST be hard-coded numbers, like 1, 2, 3, 6). Also, for anyone who doesn't know - min and max don't think 0 is a number. Fun times.
Since snippets don't have access to functions like min or max, is this even possible?
I'll reply to myself so this notifies instead of whatever editing might do.
The answer is: {{(characterlevel/4)@roundup/((characterlevel/4)@roundup/modifier:wis@min:1)@min:1#unsigned}}. Let's try to break that down like others have:
(characterlevel/4)@roundup - This allows us to have the scaling of 1-5, from levels 1-20 (1-4 = 1, 5-8 = 2, 9-12 = 3, 13-16=4, 17-20=5).
(characterlevel/4)@roundup/modifier:wis - This is saying "get the percentage difference between the previously calculated scale and the modifier". So if characterlevel/4 is higher than the modifier, we'll have a number greater than 1 and if it's lower, we'll have a number less than 1.
Because we want to use integer math (that is to say, whole numbers only), we use min:1 to help us clamp all of the calculations to a minimum of 1.
Here are some example levels and wisdom modifiers to illustrate it:
Level 4, Wis +3 Full formula: (4/4)(rounded up) / (((4/4)(rounded up) / 3) minimum 1) Solving for red: 1 / ((1 / 3) minimum 1) Solving for blue (1/3 becomes .333, which becomes 1 thanks to @min:1): 1 / 1 Final answer: 1
Level 20, Wis +3 Full formula: (20/4)(rounded up) / (((20/4)(rounded up) / 3) minimum 1) Solving for red: 5 / ((5 / 3)) Solving for blue: 5 / 1.666 Final answer: 3
Level 16, Wisdom +3 Full formula: (16/4)(rounded up) / (((16/4)(rounded up) / 3) minimum 1) Solving for red: 4 / ((4 / 3)) Solving for blue: 4 / 1.333 Final answer: 3
Level 9, Wisdom +0 Full formula: (9/4)(rounded up) / (((9/4)(rounded up) / 3) minimum 1) Solving for red: 3 / ((3 / 0 minimum 1)) Solving for blue (we don't divide by 0 because we've used @min:1 to ensure we always divide by at least 1): 3 / 3 Final answer: 1
I also tested this on extremes (via Google Sheets) for levels exceeding 20 (for those DMs/campaigns that go beyond level 20) and for ability scores that exceed 20 (knowing that the D&D max is 30 with all bonuses currently in the game) and the numbers still work.
This works on negative modifiers as well, thanks to the @min:1 ensuring that we're always dividing by a positive 1 (especially since number of uses will always be at least 1).
The reason this works is because we're using the ratio of uses based on level divided by the modifier to determine if the original number should stay the same or go down.
And to state the obvious - this would work with any modifier swapped in instead of Wisdom (in case you wanted to base this on strength, con, etc).
Honestly - I thought this was going to be something a bit more complicated with adding/subtracting, but it ended up being similar to understand how dividing by a fraction is actually multiplying by its inverse (e.g. 5/1.666 is 5 / (5/3) is actually 5 * 3/5, which is 3).
Hope this helps someone as much as it helped me. This is a nice way to tie a feature to either classlevel or characterlevel (if you want to give a Ranger, say, an amount of marks equal to their level) but cap it to some modifier (like wisdom).
Also, just my 2 cents since I'm already typing this - create more features that scale on the classlevel, not the character level or proficiency. You'll find you have less headaches with trying to balance things around the fact that something using proficiency will scale no matter how many points in that class you took.
lol Okay, I’ll take that. But folks should follow Mairondil too, they’re very informative.
Creating Epic Boons on DDB
DDB Buyers' Guide
Hardcovers, DDB & You
Content Troubleshooting
Hey I'm making a subclass for wizard where at lvl 3 they get a d6 resource that increases to a d8 at lvl 5, a d10 at lvl 11 and a d12 at 17. How would the snippet code go thanks
Try <strong>d</strong>{{6+(classlevel/5)@max:1,rounddown*2+(classlevel/11)@rounddown*2+(classlevel/17)@rounddown*2}}
How to: Replace DEX in AC | Jump & Suffocation stats | Spell & class effect buff system | Wild Shape effect system | Tool Proficiencies as Custom Skills | Spells at higher levels explained | Superior Fighting/Martial Adept Fix | Snippet Codes Explored - Subclasses | Snippet Math Theory | Homebrew Weapons Explained
My: FEATS | MAGIC ITEMS | MONSTERS | SUBCLASSES Artificer Specialist: Weaveblade
Dndbeyond images not loading WORKAROUND FIXED!!! (TY Jay_Lane for original instructions)
thanks it worked
is it possible to make a snippet do 2d6+1d10?
Snippets just display info calculated off of a handful or variables. What you're asking for isn't pulling from any variable. You can put 2d6+1d10 in a snippet field and it'll display appropriately.
How to: Replace DEX in AC | Jump & Suffocation stats | Spell & class effect buff system | Wild Shape effect system | Tool Proficiencies as Custom Skills | Spells at higher levels explained | Superior Fighting/Martial Adept Fix | Snippet Codes Explored - Subclasses | Snippet Math Theory | Homebrew Weapons Explained
My: FEATS | MAGIC ITEMS | MONSTERS | SUBCLASSES Artificer Specialist: Weaveblade
Dndbeyond images not loading WORKAROUND FIXED!!! (TY Jay_Lane for original instructions)
@Mairondil Am I ******* this up, or do snippets just not work on homebrew items?
I have an item that gives an ability, and I'm trying to force the Save DC to calculate. it would be savedc:characterlevel+cha+proficiency and another dc for a different effect which is savedc:characterlevel+str+cha+proficiency yet I can't seem to get them to work no matter what I do. I even got rid of characterlevel and just tried a flat "10" in case character level wouldn't work just like how class level only works on subclass features (though character level SHOULD work, just tie it to whoever has the item... but I don't know if the backend has that written up in the code). There's another effect that kicks in at HP of 75% or less, so I put in {{maxhp*(3/4)}} so the player can just always see the exact number instead of needing to math it out, but that doesn't seem to work either.
I've tried all kinds of variations to see if I'm just doing it wrong or what but... no dice.
Maybe I'm just not writing the language right somehow, but I've tried:
{{savedc:characterlevel+str+cha+proficiency}}
(DC {{savedc:10+cha+proficiency}})
(DC={{10+modifier:cha}})
and several other ways just to see if it was a language problem... am I missing something stupid? I haven't messed with snippets in a long time and might have forgotten something about the formatting.
The "Judge My Homebrew" thread, a place to share your homebrew and get comments on it from people before you publish!
There is no place to use snippet codes on homebrew items.
If you're wanting to use a snippet code in a subclass, species, feat, or a custom action, wagnarokkr's suggestion should point you in the right direction.
How to: Replace DEX in AC | Jump & Suffocation stats | Spell & class effect buff system | Wild Shape effect system | Tool Proficiencies as Custom Skills | Spells at higher levels explained | Superior Fighting/Martial Adept Fix | Snippet Codes Explored - Subclasses | Snippet Math Theory | Homebrew Weapons Explained
My: FEATS | MAGIC ITEMS | MONSTERS | SUBCLASSES Artificer Specialist: Weaveblade
Dndbeyond images not loading WORKAROUND FIXED!!! (TY Jay_Lane for original instructions)
Okay, I've made a homebrew action: Action type is General, Constitution as it's ability modifier, 1d10 as the dice count/value, a fixed value of +1, and Display as Attack.
Whenever I click the button on my character sheet for it to roll digital dice, it doesn't add the Constitution modifier to the roll. Can anybody help me out?
Sincerely, Non-stop Homebrewer.
Awesome, thanks! It's definitely not a "typical" DC yeah. It's a special thing I'm making for a high level (15+) Curse of Strahd campaign so... let's just say it's fully intended to be quite broken.
The "Judge My Homebrew" thread, a place to share your homebrew and get comments on it from people before you publish!
I'm looking at this calculation stuff, and my brain isn't wanting to brain, what would you put for an species ability that starts at 1d4, then at 5th lvl goes to 1d6, 11th lvl to 1d8, and 17th lvl to 1d10?
Edit: Nevermind, got some rest and figured it out!
So I want a weapon to have a special abilty of adding Xd6 lightning damage, where X is paladin level. Is this a snippet or something more in order to do this?
Let's ask a more complicated question - Can a snippet do something like min/max but with its simple math? For example, I have a feature that for a class that has 1 use at level 4 and gains 1 additional use at levels 5, 9, 13, and 17 (so max 5 uses). However, I want those uses capped at the character's wisdom modifier.
If the "max" in snippets worked with more than just flat numbers, that'd be easily written as {{(classlevel/4)@roundup,max:modifier:wis}}. But the parser doesn't seem to be replacing those template values and then evaluating, it evaluates the basics first and then replaces (so max and min MUST be hard-coded numbers, like 1, 2, 3, 6). Also, for anyone who doesn't know - min and max don't think 0 is a number. Fun times.
Since snippets don't have access to functions like min or max, is this even possible?
I'll reply to myself so this notifies instead of whatever editing might do.
The answer is: {{(characterlevel/4)@roundup/((characterlevel/4)@roundup/modifier:wis@min:1)@min:1#unsigned}}. Let's try to break that down like others have:
(characterlevel/4)@roundup - This allows us to have the scaling of 1-5, from levels 1-20 (1-4 = 1, 5-8 = 2, 9-12 = 3, 13-16=4, 17-20=5).
(characterlevel/4)@roundup/modifier:wis - This is saying "get the percentage difference between the previously calculated scale and the modifier". So if characterlevel/4 is higher than the modifier, we'll have a number greater than 1 and if it's lower, we'll have a number less than 1.
Because we want to use integer math (that is to say, whole numbers only), we use min:1 to help us clamp all of the calculations to a minimum of 1.
Here are some example levels and wisdom modifiers to illustrate it:
Level 4, Wis +3
Full formula: (4/4)(rounded up) / (((4/4)(rounded up) / 3) minimum 1)
Solving for red: 1 / ((1 / 3) minimum 1)
Solving for blue (1/3 becomes .333, which becomes 1 thanks to @min:1): 1 / 1
Final answer: 1
Level 20, Wis +3
Full formula: (20/4)(rounded up) / (((20/4)(rounded up) / 3) minimum 1)
Solving for red: 5 / ((5 / 3))
Solving for blue: 5 / 1.666
Final answer: 3
Level 16, Wisdom +3
Full formula: (16/4)(rounded up) / (((16/4)(rounded up) / 3) minimum 1)
Solving for red: 4 / ((4 / 3))
Solving for blue: 4 / 1.333
Final answer: 3
Level 9, Wisdom +0
Full formula: (9/4)(rounded up) / (((9/4)(rounded up) / 3) minimum 1)
Solving for red: 3 / ((3 / 0 minimum 1))
Solving for blue (we don't divide by 0 because we've used @min:1 to ensure we always divide by at least 1): 3 / 3
Final answer: 1
I also tested this on extremes (via Google Sheets) for levels exceeding 20 (for those DMs/campaigns that go beyond level 20) and for ability scores that exceed 20 (knowing that the D&D max is 30 with all bonuses currently in the game) and the numbers still work.
This works on negative modifiers as well, thanks to the @min:1 ensuring that we're always dividing by a positive 1 (especially since number of uses will always be at least 1).
The reason this works is because we're using the ratio of uses based on level divided by the modifier to determine if the original number should stay the same or go down.
And to state the obvious - this would work with any modifier swapped in instead of Wisdom (in case you wanted to base this on strength, con, etc).
Honestly - I thought this was going to be something a bit more complicated with adding/subtracting, but it ended up being similar to understand how dividing by a fraction is actually multiplying by its inverse (e.g. 5/1.666 is 5 / (5/3) is actually 5 * 3/5, which is 3).
Hope this helps someone as much as it helped me. This is a nice way to tie a feature to either classlevel or characterlevel (if you want to give a Ranger, say, an amount of marks equal to their level) but cap it to some modifier (like wisdom).
Also, just my 2 cents since I'm already typing this - create more features that scale on the classlevel, not the character level or proficiency. You'll find you have less headaches with trying to balance things around the fact that something using proficiency will scale no matter how many points in that class you took.