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 needed understanding how Roll20 interprets things such as { [ [[ | etc and not sure what to even search for.

I have a fairly simple use case for a 5E NPC attack:  It's a sword that does 3 damage types (slashing, necrotic, and fire) and I managed to get everything working except that the necrotic dice doesn't roll twice for crits.  One the npc sheet I have the following in the field for ON HIT 2: 2d10[necrotic]]] necrotic + [[1d10[fire]. It's ugly, but it works EXCEPT necrotic doesn't do crits and I don't understand why. I have been so far unsuccessful looking through roll20 official pages and forum posts related to inline rolls and such trying to find info about this.  I'm not even sure what this type of coding/feature is called to do a proper search.  For short term I'd just like to get this attack to work, but for future use I'd like to know more about how [[1d20]] is treated differently from 1d20]] and all of that.  Is there a page or post that gives the details of how roll20 handles all of those different types of symbols?
Assuming you're using the D&amp;D 5E (2014) sheet and not the new 2024 sheet, if you want to see the damage roll separate for the Necrotic and Fire damage, then put this into the Damage2 field: 2d10[Necrotic]]] + [[1d10[Fire] And put this into the Damage2 Type field: Necrotic + Fire The extra 'necrotic' label outside of the roll is messing up the crit rolls. Your output should look like this (showing a non-crit and crit roll comparison): Luke B. said: I'd like to know more about how [[1d20]] is treated differently from 1d20]] and all of that.&nbsp; Is there a page or post that gives the details of how roll20 handles all of those different types of symbols? <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a>
1727722111

