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

New to roll20

new to roll20 and have no idea how to write macros I'm trying to make an attack macro incorporating the paladin smite ability and not having any luck at the moment. currently wielding a longsword which can be used 1H or 2H and I have the great weapon fighting ability that lets me reroll 1s and 2s on damage. Could really use some help
1483295030
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What system are you playing and what sheet for that system is your game using?
D&D 5E and its the 5E srd sheet
does the format change depending on the sheet being used?
1483296397
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Not necessarily, but some sheets can implement the implement the code differently. The Shaped sheet can let you define global attachers, so that you have the option of adding the smite to any attack you might happen to roll without having to code it into every attack. I don't know if that functionality exists with the SRD sheet.
oh ok. i quite suck in this area so i need as much help as possible
1483310228
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, now that I'm home and on my computer I can actually give a useful answer (illustrating macros sucks on a phone). The easiest way to do this on the 5e OGL sheet doesn't require making a whole new ability. You can do everything you need from within the attacks & spellcasting section of the sheet. Put this in the damage field of your lonsword: ?{Longsword Wielded with|1 hand,1d8|2 hands,1d10}ro<2 ?{Smite|No, |1st level slot,+2d8|2nd level slot,+3d8|3rd level slot,+4d8|4th level slot,+5d8} So your attack will look like so on the sheet: If you want to get really fancy, it is possible to account for the bonus damage vs undead/fiends as well if you want to.
i would like to account for the bonus agains undead/fiends would i just add the 1d8 after that last 5d8?
writing code is not my cup of tea
Try this out: ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 ?{Divine Smite|No, |1st level slot, + 2d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|2nd level slot, + 3d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|3rd level slot, + 4d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|4th level slot, + 5d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]}
1483313005
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I'd probably add the following to each option in the smite query after each d8 damage roll (e.g. the 2d8 for a first level spell slot): ?{Undead/Fiend Target|No, |Yes,+1d8}
1483313074
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
ninja'd by Silvyre because I took too long.
nice thanks. both work nicely trying to edit them to work with different weapons
Scott C. said: I'd probably add the following to each option in the smite query after each d8 damage roll (e.g. the 2d8 for a first level spell slot): ?{Undead/Fiend Target|No, |Yes,+1d8} what would adding this do?
Scott C. said: ninja'd by Silvyre because I took too long. I take all the help I can get. the more the merrier.  I'm trying to edit them to use with a great axe and a scimitar. but looks like it not going well I have 2 paladins. one uses the longsword the other uses the great axe and a glaive then I have a fighter that's multiclassing into a rogue then probably a paladin I found this sneak attack one that Silvyre wrote that works pretty awesome while i was using google to try and figure this all out on my own. now I'm just trying to put it all together to work with the various weapons
1483318184
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Donrick P. said: Scott C. said: I'd probably add the following to each option in the smite query after each d8 damage roll (e.g. the 2d8 for a first level spell slot): ?{Undead/Fiend Target|No, |Yes,+1d8} what would adding this do? It's the same thing that Silvyre did in his, he just put the whole shebang out there.
Donrick P. said: scimitar Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with 1d6 great axe Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with 1d12ro<2 glaive Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with 1d10ro<2
Silvyre said: Donrick P. said: scimitar Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with 1d6 great axe Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with 1d12ro<2 glaive Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with 1d10ro<2 Thanks for all the help. both of you. these work great and the scimitar i place ?{Sneak Attack|No, 0|Yes, [[ ceil((@{base_level}) / 2) ]]d6 [Sneak Attack]} on the second damage line.
the ro<2 option on the longsword. is that in general or only when the 2 hand option is chosen?
Donrick P. said: the ro<2 option on the longsword. is that in general or only when the 2 hand option is chosen? Ah, that needs to be fixed. Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with ?{Two-handed attack|No, 1d8|Yes, 1d10ro<2}
1483325358

