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

Noob adapting a found macro

I am trying to adapt a macro that was originally written to make a clickable "sneak attack" button below attack rolls.  I am adapting it for a "Hail of Thorns" button for attack rolls for a ranger.  it will roll 1d10 per level of the character with a limit of 6d10.  The original looked like this: sneak attack: &{template:simple}{{rname=Sneak Attack}}{{normal=1}}{{mod=[[ceil(@{base_level}/2)]]d6}}{{r1=[[[[ceil(@{base_level}/2)]]d6]]}}{{charname=@{character_name}}} but instead of the sneak attack parameters outlined there, I want to use this bit to roll my damage for Hail of Thorns ranger spell 1d10 per level up to 6: ([[{@{level},6}kl1]])d10 Everything I've tried breaks the macro.   Can anybody point me in the right direction?
1527388875

Edited 1527389202
Ziechael
Forum Champion
Sheet Author
API Scripter
If you replace @{level} with @{base_level} does that solve the issue? I assume you are using the 5e OGL sheet? Also do you multiclass or are you a pure ranger? Also, moving your [[]] around a bit helps, this works for me: &{template:simple}{{rname=Sneak Attack}}{{normal=1}}{{mod=[[{@{base_level},6}kl1]]d10}}{{r1=[[[[{@{base_level},6}kl1]]d10]]}}{{charname=@{character_name}}}
1527389583

Edited 1527390307
That works thanks!  Yes the 5e OGL sheet.  Single class Ranger.  My final code for a macro called "Thorns" is this:  &{template:simple}{{rname=Hail of Thorns}}{{normal=1}}{{mod=[[[[ceil({@{base_level},6}kl1)]]d10]]}}{{r1=[[[[ceil({@{base_level},6}kl1)]]d10]]}}{{charname=@{character_name}}} then in in the attack details of my longbow or whatever weapon you want, you put this in the description section: [Hail of Thorns](~Benevolence|Thorns)  Benevolence is my character name, the left "Hail of Thorns" with spaces is the button text you'll see below your attack roll, and the "Thorns" at the end is the no-spaces-allowed macro name.  For anyone else wanting to implement this! Thanks Ziechael
1527389735
Ziechael
Forum Champion
Sheet Author
API Scripter
Happy to help... though i did forget to replace 'sneak attack' with 'Hail of Thorns' lol... you can safely take out the ceil() part as your base level will never be a fraction... but it won't break it to leave it in either :) Happy rolling!
1527390502

Edited 1527390707
Actually one thing is wrong, I think its the section with mod=  it doesn't need to be in there, it's outputting another damage roll in that space.  so can we just take that section out? EDIT:  OK that works here is the final version I am using: &{template:simple}{{rname=Hail of Thorns}}{{normal=1}}{{r1=[[[[ceil({@{base_level},6}kl1)]]d10]]}}{{charname=@{character_name}}}
1527390728

Edited 1527390880
Ziechael
Forum Champion
Sheet Author
API Scripter
Take the enclosing [[]] off the whole thing, it should just give an output that tells you how many d10s were rolled, taking the section out would also work... especially if you are already level 6+ and therefore know how many d10s by default have been rolled (handy for your DM though): &{template:simple}{{rname=Hail of Thorns}}{{normal=1}}{{mod= [[{@{base_level},6}kl1]]d10 }}{{r1=[[[[{@{base_level},6}kl1]]d10]]}}{{charname=@{character_name}}}