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

What is wrong with this macro?

I have tried every version of character substitution, etc., but I can't get the dropdown menu to work. &{template:default} ?{Type of Attack| 0 Level Characters and All Wizards, {{name=0-Level Characters and Wizards}} {{notes=[[1t[CT1]]]}}| Thieves, {{name=Thieves}} {{notes=[[1t[CT2]]]}}| Level 1-2 Warriors, {{name=Level 1-2 Warriors}} {{notes=[[1t[CT3]]]}}| Level 3-4 Warriors, {{name=Level 3-4 Warriors}} {{notes=[[1t[CT4]]]}}| Level 5 Warriors, {{name=Level 5+ Warriors}} {{notes=[[1t[CT5]]]}}| Undead, {{name=Undead}} {{notes=[[1t[CTU]]]}}| Monsters, {{name=Monsters}} {{notes=[[1t[CTM]]]}}| Devils, {{name=Devils and Demons}} {{notes=[[1t[CTDN]]]}}| Dragons, {{name=Dragons}} {{notes=[[1t[CTDR]]]}}| Giants, {{name=Giants}} {{notes=[[1t[CTG]]]}} }
1686020805
Gauss
Forum Champion
Hi Joab, Could you describe what you are trying to do first? That would help understand where any potential issues might be. 
1686022249

