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

Macroing Weapon Feature, prompt description in chat

Hello Roll20 Wizards, I am trying to workshop a homebrew weapon into one of my player's character sheet. I just recently learned the "?{attack feature?:|Yes,1d8|No,0}" macro which was precisely what I was looking for to add the feature additional damage. Now what I am trying to do is have it so when the player DOES select "yes" to use the feature, the attack will display the description in the chat. or if the player DOESN'T use the feature and selects "No" the action description doesn't display. Alternatively, is there a way for the action description to just always be available via chat toggle similar to the "Spell Description" chat toggle you might find on many spells that roll first? Further more.... (sorry, is it obvious I don't understand macro-ing?) Is it possible to layer the  "?{attack feature?:|Yes,1d8|No,0}" in a similar fashion to divine smite? Meaning if "yes" it would prompt "What level? (but not tied to spell slots)" and he could select level 1-# and that would add more dice based on his choice? Finally (I'm so sorry for being so needy...) Just for style, how do I style the attack description so it looks nicer and not default? Thank you for your time and advice, it is greatly appreciated *bows in humility*
What game and character sheet are you using?
Dungeons & Dragons 5e
1668575573

Edited 1668575705
Gauss
Forum Champion
Martin said: Dungeons & Dragons 5e That is the game, which character sheet (there are seven D&D 5e sheets)? If you do not know or are not sure please post a screenshot so we can identify the specific 5e sheet. 
1668589686
Ziechael
Forum Champion
Sheet Author
API Scripter
Assuming the official 5e sheet by Roll20, you can use the description field of a weapon to essentially override any portion of the standard attack template. Here is one I used for someone with a +1 weapon that gives an additional bonus vs casters: }} {{r1=[[@{d20}cs>@{atkcritrange} + @{atkattr_base} + 0@{atkmod} + [[@{atkprofflag}]][PROF] + [[ 1 + ?{vs Caster|No,0|Yes,1}]][MAGIC]]]}} @{rtype}cs>@{atkcritrange} + @{atkattr_base} + 0@{atkmod} + [[@{atkprofflag}]][PROF] + [[ 1 + ?{vs Caster}]][MAGIC]]]}} {{dmg1=[[@{dmgbase}+[[@{dmgattr}]] +0@{dmgmod}[MOD] + [[ 1 + ?{vs Caster}]][MAGIC]]] Note how the 'description' starts with }}. This causes the template to end that section and then move on to the rest of the code. Any other template fields can be overridden in this fashion but again, note how the 'description' DOESN'T end with }}, this is to allow the original description call to close out the new code for us with its own natural }}. You could also add anything before the initial }} to input something into the usual description field, and this could be a query also for your variable output... making the description NOT show on a 'no' would be tricky though, even &nbsp would result in a blank description box being added to the attack. Regarding divine smite, you can do the exact same thing, injecting overrides for the normal damage rolls with a query for smite. Not the exact same thing but here is how I did it for someone who had Great Weapon Master: }} {{r1=[[1d20cs>@{atkcritrange} + [[@{atkattr_base}]] + @{atkmod} + [[@{atkprofflag}]][PROF]  - ?{Great Weapon Master|No,0|Yes,5}]]}} {{r2=[[1d20cs>@{atkcritrange} + [[@{atkattr_base}]] + @{atkmod} + [[@{atkprofflag}]][PROF] - ?{Great Weapon Master}]]}} {{dmg1=[[@{dmgbase}+[[@{dmgattr}]] +@{dmgmod}[MOD] + (?{Great Weapon Master}*2)]] Note: when nesting queries (ie. Use Smite>What level?) you'll need to follow the usual query nesting rules
I am using D&D 5e with the official Roll20 5e character sheets   Okay new question: can someone break this macro down for me or direct me to where I can find a tutorial on how to write this kind of macro? I’m trying to dissect this macro so that I can relabel it and have it add different values of dice. The problem is I don’t know understand what any of it means. I did not write this macro. I found it from a couple sources and am wanting to modify it. The macro -  Divine Smite: &{template:dmg} {{rname=Divine Smite}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[[[(?{Spellslot|1st lvl,2|2nd lvl,3|3rd lvl,4|4th lvl,5} + ?{Undead/Fiend|No,0|Yes,1})*?{Crit|No,1|Yes,2}]]d8]]}} {{dmg1type=Radiant}} &{template:dmg} {{rname=Divine Smite}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[[[(?{Spellslot|1st lvl,2|2nd lvl,3|3rd lvl,4|4th lvl,5} + ?{Undead/Fiend|No,0|Yes,1})*?{Crit|No,1|Yes,2}]]d8]]}} {{dmg1type=Radiant}} It asks you what spell slot (1st - 4th) (2-5) you are using, then whether the target is undead or fiend (+1), and then asks you if its a crit (*2). And then it rolls the corresponding number of dice (2-12). The effect I am trying to do is something similar. When the player hits with his weapon, he can choose to add a certain about of d8s. He can do this a number of times equal to his proficiency + 10. He can add one d8 or choose to use the ability multiple times at once added several d8 (each time paying 5 life and possibly incurring exhuastion). I want to macro to prompt how many times he wishes to use the feature and then add the appropriate amount of d8 + cha mod (with option to crit). 
1668615845

Edited 1668619258
Hiya, the layout of the different templates can be found here <a href="https://wiki.roll20.net/D%26D_5e_by_Roll20_Roll_Templates" rel="nofollow">https://wiki.roll20.net/D%26D_5e_by_Roll20_Roll_Templates</a> and this should help you break down what each part does, personally I would add any macro in to the description section of the weapon on page 1 of the character sheet (under Attacks &amp; Spellcasting). That way, player rolls and we get the normal roll template but it immediately asks for the info about those dice choices and you can add flavour text too - as an example I added this to a dagger attack description: Additional damage [[?{How many dice}d8+@{selected|pb}]] here is the result and a hover over text to show the dice rolled
That’s what I had it set as previously, as part of the weapon attack. However I want to allow the additional damage to be applied after the attack roll is determined vs before. So to have this macro-ed in as the weapon attack would incorrectly represent the intent. Having in as a quick access macro in the bar by the players’ tag would allow them to see their weapon attack then click the featured macro if they wanted the extra damage rolled.&nbsp; Similar to having the aforementioned divine smite macro in the similar location for the same reason&nbsp;
Also thank you so much to all of you that commented options of resolution. You all are wizards and I appreciate your input.&nbsp;
1668619500

Edited 1668620138
Fairly straightforward to do then - add to character sheet as an ability, choose a template and drop the macro above (soz - was editing and didn't see your last 2 posts!) in to the appropriate section decked out with as much flavour text as you like