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 .
×
May your rolls be chill this holiday season!
Create a free account

[PF] Change weapon enchantment on the fly

1479256648

Edited 1479266097
Hey guys, relatively new to making anything complex with macros and I couldn't find an existing solution, so I figured I'd ask here. I'm currently playing a magus and I was wondering if there is a way I can have 1 macro that lets me choose the current enchantment I've given my weapon through use of my arcane pool. I was hoping that I could have various prompts for everything (using spell combat?, arcane accuracy?, flanking?, etc.) and also have a drop down for the enchantment that would modify the attack or damage roll as necessary. For example, the keen selection would double the crit range for the attack, or the flaming selection would add 1d6 of fire damage to the damage roll. It would be great if I could get spellstrike in there as well (perhaps another drop down of all of my touch attack spells or something?) but I figured I should go one step at a time. I've already got the macro working with the various prompts, and I also have set it to let me select an enchantment from a drop down. What I'm having trouble with is figuring out how I can use the selection from the drop down in different ways (some modify the attack roll while others modify the damage roll). I'm guessing I'll need to do something with embedding macros and some of the advanced usage for roll queries, I'm just not sure what that would be. This is all I've got so far (sorry for messy formatting): /roll 1d20 + [[@{Thoril Talanar|melee-ability-mod} + @{Thoril Talanar|STR-mod} ?{Spell Combat | + 0 | - 2} ?{Enhancement Bonus | + 0 | + 1} ?{Arcane Accuracy | + 0 | + @{Thoril Talanar|INT-mod}} ?{Flanking | + 0 | + 2} ?{Enchantment | Flaming | Keen}]] At worst I could just make a different macro for each enchantment, but then I think I'd have to copy and paste a lot of the macro text. That would require me to need to make changes to multiple macros if I wanted to add/edit/remove something from it. I'd like to keep it all in one place if I could. Thanks for the help! P.S. It would also be neat if I could do something for flanking like a yes/no option, and then it added +2 if yes and added nothing if no, but that's not super relevant to the main question I have.  Nevermind, I figured that out.
1479309598
Tetsuo
Forum Champion
try: /roll ?{Enchantment |Flaming, 1d20cs>18 | Keen. 1d20cs>15} + [[@{Thoril Talanar|melee-ability-mod} + @{Thoril Talanar|STR-mod} ?{Spell Combat | + 0 | - 2} ?{Enhancement Bonus | + 0 | + 1} ?{Arcane Accuracy | + 0 | + @{Thoril Talanar|INT-mod}} ?{Flanking |no, + 0 |yes, + 2} ?{Enchantment | Flaming | Keen}]] this assumes you crit on an 18 without keen and on a 15 with. If that isnt the case, change the: ?{Enchantment |Flaming, 1d20cs>18 | Keen. 1d20cs>15} to reflect what your crit values are.
Hey Franky, thanks for the help. This works great for the attack roll, but is it also possible to have that initial decision affect the damage roll as well? I was thinking about rolling the damage at the same time under the assumption that the attack hit. Correct me if I'm wrong, but I can't seem to find a way to use that decision later on in the macro (in this case for the damage roll). Also a slight typo in the above macro, you have a '.' instead of ',' after Keen in that first drop down.
1479326304