Edited 1686022276
First error on a quick glance: don’t make a html substitutions outside of roll queries.    Also, it is possible that your rollable tables have characters that will break your query.  Untested and air-coded on mobile: &{template:default} ?{Type of Attack| 0 Level Characters and All Wizards, {{name=0-Level Characters and Wizards}} {{notes=[[1t[CT1]]]}}| Thieves, {{name=Thieves}} {{notes=[[1t[CT2]]]}}| Level 1-2 Warriors, {{name=Level 1-2 Warriors}} {{notes=[[1t[CT3]]]}}| Level 3-4 Warriors, {{name=Level 3-4 Warriors}} {{notes=[[1t[CT4]]]}}| Level 5 Warriors, {{name=Level 5+ Warriors}} {{notes=[[1t[CT5]]]}}| Undead, {{name=Undead}} {{notes=[[1t[CTU]]]}}| Monsters, {{name=Monsters}} {{notes=[[1t[CTM]]]}}| Devils, {{name=Devils and Demons}} {{notes=[[1t[CTDN]]]}}| Dragons, {{name=Dragons}} {{notes=[[1t[CTDR]]]}}| Giants, {{name=Giants}} {{notes=[[1t[CTG]]]}}}
1686023121
Gauss
Forum Champion
Good catch Jarren, I was going broader strokes as I had just walked in the door. :)
1686060694
Ziechael
Forum Champion
Sheet Author
API Scripter
Always good practice to move everything out of a query that doesn't need to be there too: &{template:default} {{?{Type of Attack| 0 Level Characters and All Wizards,name=0-Level Characters and Wizards}} {{notes=[[1t[CT1]]]| Thieves,name=Thieves}} {{notes=[[1t[CT2]]]| Level 1-2 Warriors,name=Level 1-2 Warriors}} {{notes=[[1t[CT3]]]| Level 3-4 Warriors,name=Level 3-4 Warriors}} {{notes=[[1t[CT4]]]| Level 5 Warriors,name=Level 5+ Warriors}} {{notes=[[1t[CT5]]]| Undead,name=Undead}} {{notes=[[1t[CTU]]]| Monsters,name=Monsters}} {{notes=[[1t[CTM]]]| Devils,name=Devils and Demons}} {{notes=[[1t[CTDN]]]| Dragons,name=Dragons}} {{notes=[[1t[CTDR]]]| Giants,name=Giants}} {{notes=[[1t[CTG]]]} }}
That worked. Thanks.
Ignore me if I'm misunderstanding what you're trying to do here, but this macro is just going to select a random result from the relevant crit table. It doesn't matter what die the character is supposed to be rolling or what order the results are in. In order for the DCC crit tables to work properly, you need to use this script . This allows you to select which die to use on a table and counts the results as being in a specific order, so higher rolls get more dramatic crit results. The default character sheets include the PC's Crit Table and Crit Die as attributes, so using this script you can just create a very simple macro like this: !rt @{selected|CritDie_max} @{selected|CritDie} This will roll on the correct crit table using the right die type for whatever character's token is selected (note that you would need to rename your crit tables to match how they're named in the character sheet, or rename the options in the character sheet). The first variable there is just the table to roll on, the second the die to use. Monster crits on PCs are supposed to be modified by the PC's Luck modifier, so for this I came up with the very inelegant solution of selecting the target's token, and then having a different macro for each type of monster specifying which die and table to use. This, for example, is for a 12HD dragon: !rt DR 2d14 - @{selected|Luck_Mod} Again, if I've completely misunderstood what you're trying to achieve, just ignore me.
I was working up to that. But thank you for this. I should have known someone had already done it.
How would you go about getting the macro to display the description in the crit table?
Joab said: How would you go about getting the macro to display the description in the crit table? The macros I shared should output the result to the chat. It looks like this. If you mean doing something like using templates to make it look nice, I haven't bothered. Just seeing the plain text is enough for me. However, in going to find an example to demonstrate how it looks, I've just discovered that there is something wrong with my macros. The monster crit macros are not working correctly for PCs with negative Luck modifiers. Any roll with a double negative just returns a result of 0, like this: Don't know why that's happening. The same problem occurs on my fumble macro.
What I mean is, how do I get the text of the row to show in the results. This is what I have imported. !import-table --I --show !import-table-item --I --Opportunistic strike. Inflict +1d3 damage with this strike. !import-table-item --I --Foe jabbed in the eye! Ugly bruising and inflict +1d4 damage with this strike. !import-table-item --I --Stunning crack to forehead. Inflict +1d3 damage with this strike, and the foe falls to the bottom of the initiative count next round. !import-table-item --I --Strike to foe’s kneecap. Inflict +1d4 damage with this strike and the foe suffers a -10’ penalty to speed until healed. !import-table-item --I --Solid strike to torso. Inflict +1d6 damage with this strike. !import-table-item --I --Lucky strike disarms foe. You gain a free attack if the enemy stoops to retrieve his weapon. !import-table-item --I --Smash foe’s hand. Inflict +2d3 damage with this strike. You break two of the enemy’s fingers. !import-table-item --I --Numbing strike! Cursing in agony, the foe is unable to attack next round. !import-table-item --I --Smash foe’s nose. Inflict +2d4 damage with this strike and blood streams down the enemy’s face. !import-table-item --I --Foe trips on his own feet and falls prone for the remainder of the round. !import-table-item --I --Piercing strike. Inflict +2d4 damage with this strike. !import-table-item --I --Strike to groin. The foe must make a DC 15 Fort save or spend the next two rounds retching. !import-table-item --I --Blow smashes foe’s ankle; his movement speed is reduced by half. !import-table-item --I --Strike grazes temple; blood blinds the foe for 1d3 rounds. !import-table-item --I --Stab enemy’s weapon hand. The weapon is lost and knocked 1d10+5 feet away. !import-table-item --I --Narrowly avoid foe’s counterstrike! Inflict normal damage and make another attack roll. If the second attack hits, you inflict an additional +1d6 damage. !import-table-item --I --Blow to throat. Foe staggers around for 2 rounds and is unable to speak, cast spells, or attack. !import-table-item --I --Foe falls into your attack. He takes +2d6 damage from the strike and curses your luck. !import-table-item --I --Miracle strike. The foe must make a DC 20 Fort save or fall unconscious. !import-table-item --I --Lucky blow dents foe’s skull! Inflict +2d6 damage with this strike. If the foe has no helm, he suffers a permanent loss of 1d4 Int.
The images I tried to import in the last post didn't work. If you have added the Real Rollable Tables Mod, and you are using the default DCC character sheet, then this macro: !rt @{selected|CritDie_max} @{selected|CritDie} with the above table should display this in the chat: provided you have selected a token associated with a character sheet. I did have problems with some macros using the default sheet, but they were resolved by editing the sheet to use "CritTable" as the attribute for which table to roll, instead of the CritDie_max the standard sheet is set to. If you do that of course you need to change your macro to: !rt @{selected|CritTable} @{selected|CritDie}