Edited 1727722217
timmaugh
Pro
API Scripter
Hi, Luke... Double brackets indicate an inline roll. A proper inline roll has both opening and closing sets of double brackets... but put a pin in that just for a second. If Roll20 encounters the opening double brackets, it thinks it's in an inline roll, and it begins to parse the next bit of text as roll equation syntax. If it runs into something unexpected (like you used the double-opening-brackets just in a bit of text, not with a proper roll equation), then you'll get a crash. Within the double-brackets of an inline roll, you can have certain components enclosed in single-brackets. For instance, a roll against a table, you would put the table in single brackets: [[ 1t[FunTimeActivities] ]] Also within the double brackets of an inline roll, you can use single brackets to set off a label for part of the roll equation: [[ 2d10[necrotic] ]] Outside of an inline roll, a set of single square brackets don't mean anything to Roll20 -- though some scripts will look for variations of text pattern involving a set of square brackets. That's beyond the scope of your question, but I wanted to mention it in case you see people using them elsewhere. Now, as for the text you have in the attribute you reference: 2d10[necrotic]]] necrotic + [[1d10[fire] ...Very likely, your sheet is embedding the attribute you're looking at is, itself referenced in another attribute like this: [[ @{OnHit2} ]] In other words, the opening and closing double brackets of a roll are supplied. By *not* including them in the attribute that shows "2d10[necrotic]...", you are basically tricking the construction into breaking one roll into 2. For instance, if you take: [[ variable ]] ...and you replace "variable" with "1d10", you get: [[ 1d10 ]] ...which is a single inline roll. However, if you replace it with "1d10]] and [[2d6", you get: [[1d10]] and [[2d6]] ...which is 2 inline rolls and a bit of text between them. That is closer to what you're doing... supplying the makings of 2 rolls while counting on the double brackets already in the other attribute. You can read more about inline roll syntax here . Now, as to your question about the necrotic damage not "critting", what do you mean? What would a crit look like? Would you expect a different behavior, or more dice rolled? Or is it just a matter of formatting of the roll output?
1727722404

Edited 1727725167
So, the npc attack field that you enter that is enclosed in an inline roll, so in the template,&nbsp; 2d10[necrotic]]] necrotic + [[1d10[fire] becomes [[ 2d10[necrotic]]] necrotic + [[1d10[fire]]]. The critical field of the npc damage template, I believe, loads up the above, but the "necrotic" breaks it up, and only [[2d10[necrotic]]] is added (in my testing it was the first roll that was used for the crit). The simplest way to do this is to just add them together - as 2d10[necrotic]+1d10[fire] in the on hit field, and have the damage type as necrotic/fire. EDIT: One way to get the output you want is to just straight up override the template - ignore the "on hit 2:" part of the the attack, and append the following into the description, and it'll work just the way you want: }} {{dmg2flag=1}} {{dmg2=[[2d10]] necrotic + [[1d10]] fire}} {{crit2=[[2d10[necrotic]]] + [[1d10[fire]]] Explanation: when the attack is sent to the chat, a template loads the fields of the attack on the sheet, and the template fields are contained in double braces. If two or more template fields have the same name, the latest one overrides the earlier ones, and by placing closing double braces in the description field, the description field is closed, and you can write stuff outside the description in the template - including custom output for rolls.
Hey all, wow! thanks for such speedy replies.&nbsp; I'm still experimenting with the ideas you have shared. Jarren said: Your output should look like this (showing a non-crit and crit roll comparison): I am using the 2104 5e sheets, yes.&nbsp; I get a very different output than your image here shows, but maybe that is because I am using this for an npc.&nbsp; I think I should have made that more obvious in my original post.&nbsp; Here is what my output looks like: Here's the damage types for more clarity:&nbsp; 8(slashing) + 7(slashing crit roll) + 11(necrotic) + 9(fire) + 11(2d10).&nbsp; The necrotic is 2d10 so that last one is the necrotic crit roll.&nbsp; The fire crit roll is missing and the order of the damage is mixed and therefore not obvious without hovering over with the mouse.&nbsp; I don't know why this is so different from what you have, but my theory is that it has something to do with the difference between PC sheets and NPC sheets.&nbsp; If I could get it to look like you have it, I think that would be ideal.&nbsp; I have gotten the correct results with acceptable output using Tuo's suggestion, so if I can't get the results like you have I can still do it that way.&nbsp;&nbsp; Thank you also for the dice reference link. That is what I was looking for and I wouldn't have thought to search for that timmaugh said: Now, as to your question about the necrotic damage not "critting", what do you mean? What would a crit look like? Would you expect a different behavior, or more dice rolled? Or is it just a matter of formatting of the roll output? I really appreciate your response.&nbsp; All the tricks and info you shared is exactly what I was looking for.&nbsp; I can see now how the ]] [[ is a little bit of a hack/workaround to insert extra stuff into the code. To answer your question about critting, in this system a crit is when the attack roll is a 20 on a d20. When you crit, the dice rolled for damage is rolled an extra time and both rolls are added to the total.&nbsp; In this specific case, the main damage is 1d8 slashing, the extra damages are 2d10 necrotic and 1d10 fire.&nbsp; When a crit happens it should roll 1d8 + 1d8 slashing, 2d10 + 2d10 necrotic, and 1d10 + 1d10 fire.&nbsp; I was getting very close to having this work, but I was missing the extra 2d10 necrotic roll when a crit happens.&nbsp; Trying out Jarren suggestion got me the opposite result: everything worked except I was missing the extra 1d10 fire roll when a crit happens.&nbsp; I'm expecting a different behavior (another dice roll) that isn't happening.&nbsp; I would prefer the formatting is clear and doesn't need anyone to hover over to tell the damage types, but that's secondary. Tuo said: EDIT: One way to get the output you want is to just straight up override the template - ignore the "on hit 2:" part of the the attack, and append the following into the description, and it'll work just the way you want: }} {{dmg2flag=1}} {{dmg2=[[2d10]] necrotic + [[1d10]] fire}} {{crit2=[[2d10[necrotic]]] + [[1d10[fire]]] This worked for me as you can see here: The dice rolls work, so now I wanted to make the damage types more clear.&nbsp; The hover-over does show the damage types, but I'd like it to be clear at a glance.&nbsp; I noticed this is a similar hack to the ]]&nbsp; [[ idea but with }}&nbsp; {{ instead.&nbsp; If I now understand this correctly, I think I can add text to the crit2 field outside of the [[&nbsp; ]] that surrounds the dice roll and it will not be factored into the math of the dice roll and just output as text.&nbsp; This is what I added (the underlined bits):&nbsp; }} {{dmg2flag=1}} {{dmg2=[[2d10]] necrotic + [[1d10]] fire}} {{crit2=[[2d10[necrotic]]] necrotic + [[1d10[fire]]] fire and this is the output I got from that: It's still not as nice as Jarren's result output, but this is workable.&nbsp; I've accepted the fact that the npc is going to have this formula mess for the DM to see, but at least I now have something that outputs the right results. Maybe I could take this idea of hijacking the description and just make a custom output for the whole attack.&nbsp; This has been very helpful.&nbsp; Thank you all.&nbsp; I'm going to keep tinkering as I'd really like the two necrotic damage rolls to be side by side and the same for the fire damage (like how the slashing damage is displayed.
1727810336
timmaugh
Pro
API Scripter
I don't play this system, so you'll get better responses from the others on what you're trying to do, specifically. On the topic of hijacking the output, though, I'd point you at learning about roll-reuse and potentially using %NEWLINE% in your output to format your report better. For instance, you can report the total damage (your outermost roll) in one line, then "reuse" the interior rolls in subsequent lines to report what component part they were: Damage : 40 Slashing: 6 Necrotic: 10 Fire: 4 Necrotic: 5 Fire: 4 Also, if you *really* want to hijack the output, you could have a script output a template for you, which would let you reuse the rolls in even more ways... for instance, conditionally comparing whether the d20 roll was a natural 20, in which case you would know you have a crit... offering you the opportunity for more formatting or more concise reporting. ScriptCards or the Metascript Toolbox could do something like that for you.