Edited 1479326951
I think I've figured out a potential solution. It's still a WIP and will require a couple macros, but it should still be easy to maintain. The plan is to have 1 macro for all of the general attack roll bonuses/penalties (spell combat, flanking, etc.), 1 macro for damage roll (1d6 + STR-mod), 1 macro for each enchant (Flaming, Keen, etc), and then lastly 1 master macro that starts the prompts. The flow would look like the following: Master Macro: ?{Enchantment | Flaming, #Flaming | Keen, #Keen | ...}  Flaming: FLAMING ATTACK!                 /roll 1d20cs>18 + #Attack-Roll                 /roll #Damage-Roll + 1d6 [fire]  Keen: KEEN ATTACK!            /roll 1d20cs>15 + #Attack-Roll            /roll #Damage-Roll  ... Attack-Roll: [[@{Thoril Talanar|melee-ability-mod} + @{Thoril Talanar|STR-mod} ?{Spell Combat | + 0 | - 2} ?{Enhancement Bonus | + 0 | + 1} ?{Arcane Accuracy | + 0 | + @{Thoril Talanar|INT-mod}} ?{Flanking |no, + 0 |yes, + 2}]] Damage-Roll: 1d6 + [[@{Thoril Talanar|STR-mod}]] I replaced the |  ,  }  characters in the Attack-Roll macro as recommended in the Advanced Usage of Roll Queries section. Now I'm running into two problems with the current set up: 1. Only the first drop down option will work. If I select the "Keen" option all that happens is that i say "#Keen" in chat. 2. I have to include some sort of text on the first line of the enchantment macros (Flaming and Keen), as it seems like it only ever tries to print out the first line of the macro when executed this way. If there are better solutions (letting me keep it in one macro, etc.) please let me know!
How about this instead? /r  1d20cs>[[ 18 - ?{Enchantment |Flaming, 0 | Keen, 3 } ]] + [[ @{Thoril Talanar|melee-ability-mod} + @{Thoril Talanar|STR-mod} ?{Spell Combat | + 0 | - 2} ?{Enhancement Bonus | + 0 | + 1} ?{Arcane Accuracy | + 0 | + @{Thoril Talanar|INT-mod}} ?{Flanking |no, + 0 |yes, + 2} ]] /r 1d6 + [[ @{Thoril Talanar|STR-mod} ]] + [[ 1 - ?{Enchantment } / 3 ]]d6 [fire]
1479329852

Edited 1479330065
Thanks for the reply Silvyre! While it seems to be working, is there anything we can do to the damage roll? Ideally, I would love it if the enchantment decision was able to be reused in the damage roll as well, but I don't know if that's possible. At the moment it's displaying a text prompt and I have to enter 0 (for flaming) or 3 (for keen) to get the proper number of dice rolled. As a follow up, would this work when more enchantments were added that deal different types of damage (like Frost) or different damage values (like Flaming Burst)?
1479333272

Edited 1479333377
Endorphins said: Ideally, I would love it if the enchantment decision was able to be reused in the damage roll as well, but I don't know if that's possible. I forgot that Roll Queries named with trailing spaces behave strangely. Try this: /r 1d20cs>[[ 18 - ?{Enchantment|Flaming, 0|Keen, 3} ]] + [[ @{Thoril Talanar|melee-ability-mod} + @{Thoril Talanar|STR-mod} ?{Spell Combat|+ 0|- 2} ?{Enhancement Bonus|+ 0|+ 1} ?{Arcane Accuracy|+ 0|+ @{Thoril Talanar|INT-mod}} ?{Flanking|no, + 0|yes, + 2} ]] /r 1d6 + [[ @{Thoril Talanar|STR-mod} ]] + [[ 1 - ?{Enchantment} / 3 ]]d6 [fire] As a follow up, would this work when more enchantments were added that deal different types of damage (like Frost) or different damage values (like Flaming Burst)? It could be made to work.
1479335150

Edited 1479340724
Oh I did not know you could reuse a decision like that, this works really well now. I think with this working I should be able to adapt it as necessary (adding different enchantments, wrapping it in a template, etc.) . Edit: I was wrong, I'm not sure of a good way to add other drop down options. For example, what could I do for no enchantment? I'd want to leave the crit range unaffected, but also make the damage roll not use the extra d6. Something funky with modular arithmetic could get the desired results, but that would get messier and messier the more enchantments you add. If you have a better suggestion I'm all ears. Working example below: /r  1d20cs>[[ 18 - ?{Enchantment|None, 8 | Flaming, 0 | Keen, 15 }%4 ]] + [[ @{Thoril Talanar|melee-ability-mod} + @{Thoril Talanar|STR-mod} ?{Spell Combat | + 0 | - 2} ?{Enhancement Bonus | + 0 | + 1} ?{Arcane Accuracy | + 0 | + @{Thoril Talanar|INT-mod}} ?{Flanking |no, + 0 |yes, + 2} ]] /r 1d6 + [[ @{Thoril Talanar|STR-mod} ]] + [[ 1 - ?{Enchantment}%7 ]]d6 [fire] Thanks for the help!
Here's one way to expand: /r 1d20cs>[[ 18 - 3 * {?{Enchantment|None, 0|Flaming, 1|Keen, 2|Frost, 3} + d0}=2 ]] + [[ @{Thoril Talanar|melee-ability-mod} + @{Thoril Talanar|STR-mod} ?{Spell Combat|+ 0|- 2} ?{Enhancement Bonus|+ 0|+ 1} ?{Arcane Accuracy|+ 0|+ @{Thoril Talanar|INT-mod}} ?{Flanking|no, + 0|yes, + 2} ]] /r 1d6 + [[ @{Thoril Talanar|STR-mod} ]] + [[ {?{Enchantment} + d0}=1 ]]d6 [fire] + [[ {?{Enchantment} + d0}=3 ]]d6 [cold] [[ {?{Enchantment} + d0}=1 ]] resolves to equal 1 if and only if ?{Enchantment} = 1. Otherwise, it resolves to equal 0.
Oh very cool, I did not know this functionality existed either. Is there a page where this is outlined? I don't remember seeing anything like this on the  macro wiki .
It follows from Target Number / Successes . Another form of it can be seen in Conditional Statements (Math Only) .
1479390460
Tetsuo
Forum Champion
Silvyre said: [[ {?{Enchantment} + d0}=1 ]] resolves to equal 1 if and only if ?{Enchantment} = 1. Otherwise, it resolves to equal 0. Man am I glad I follow forums. I was unaware of this as well. I knew you could use < and >. Never thought to try =
Agreed Franky, this has been super helpful. I've gotten the macro working in the Pathfinder template that my character sheet uses (thankfully the sheet lets you see the macro text) and I think I'm just about done with it. I'm at work for a while, but I'll post the end results when I get home.
Franky H. said: Silvyre said: [[ {?{Enchantment} + d0}=1 ]] resolves to equal 1 if and only if ?{Enchantment} = 1. Otherwise, it resolves to equal 0. Man am I glad I follow forums. I was unaware of this as well. I knew you could use < and >. Never thought to try = It's a lesser-known piece of syntax documented in Roll Modifiers . As shown in that Wiki section, = is actually redundant: [[ {?{Enchantment} + d0}1 ]] works just as well. I prefer including the = just as I prefer including the [redundant] 'h' in kh1. Endorphins said: I've gotten the macro working in the Pathfinder template that my character sheet uses (thankfully the sheet lets you see the macro text) and I think I'm just about done with it. I'm at work for a while, but I'll post the end results when I get home. Sounds good!
Here's the macro working in the template. I placed the macro directly in the macro text for the weapon in the character sheet so the macro will still work if I rearrange my weapons: @{PC-whisper} &{template:pf_attack} ?{Enchantment|None,0|Keen,1|Flaming,2|Flaming Burst,3|Frost,4|Icy Burst,5|Shock,6|Shocking Burst,7} ?{Spell Combat|+0|-2} ?{Enhancement Bonus|+0|+1} ?{Arcane Accuracy|+0|+@{Thoril Talanar|INT-mod}} ?{Flanking|No,+0|Yes,+2} @{toggle_attack_accessible} @{toggle_rounded_flag} {{color=@{rolltemplate_color}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs>[[ @{crit-target} - 3 * {?{Enchantment} + d0}=1 ]] + @{attack_macro} + [[ ?{Spell Combat} ?{Enhancement Bonus} ?{Arcane Accuracy} ?{Flanking} ]] ]]}} {{damage=[[@{damage-dice-num}d@{damage-die} + @{damage_macro}]] + [[ [[ {?{Enchantment} + d0}=2 ]]d6 + [[ {?{Enchantment} + d0}=3 ]]d6 [Fire] ]] + [[ [[ {?{Enchantment} + d0}=4 ]]d6 + [[ {?{Enchantment} + d0}=5 ]]d6 [Cold] ]] + [[ [[ {?{Enchantment} + d0}=6 ]]d6 + [[ {?{Enchantment} + d0}=7 ]]d6 [Electricity] ]] }} {{crit_confirm=[[ 1d20 + [[ @{attack_macro} ]] + [[ ?{Spell Combat} ?{Enhancement Bonus} ?{Arcane Accuracy} ?{Flanking} ]] ]]}} {{crit_damage=[[ [[ @{damage-dice-num} * (@{crit-multiplier} - 1) ]]d@{damage-die} + ((@{damage_macro}) * [[ @{crit-multiplier} - 1 ]]) ]] + [[ [[ {?{Enchantment} + d0}=3 ]]d10 [Fire] ]] + [[ [[ {?{Enchantment} + d0}=5 ]]d10 [Cold] ]] + [[ [[ {?{Enchantment} + d0}=7 ]]d10 [Electricity] ]] }} {{type=@{type}}} {{weapon_notes=@{notes}}} @{iterative_attacks} @{macro_options} {{vs=@{vs}}} {{vs@{vs}=@{vs}}} {{precision_dmg1=@{precision_dmg_macro}}} {{precision_dmg1_type=@{precision_dmg_type}}} {{precision_dmg2=@{global_precision_dmg_macro}}} {{precision_dmg2_type=@{global_precision_dmg_type}}} {{critical_dmg1=@{critical_dmg_macro}}} {{critical_dmg1_type=@{critical_dmg_type}}} {{critical_dmg2=@{global_critical_dmg_macro}}} {{critical_dmg2_type=@{global_critical_dmg_type}}} And here's an image of it in action: The 4 values for damage and crit damage are for the scimitar, any fire damage (from Flaming or Flaming Burst), any cold damage (from Frost or Icy Burst), and any electricity damage (from Shocking or Shocking Burst). I think this already works/looks great, but I have 2 ideas that I think would make it look even better but I don't think it's something that the macro can do: - Can I get the empty dice rolls to not show up? For example, in the image above it would be nice to not show the fact the there are 0d0 being rolled for cold and electricity damage, since we are using Flaming Burst. - Is there any way to color code the fire, cold, and electricity damage rolls so it's easy to see what the damage type is? My assumption is that these are things that can only be done through the template. If that's the case, then I'll still be very happy with how it turned out.
1479440442
Tetsuo
Forum Champion
you could wrap your entire damage roll in a set of brackets. [[ ]]. It wouldn't display them like that, but you could hover to see the break down of damage types.
Franky H. said: you could wrap your entire damage roll in a set of brackets. [[ ]]. It wouldn't display them like that, but you could hover to see the break down of damage types. That does work, but I think I like having separate boxes for the enchantment damage even if they show with 0 when they aren't being used. Although I might try putting all of the additional damage rolls (for the different enchantments) into one set of brackets. That would make it so that if I wasn't using a damage enchant there would only be 1 extra "0 damage" roll rather than 3, and when I did use them there wouldn't be any extra. That might be a good compromise.
Very helpful, I'm new to roll20 and was wondering about this as well!