Edited 1483325474
Donrick P. said: the ro<2 option on the longsword. is that in general or only when the 2 hand option is chosen? Ah, that needs to be fixed. Replace ?{Two-handed attack|No, 1d8|Yes, 1d10}ro<2 with ?{Two-handed attack|Yes, 1d10ro<2|No, 1d8}
Silvyre im using this sneak attack macro that you made that i found while google macros {[[ ceil((@{base_level}) / 2) ]]d6 [Sneak Attack]} i took out the first part so that it just rolls the damage without the yes or no prompt how do i fix this so that it scales with the rogue level when multiclassing and the rogue is not the first class chosen. it scales fine when rouge is primary class but doesnt when rogue is chosen second
Replace @{base_level} with @{multiclass1_lvl}
thanks alot
is it possible to make this a standalone so that it works by itself to be put in the damage 2 slot and combine it with the sneak attack one? ?{Divine Smite|No, |1st level slot, + 2d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|2nd level slot, + 3d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|3rd level slot, + 4d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|4th level slot, + 5d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]} ?{Sneak Attack|No, 0|Yes, [[ ceil((@{base_level}) / 2) ]]d6 [Sneak Attack]}
1483502635

Edited 1483502704
Place a 0 before the ?{Divine Smite} Query (without a plus sign between them). After the ?{Divine Smite} Query, add a plus sign and then the ?{Sneak Attack} Query.
1483503552
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
could also just add +0 into the No option for divine smite.
1d6 ?{Divine Smite|No, |1st level slot, + 2d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|2nd level slot, + 3d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|3rd level slot, + 4d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|4th level slot, + 5d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]} ?{Sneak Attack|No, 0|Yes, [[ ceil((@{base_level}) / 2) ]]d6 [Sneak Attack]} is there to incorporate the assassin archetype auto crit into these or would i just have to roll a separate damage die?
1484410858
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yes, there is, but as a fair warning, it's gonna look a little weird. There are two ways to do this, and it's going to depend on how you have your sheet set up. The first way should only be used when you have your sheet set to auto-roll damage and the attack at the same time. Add the following to the very end of whatever you have in your description field on the sheet for your attack: }} ?{Assassinate|No, |Yes, {{crit1=[[@{dmgbase}]]}} {{crit2=[[@{dmg2base}]] } This works because the description field is auto wrapped in {{ }}  by the sheet when it is output to chat. So, you're just taking advantage of the presence of the ending }}. If you don't have a 2nd damage type, you can leave off everything after @{dmgbase}. If your weapon does a custom amount of crit damage, you can change @{dmgbase} and @{dmg2base} to @{dmgcustcrit} and @{dmg2custcrit} respectively. Now, if you have your sheet set to not auto-roll damage and crit (have to click on the weapon name in chat to roll the damage), you'll want to slightly modify the above, otherwise you will be prompted for your damage queries twice. If this is the set up you've go, enable ammo tracking on your sheet settings tab (you don't need the API for what we're going to do). After ammo tracking is turned on, there will be an ammunition field added to your weapons on the core tab. Add the following to the end of that field: ?{Assassinate|No, |Yes, {{crit1=[[@{dmgbase}]]}} {{crit2=[[@{dmg2base}]]}} } This works because the ammunition field is inserted after ammo= in the sheet generated roll template, but is not wrapped in {{ }}. Image of both ways applied to a weapon:
the damage rolls fine when i select no. but nothing happens when i select yes
1484423259
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Doh, and I'm an idiot. Scratch all that complicated stuff. Just replace the 20 in Crit Range with this: ?{Assassinate|No,20|Yes,1}
that works out perfectly found this second wind macro that Silvyre. it works fine. was trying to put in @{base_level} so that i dont have to keep editing the level every time i level up. but all attempts to make the necessary changes keep getting me this error: TypeError: Cannot read property 'substring' of undefined /em uses Second Wind to regain [[ 1d10 + 2 [Fighter Level] ]] hit points as a Bonus Action.
1484491246
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What are you typing in?
i was just trying to replace various parts of + 2 [Fighter Level] ]] with @{base_level}
how would i take this and have it prompt for the level i want to cast it at instead of just printing all 5 levels at once? &{template:default} {{name=Ensnaring Strike}} {{1st level=[[1d6}]]}} {{2nd level=[[2d6}]]}} {{3rd level=[[3d6}]]}} {{4th level=[[4d6}]]}} {{5th level=[[5d6}]]}} {{Properties= Magic, Piercing}} thanks for all the help. you guys have been a huge help
Try this: &{template:default} {{name=Ensnaring Strike}} {{Level ?{Level|1|2|3|4|5}=[[ ?{Level}d6 ]]}} {{Properties= Magic, Piercing}}
sweet that works...thanks
is it possible to have the ro<2 applied to this? ?{Divine Smite|No, |1st level slot, + 2d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|2nd level slot, + 3d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|3rd level slot, + 4d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]|4th level slot, + 5d8 ?{Undead/Fiends|No, |Yes, + 1d8} [Divine Smite]}
1485083038
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, just add that after each roll. The dice engine can do a lot. See the dice reference for all the syntax and go to town. <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a>
i tried adding it after each d8 but it got messed up and wasnt&nbsp;working right
its working now. i think i had just made a mistake somewhere
picked up the dragonslayer and tried updating this to also query the dragon type to do an extra 3d6 damage. so far it either doesnt&nbsp; work. damage either outputs and error or spits out no damage 0 ?{Divine Smite|No, |1st level slot, + 2d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]|2nd level slot, + 3d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]|3rd level slot, + 4d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]|4th level slot, + 5d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]}+ ?{Dragon|No, |Yes,+3d6ro2}
ive&nbsp;tried a few different solutions using some of the stuff youve done for me and what i could find online but i cant seem to get it to work
1485113393
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You've doubled your addition signs Donrick P. said: 0 ?{Divine Smite|No, |1st level slot, + 2d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]|2nd level slot, + 3d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]|3rd level slot, + 4d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]|4th level slot, + 5d8r2 ?{Undead/Fiends|No, |Yes, + 1d8r2} [Divine Smite]} + ?{Dragon|No, |Yes,+3d6ro2} You've doubled up your addition signs.
so it should look like this?? 0 ?{Divine Smite|No, |1st level slot, + 2d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]|2nd level slot, + 3d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]|3rd level slot, + 4d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]|4th level slot, + 5d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]} + ?{Dragon|No, |Yes, 3d6ro&lt;2}
1485125309

Edited 1485125368
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Well, you'll need to put a 0 in the no option or the dragon query, otherwise it'll error out when you select no. EDIT or just a 0 in front of the query as you did with divine smite (make sure to take the space between the comma and the 3d6 out if you do this)
How about this one. that last one seemed to have been flawed 0 ?{Divine Smite|No, |1st level slot, + 2d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]|2nd level slot, + 3d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]|3rd level slot, + 4d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]|4th level slot, + 5d8ro&lt;2 ?{Undead/Fiends&#124;No&#44; &#124;Yes&#44; + 1d8ro&lt;2&#125; [Divine Smite]} + ?{Dragon Types|No, |Yes, 3d6ro&lt;2 [Dragon Types]}
hey guys. its me again :-( is it possible to write up something like this 2+@{fighter_level} but for spells for the life cleric extra healing ability. when they heal some that person gets an extra 2 + spell level of healing
hey guys...trying to macro&nbsp;2 + spell level of healing for healing spells for the life clerics extra healing and not seeming ot have much luck was trying to make changes to&nbsp;{{Level ?{Level|1|2|3|4|5}=[[ ?{Level}d6 ]]}} to see if it could work but so far nothing
i finally figured it out :-D