Ok, so i wanted to add a limited use pool for a subclass feature, and I write up this equation based on the snippets Take {{scalevalue}} to create up to {{((classlevel/2){{modifier:con}})@rounddown+0}}" but it doesn't accept it as a valid snippet, for context the pool in question is supposed to equate to "half your bloodhunter level+Constitution modifier rounded down (minimum of 2) what do I need to do to get it to work?
Lifesaver, now if only the limited data in actions could have that as well, unfortunately i may have to move it to proficiency bonus+con mod but thank you for sending the working snippet, I suppose I could just tweak the class level bits to {{proficiency}} for this change?
Been trying to get this in to a formula "Armor Class equals 10 + your pact magic spell slot level + your Charisma modifier", with out much joy. Any ideas??
Been trying to get this in to a formula "Armor Class equals 10 + your pact magic spell slot level + your Charisma modifier", with out much joy. Any ideas??
Pact magic spell slots is a hard one to code for. It's one for level 1, two for level 2-10, three for level 11-16, and 4 for 17 and over. I'm thinking some complicated math with {{classlevel}} to get a weird assortment of 1, 2's, 3s, and 4s depending on level.
Been trying to get this in to a formula "Armor Class equals 10 + your pact magic spell slot level + your Charisma modifier", with out much joy. Any ideas??
Pact magic spell slots is a hard one to code for. It's one for level 1, two for level 2-10, three for level 11-16, and 4 for 17 and over. I'm thinking some complicated math with {{classlevel}} to get a weird assortment of 1, 2's, 3s, and 4s depending on level.
I think they just mean the 1-5, not all totaled up. So it should just be {{((classlevel/2@roundup)@max:5)}}
Been trying to get this in to a formula "Armor Class equals 10 + your pact magic spell slot level + your Charisma modifier", with out much joy. Any ideas??
Presuming this is for a Warlock subclass feature, you should be able to use this:
Using your formula of ((10+modifier:cha@min:1)+((classlevel/2@roundup@)max:5)) - I got the error message of "Value modifier cannot be used at current location: @roundup"
How do I specify a Attack and Damage bonus to a specific weapon that I am creating so those bonuses don't somehow get added on to all the other arsenal?
How do I specify a Attack and Damage bonus to a specific weapon that I am creating so those bonuses don't somehow get added on to all the other arsenal?
Add a Modifier, and set it up as Bonus > Magic with Fixed Value being the attack/damage bonus.
Is it possible to use multiple value modifiers in the same snippet? IE.) {{(characterlevel/2)@rounddown@min:2@max:9#unsigned}}
Yes, but it takes a little bit of finesse; you need to add 0 between every modifier. The above example would need to be written as {{(((characterlevel/2)@rounddown+0)@min:2+0)@max:9#unsigned}}
Hey all, was wondering if you guys might be able to solve a conundrum I've been experiencing. Whilst creating a new subclass (sorcerer), a feature of how I should code it is giving me problems, I want to code 2d4 + spellcasting modifier with the 2d4 increasing to 3d4, and then 4d4, at the 11th and 16th class levels, respectively. How would I achieve this?
That was fun, though {{classlevel}} doesn't work in a custom action. {{classlevel}} does work in a subclass action though. So that snippet should work for you.
Just FYI, you don't have to do the +0 stuff, I made it so that you can comma separate any value modifier and it does them one after the other. the @ symbolizes a value modifier, and the # are post processing that happens after all of the snippet value has been calculated.
to "locally" do min/max use the value modifiers with @ {{((characterlevel/2)+modifier:con)@rounddown,min:2,max:5#unsigned}}
to "globally" do min/max after all the calculations have been done use the post processing symbol # {{((characterlevel/2)+modifier:con)@rounddown+(modifier:wis*2)#min:2,max:4,unsigned}} ((characterlevel/2)+modifier:con)@rounddown+(modifier:wis*2) is executed and then #min:2,max:4,unsigned runs after
unsigned/signed are required to be the last post processing params and you will get an error telling you that if you put it before min or max.
Huh, did you work on the parser? Is this use of the comma token newly implemented? This is very helpful information.
Also I'd wondered if there was a post-processing step, the snippet parser had seemed... off, or hard to nail down.
I no longer work at DDB, but yes I wrote the majority of the front end part of the character sheet/builder. my work handle was czarbss, this was a test account I made for some infusion testing last year.
I can't remember if I wrote the multiple variable modifiers in the initial snippet code. But about 1+ year ago (I think), I rewrote the snippet to keep all existing functionality and to support PEMDAS: Parentheses, Exponents (decided against this), Multiplication and Division, Addition and Subtraction. Before it didn't follow the correct order of operations and you had to do parentheses weirdness to get around it. But in regards to the modifiers, when I rewrote it, I tried to make sure that anywhere I could have one of something, to allow N number of them, bc why not?
The post processing step was added because badeye wanted a way for us to specify signed/unsigned numbers. The parser would try to infer signed/unsigned based on if your snippet has a data type that is signed normally (ie. modifiers). Since I added this, I figured for convenience to add min/max as well so you wouldn't have to wrap the entire thing in parenthesis.
I don't really think there are any other nuggets to share. I will say, when I tested my snippets I used in my examples, I was surprised I couldn't put any spaces inside the snippets.. I'm 99% sure I wrote that in and had a test that covered that.
Anyways, I was just reminded of this code by someone and was looking to see how people were using it. I saw that everyone wasn't using the multiple variable modifiers and instead a weird workaround and figured I'd chime in. Glad this was helpful!
Hm-mm! Well, I'm glad you implemented that PMDAS, though it feels rough around the edges. But yeah, the parser doesn't allow spaces. Also no negative operator after an open-paren, which at least can be accomplished with "(0-[expression])".
I've done programming work in the past involving parsers and script interpreters, including some reverse-engineering, so I pick up on these things. I've been tempted to do a complete analysis of the snippet parser since it can be tricky to suss out why it refuses some syntax but not others; unfortunately I also fear causing a lockup. Can you recall any especially "oh heck don't type that!" code we should avoid?
Also, did you use a particular library to implement the parser, or like regex?
Ok, so i wanted to add a limited use pool for a subclass feature, and I write up this equation based on the snippets Take {{scalevalue}} to create up to {{((classlevel/2){{modifier:con}})@rounddown+0}}" but it doesn't accept it as a valid snippet, for context the pool in question is supposed to equate to "half your bloodhunter level+Constitution modifier rounded down (minimum of 2) what do I need to do to get it to work?
Try this:
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)
Lifesaver, now if only the limited data in actions could have that as well, unfortunately i may have to move it to proficiency bonus+con mod but thank you for sending the working snippet, I suppose I could just tweak the class level bits to {{proficiency}} for this change?
Been trying to get this in to a formula "Armor Class equals 10 + your pact magic spell slot level + your Charisma modifier", with out much joy. Any ideas??
Pact magic spell slots is a hard one to code for. It's one for level 1, two for level 2-10, three for level 11-16, and 4 for 17 and over. I'm thinking some complicated math with {{classlevel}} to get a weird assortment of 1, 2's, 3s, and 4s depending on level.
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)
Or use {{scalevalue}} and go add the level scaling data in the feature which can change
Thanks Champs, will have a tinker and see what those ideas produce.
I think they just mean the 1-5, not all totaled up. So it should just be {{((classlevel/2@roundup)@max:5)}}
Creating Epic Boons on DDB
DDB Buyers' Guide
Hardcovers, DDB & You
Content Troubleshooting
Presuming this is for a Warlock subclass feature, you should be able to use this:
{{((10+modifier:cha@min:1)+((classlevel/2@roundup@)max:5))}}
I think.
Creating Epic Boons on DDB
DDB Buyers' Guide
Hardcovers, DDB & You
Content Troubleshooting
Using your formula of ((10+modifier:cha@min:1)+((classlevel/2@roundup@)max:5)) - I got the error message of "Value modifier cannot be used at current location: @roundup"
Sorry, I misplaced a close paren:
((10+modifier:cha@min:1)+((classlevel/2@roundup)@max:5))
Creating Epic Boons on DDB
DDB Buyers' Guide
Hardcovers, DDB & You
Content Troubleshooting
How do I specify a Attack and Damage bonus to a specific weapon that I am creating so those bonuses don't somehow get added on to all the other arsenal?
Add a Modifier, and set it up as Bonus > Magic with Fixed Value being the attack/damage bonus.
welp....simple but thanks.
Just FYI, you don't have to do the +0 stuff, I made it so that you can comma separate any value modifier and it does them one after the other. the @ symbolizes a value modifier, and the # are post processing that happens after all of the snippet value has been calculated.
to "locally" do min/max use the value modifiers with @
{{((characterlevel/2)+modifier:con)@rounddown,min:2,max:5#unsigned}}
to "globally" do min/max after all the calculations have been done use the post processing symbol #
{{((characterlevel/2)+modifier:con)@rounddown+(modifier:wis*2)#min:2,max:4,unsigned}}
((characterlevel/2)+modifier:con)@rounddown+(modifier:wis*2) is executed and then #min:2,max:4,unsigned runs after
unsigned/signed are required to be the last post processing params and you will get an error telling you that if you put it before min or max.
hope this helps ya make your snippets quicker.
Huh, did you work on the parser? Is this use of the comma token newly implemented? This is very helpful information.
Also I'd wondered if there was a post-processing step, the snippet parser had seemed... off, or hard to nail down.
Helpful rewriter of Japanese->English translation and delver into software codebases (she/e/they)
I no longer work at DDB, but yes I wrote the majority of the front end part of the character sheet/builder. my work handle was czarbss, this was a test account I made for some infusion testing last year.
I can't remember if I wrote the multiple variable modifiers in the initial snippet code. But about 1+ year ago (I think), I rewrote the snippet to keep all existing functionality and to support PEMDAS: Parentheses, Exponents (decided against this), Multiplication and Division, Addition and Subtraction. Before it didn't follow the correct order of operations and you had to do parentheses weirdness to get around it. But in regards to the modifiers, when I rewrote it, I tried to make sure that anywhere I could have one of something, to allow N number of them, bc why not?
The post processing step was added because badeye wanted a way for us to specify signed/unsigned numbers. The parser would try to infer signed/unsigned based on if your snippet has a data type that is signed normally (ie. modifiers). Since I added this, I figured for convenience to add min/max as well so you wouldn't have to wrap the entire thing in parenthesis.
I don't really think there are any other nuggets to share. I will say, when I tested my snippets I used in my examples, I was surprised I couldn't put any spaces inside the snippets.. I'm 99% sure I wrote that in and had a test that covered that.
Anyways, I was just reminded of this code by someone and was looking to see how people were using it. I saw that everyone wasn't using the multiple variable modifiers and instead a weird workaround and figured I'd chime in. Glad this was helpful!
Hm-mm! Well, I'm glad you implemented that PMDAS, though it feels rough around the edges. But yeah, the parser doesn't allow spaces. Also no negative operator after an open-paren, which at least can be accomplished with "(0-[expression])".
I've done programming work in the past involving parsers and script interpreters, including some reverse-engineering, so I pick up on these things. I've been tempted to do a complete analysis of the snippet parser since it can be tricky to suss out why it refuses some syntax but not others; unfortunately I also fear causing a lockup. Can you recall any especially "oh heck don't type that!" code we should avoid?
Also, did you use a particular library to implement the parser, or like regex?
Helpful rewriter of Japanese->English translation and delver into software codebases (she/e/they)
This is amazingly helpful. I hadn't seen this documented anywhere and coding anything beyond sheet macros is well over my head.
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)
I know, right?! I'll be going through my snippets and see what can get flattened into comma-separated modifiers!
Helpful rewriter of Japanese->English translation and delver into software codebases (she/e/they)