Advertisement Create a free account

Ideas for Exploding Multiple Dice, "Fail/Success" instead of "0/1" and Calculating Queries Before %attributes

1557613074
Seph
Pro
Looking for suggestions on any API scripts/ideas that would allow the following functions to work: Exploding dice, where the original dice roll explodes on a success, instead of just the one successful die. Possibly format as something like " 2d20k1!>19>19 ". Example: I roll 2d20, resulting in (8 + 19), the 19 is kept as the better result and also triggers the explosion. This causes another roll of 2d20, (20 + 19), keeping the 20 and triggering another explosion. The 2d20 rolled as (13 + 17), keeping the 17 but not triggering a 3rd explosion. The 19 and 20 are counted as 2 successes. Sort of related to the previous function, I'd like to have the option to have a roll like " 1d100<35 " offer results as "Success" or "Fail" instead of "1" or "0", similar to how the Pathfinder spell templates have for arcane spell failure chance. Could an API script alter the order in which items are calculated? It'd be really convenient to be able to place queries within %attributes for things that use a repeating_custom_$id. Example: A token ability which uses a drop-menu so all the character's attacks are accessible via a single button. %{<Character Name>|repeating_attacks_?{Attack|<attackname>,<$id>|<attackname>,<$id>|<attackname>,<$id>}_fullattack} I appreciate any input anyone can offer! I'm not familiar enough with JS to write my own scripts yet, so I'd be grateful for help in that regard as well.
1557669877
GiGs
Pro
Sheet Author
The questions are a bit too open-ended to answer without more information. Each of the above things can be done, the question is which approach to take. We need different approaches depending on whether you use more than one of them in the same macro, and what kind of output you desire. Can you give examples of complete macros (with attribute names) you'd like to use each of these in? And describe the kind of output you want to see.
1557670264
GiGs
Pro
Sheet Author
I will add a clarifying note on the 3rd question: it's not possible to change the order things are done within standard macros. But in an API script, you can do things in any order you want, but the way you do it has to be tailored for each purpose. For instance, if you want a script that creates a dropdown that lets players choose their attacks from that list and is properly labelled, a script can make that happen. If you have another task where you want to do things in a different order, that can also be written - but it'll be a different script. There's no way to universally change the order of things being done. So you need to be very specific about what purposes you actually want. Don't worry about how  to do it, that's the scripter's job.
1557726269

Edited 1557726324
Seph
Pro
GiGs said: I will add a clarifying note on the 3rd question: it's not possible to change the order things are done within standard macros. But in an API script, you can do things in any order you want, but the way you do it has to be tailored for each purpose. Thanks for the clarification! Regarding the first item, the main purpose is to simplify multiple abilities that affect attack rolls interacting with each other. Two major bosses in my Pathfinder campaign have these abilities, so having everything resolved in a macro would be awesome. They are as follows: “…whenever you make an attack roll … and miss, you may immediately roll again. You must take the second roll, even if it’s lower.” For this I changed the attack roll to 1d20ro<{@{target|ac} - <roll modifiers>,1}kh1cs>19 + <roll modifiers>. “If your successful critical confirmation roll is a natural 19 or 20, you can spend 2 stamina points to roll another confirmation roll. If this confirmation roll also succeeds, increase your critical multiplier by 1 for this attack, and you can roll again. If you continue to roll 19 or 20, you can continue to spend stamina points for additional rolls, and the increases to the critical multiplier stack.” This is where the exploding dice come in. I want to be able to know how many times the crit confirmation roll results in a nat 19 or 20, so I imagine the attack roll might be something like 1d20ro<{@{target|ac} +1 - <roll modifiers>,1}kh1!>19>19 + <roll modifiers>. If possible, a way for the number of successes to increase the critical multiplier damage would be handy. “When making a Sudden Attack, you roll twice and take the better result, adding your tier to the attack roll.” This is what changes the 1d20 to 2d20k1. Now I'd just like a way to combine all three, since they affect the same attack. This is a simplified version of the macro I currently have for this attack: @{selected|whispertype} &{template:pc} {{name=Sudden Attack}} {{type=attackdamage}} {{showchar=@{selected|rollshowchar}}} {{charname=@{selected|character_name}}} {{nonlethal=1[Nonlethal]}} {{attack=1}}{{roll=2d20k1ro<{@{target|ac} - (@{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers (there's a lot)>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]),1}kh1cs>19cf0 + @{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]}} {{critconfirm=2d20k1ro<{@{target|ac} - (4[CF] + @{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers (there's a lot)>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]),1}kh1cs>19cf0 + 4[CF] + @{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]}}{{atkvs=(Melee vs AC)}}{{descflag=1}}{{desc=must spend 1 mythic power}}{{shownotes=1}}{{notes=}}{{damage=1}} {{dmg1flag=1}} {{dmg1=2d10+@{selected|strength_mod}[STR] + <dmg modifiers>[MOD] + @{selected|damage_bonus}[TEMP] + @{selected|rollmod_damage}[QUERY] }}{{dmg1type=?{Damage type|piercing,p|bludgeoning,b}}}{{dmg1crit=((20 * 3) + (@{selected|strength_mod}[STR] + <dmg modifiers>[MOD] + @{selected|damage_bonus}[TEMP] + @{selected|rollmod_damage}[QUERY]) * 3)}} {{conditionsflag=@{selected|attack_condition}}} {{conditions=@{selected|conditions_display}}} {{conditionsnote=@{selected|attack_condition_note}@{selected|damage_condition_note}}}
1557727062

Edited 1557728220
Seph
Pro
The second item is for things like Concealment or the Fortification armor trait. Example, I put "25% chance to negate dmg from crit/sneak atk ([[1d100<25]])" in the AC notes of a character sheet. If I send the AC notes to chat and a 14 is rolled, it says "25% chance to negate dmg from crit/sneak atk ( 1 )". Is there a way to have this result in "25% chance to negate dmg from crit/sneak atk ( Success )" instead? Similar to how spells incorporate this for arcane spell failure chance, as seen here: An example of the AC macro where the above function is pulled from ac_notes: @{selected|whispertype} &{template:pc} {{smallname=^{armor-class}}} {{type=feat}} {{showchar=@{selected|rollshowchar}}} {{charname=@{selected|character_name}}} {{descflag=1}} {{desc=**^{ac-u}** [[@{selected|ac}]] **^{touch}** [[@{selected|ac_touch}]] **^{flat-footed}** [[@{selected|ac_flatfooted}]]}} {{shownotes=@{selected|rollnotes_ability}}} {{notes=@{selected|ac_notes}}} {{conditionsnote=@{selected|ac_condition_note}}}
1557727648

Edited 1557728190
Seph
Pro
As for the third item, I'm just wanting a more condensed and quicker way of making a drop down menu for PCs attacks, where the base macro is either %{<Character Name>|<and the script has a way of allowing me to plug in multiple repeating line $ids>} or %{selected|<script calls the $ids from the character sheet's Attacks section>}. Since I can't do ?{Attack|Greataxe,%{Silv Malur|repeating_attacks_-LdvxlXwzjy06M6WTiyt_fullattack}|Dagger,%{Silv Malur|repeating_attacks_-LdvyGrl9JP5uBObPSvM_fullattack}|Claws,%{Silv Malur|repeating_attacks_-Le0MlxJkbrpSYWhBtRY_fullattack}} or %{Silv Malur|?{Attack|Greataxe,repeating_attacks_-LdvxlXwzjy06M6WTiyt_fullattack|Dagger,repeating_attacks_-LdvyGrl9JP5uBObPSvM_fullattack|Claws,repeating_attacks_-Le0MlxJkbrpSYWhBtRY_fullattack}
1557728388
Seph
Pro
I hope that's less open-ended than before? Let me know if you need more specific details!
1557835736
For the third item you could have one macro per weapon and a chatmenu to select the correct macro. If you wanna stick with dropdowns, you might be able to abuse the rollable table macros script - but then you could also write your own script.
1557843831
Seph
Pro
Danii said: For the third item you could have one macro per weapon and a chatmenu to select the correct macro. If you wanna stick with dropdowns, you might be able to abuse the rollable table macros script - but then you could also write your own script. The chat menu seems like it would be a way of doing it, thank you for the idea! By the rollable table macros script, do you mean Recursive Tables?
1557975425
GiGs
Pro
Sheet Author
Sorry for not getting back to you earlier on this. Looking at your clarifications, i'm not sure if I can help  all that much unfortunately. I'll reply to each in a separate post, to make it easier for quoting purposes when discussing them further.
1557975969
GiGs
Pro
Sheet Author
Sudden Attack I'm not sure why you want a macro to handle all possible rerolls here. The player has to choose whether to make rerolls, and spend stamina. If you do all the rerolls up front, the player is committed to spending more stamina than they might want to (or even have). Wouldn't it be better to instead, output the attack result, with an indication a reroll is possible. Then let them choose to make that reroll? If so, you could leave it as it is and just manually have the player reroll when they have the ability to. (Maybe a version of the attack macro that doesnt have the >19 part of the roll.) I could make a script that - only when the reroll is relevant - adds a chat button with the output, to launch those rerolls. This is fine if its just needed for this one macro. It gets tricky if you want to use it for multiple different macros. A universal technique would mean basically recreating the entire roll template in javascript (a lot of work), and that's too much effort for one tiny thing.
1557976546
GiGs
Pro
Sheet Author
Concealment or Fortification I dont think i can help with this one. That's something the sheet designed would need to incorporate. You can send them a request for that. It is possible for a script to scan all chat messages, and if it finds a match, print an output, so if you wrote the text in a specific way, a script could output that it succeeded or failed - but this wouldnt be part of the roll output, it would come after (or sometimes before, inconveniently) to roll output. It would be possible to build a script that handled the entire roll, replacing the rolltemplate, and report it properly - but that would take too much work for the result.
1557976882
GiGs
Pro
Sheet Author
Repeating Section While this one that looks the most complicated, it's probably the one that is doable. Danii mentioned Chat Buttons, and they are definitely a better way than dropdown menus. What we could do is have a script that players can run, which builds a list of all the attacks in repeating section, and whispers a properly labelled menu of buttons to the player. They can then click the button for the attack of their choice. This would be a universal script: you could use it for any character and it would print that character's attacks. How does that sound?
1557982232
Seph
Pro
GiGs said: Sudden Attack I'm not sure why you want a macro to handle all possible rerolls here. The player has to choose whether to make rerolls, and spend stamina. If you do all the rerolls up front, the player is committed to spending more stamina than they might want to (or even have). Wouldn't it be better to instead, output the attack result, with an indication a reroll is possible. Then let them choose to make that reroll? No worries about the late response! My reason for wanting it all done at once is because this is an ability shared by two boss NPCs, and I would assume said NPCs to use those rerolls whenever possible. Having the indication that the parameters for being allowed to reroll were met and then having a chat button for rerolling the confirmation roll would be just as handy though.
1557982317
Seph
Pro
GiGs said: Concealment or Fortification I dont think i can help with this one. That's something the sheet designed would need to incorporate. You can send them a request for that. It is possible for a script to scan all chat messages, and if it finds a match, print an output, so if you wrote the text in a specific way, a script could output that it succeeded or failed - but this wouldnt be part of the roll output, it would come after (or sometimes before, inconveniently) to roll output. It would be possible to build a script that handled the entire roll, replacing the rolltemplate, and report it properly - but that would take too much work for the result. That's fine, it is a small convenience and the work involved would really outweigh the benefit.
1557982509

Edited 1557982610
Seph
Pro
GiGs said: Repeating Section While this one that looks the most complicated, it's probably the one that is doable. Danii mentioned Chat Buttons, and they are definitely a better way than dropdown menus. What we could do is have a script that players can run, which builds a list of all the attacks in repeating section, and whispers a properly labelled menu of buttons to the player. They can then click the button for the attack of their choice. This would be a universal script: you could use it for any character and it would print that character's attacks. How does that sound? LOVE the sound of this! This would be the most widely used, and it would be mostly for my players anyway, as most of my NPCs only have a handful of attacks, while some of my players have a repeating section for all their attack routines, like two-weapon fighting, cleaving, power attack, etc. in addition to multiple weapons. Would it be possible to do this for spell lists as well? The sheet we use is the Pathfinder sheet by Roll20.
1558013326
Wes
Pro
Sheet Author
Concealment or Fortification roll could easily be covered by a rollable table. 
1558019432
GiGs
Pro
Sheet Author
Wes said: Concealment or Fortification roll could easily be covered by a rollable table.  That's a great idea. I was laser-focussed on thinking of script solutions, that never occurred to me. You do need a separate table for each chance.
1558019575

Edited 1558019622
GiGs
Pro
Sheet Author
Seph said: GiGs said: Repeating Section While this one that looks the most complicated, it's probably the one that is doable. Danii mentioned Chat Buttons, and they are definitely a better way than dropdown menus. What we could do is have a script that players can run, which builds a list of all the attacks in repeating section, and whispers a properly labelled menu of buttons to the player. They can then click the button for the attack of their choice. This would be a universal script: you could use it for any character and it would print that character's attacks. How does that sound? LOVE the sound of this! This would be the most widely used, and it would be mostly for my players anyway, as most of my NPCs only have a handful of attacks, while some of my players have a repeating section for all their attack routines, like two-weapon fighting, cleaving, power attack, etc. in addition to multiple weapons. Would it be possible to do this for spell lists as well? The sheet we use is the Pathfinder sheet by Roll20. I'm not familiar with any D&D/Pathfinder sheets, but in principle it should work the same. I'll see what i can do when I have time (been a busy week). It did occur to me as I was writing the suggestion that it could be a useful universal script that could work for any game,
1558019734
GiGs
Pro
Sheet Author
Seph said: GiGs said: Sudden Attack I'm not sure why you want a macro to handle all possible rerolls here. The player has to choose whether to make rerolls, and spend stamina. If you do all the rerolls up front, the player is committed to spending more stamina than they might want to (or even have). Wouldn't it be better to instead, output the attack result, with an indication a reroll is possible. Then let them choose to make that reroll? No worries about the late response! My reason for wanting it all done at once is because this is an ability shared by two boss NPCs, and I would assume said NPCs to use those rerolls whenever possible. Having the indication that the parameters for being allowed to reroll were met and then having a chat button for rerolling the confirmation roll would be just as handy though. Is it being used for the same attack by both, or for multiple different actions?
1558025170
Seph
Pro
GiGs said: Is it being used for the same attack by both, or for multiple different actions? The ability in question can be activated on any attack made by the bosses, if the appropriate circumstances are met. The initial attack roll must first score a critical threat, then the confirmation roll must land on a natural 19 or 20 (and the total must be higher than the target's AC). Each time that happens, points can be spent to roll the confirmation roll again, and if that reroll lands on 19 or 20, the process repeats. Where it gets complicated, though, is that each time the points are spent and the total result of the confirmation roll beats the target's AC (besides the first conf'n roll), the critical multiplier on damage increases by 1. So the final results of the attack would need to happen only after the process of spending points to reroll conf'n, if it is triggered in the first place. I feel like that may be really tricky even with a script, though, so if it comes down to it I can just manually roll the d20 and extra damage dice for any increase to the multiplier.
1558132030
GiGs
Pro
Sheet Author
GiGs said: Seph said: GiGs said: Repeating Section <snip> LOVE the sound of this! This would be the most widely used, and it would be mostly for my players anyway, as most of my NPCs only have a handful of attacks, while some of my players have a repeating section for all their attack routines, like two-weapon fighting, cleaving, power attack, etc. in addition to multiple weapons. Would it be possible to do this for spell lists as well? The sheet we use is the Pathfinder sheet by Roll20. I'm not familiar with any D&D/Pathfinder sheets, but in principle it should work the same. I'll see what i can do when I have time (been a busy week). It did occur to me as I was writing the suggestion that it could be a useful universal script that could work for any game, I have discovered a snag for this, that roll20 doesnt give API access to some of the sheet details I'd need to make this universal. i think I can make it for some sheets, but not others (it depends how the sheet writer made their sheet). Which character sheet do you use? I'll check if its possible.
1558149326

Edited 1558203983
GiGs
Pro
Sheet Author
Edit: script fixed, tweaked, and posted further down,
1558151606
Seph
Pro
GiGs said: I noticed you were using the pathfinder sheet which is lucky - we can use a script to get the repeating menus for that one. Thanks for putting this together! It doesn't seem to output the chat menu buttons when I use it, though. Could another script be interfering?
1558151715

Edited 1558152033
GiGs
Pro
Sheet Author
Do you have any attacks or spells set up on the character sheet you are testing it on? I ask this because when I was testing, I thought it wasnt working for a while, but I'd selected the token for a blank character, who had no spells or attacks, so it was just printing the title bar.
1558152216
Seph
Pro
GiGs said: Do you have any attacks or spells set up on the character sheet you are testing it on? I ask this because when I was testing, I thought it wasnt working for a while, but I'd selected the token for a blank character, who had no spells or attacks, so it was just printing the title bar. I'm testing on a token linked to a completed player character. I entered the version with the query, with the token selected. The query pops up and I submit it, but nothing shows up in the chat, not even the title bar.
1558152433
GiGs
Pro
Sheet Author
Are you using the Pathfinder by Roll20 sheet? I assumed thats the one you're using from the screenshots above, but there are several PF sheets and they might look alike for all I know.
1558152577
Seph
Pro
I am. I have a blank campaign set up with no other scripts enabled besides this one, I can invite you to it or to the campaign my players are in so you can test it out.
1558152620

Edited 1558152822
GiGs
Pro
Sheet Author
sure, send me an invite to PM, the blank campaign is best. Also, you can import a couple of characters via the transmogrifier.
1558154527
GiGs
Pro
Sheet Author
We figured out the problem (two problems) The first: the script wont whisper the chat menus properly if the character is set as controlled by All Players (and I'm not sure how it will work if multiple controllers). The second: I didnt properly account for the way spells were set up on the sheet.  I'll fix both of these issues tomorrow.
1558203878

Edited 1558204652
GiGs
Pro
Sheet Author
Here's the fixed and tweaked script: Pathfinder Action Menu.   I posted it in a new thread, since more pathfinder players might find a use for it :) Seph, I added it to the test campaign so you can try it out immediately.
1558241465
GiGs
Pro
Sheet Author
I dont want to get your hopes up, but I might have an idea on how to do this attack, but have a few questions: Seph said: Thanks for the clarification! Regarding the first item, the main purpose is to simplify multiple abilities that affect attack rolls interacting with each other. Two major bosses in my Pathfinder campaign have these abilities, so having everything resolved in a macro would be awesome. They are as follows: “…whenever you make an attack roll … and miss, you may immediately roll again. You must take the second roll, even if it’s lower.” For this I changed the attack roll to 1d20ro<{@{target|ac} - <roll modifiers>,1}kh1cs>19 + <roll modifiers>. “If your successful critical confirmation roll is a natural 19 or 20, you can spend 2 stamina points to roll another confirmation roll. If this confirmation roll also succeeds, increase your critical multiplier by 1 for this attack, and you can roll again. If you continue to roll 19 or 20, you can continue to spend stamina points for additional rolls, and the increases to the critical multiplier stack.” This is where the exploding dice come in. I want to be able to know how many times the crit confirmation roll results in a nat 19 or 20, so I imagine the attack roll might be something like 1d20ro<{@{target|ac} +1 - <roll modifiers>,1}kh1!>19>19 + <roll modifiers>. If possible, a way for the number of successes to increase the critical multiplier damage would be handy. “When making a Sudden Attack, you roll twice and take the better result, adding your tier to the attack roll.” This is what changes the 1d20 to 2d20k1. Now I'd just like a way to combine all three, since they affect the same attack. This is a simplified version of the macro I currently have for this attack: @{selected|whispertype} &{template:pc} {{name=Sudden Attack}} {{type=attackdamage}} {{showchar=@{selected|rollshowchar}}} {{charname=@{selected|character_name}}} {{nonlethal=1[Nonlethal]}} {{attack=1}}{{roll=2d20k1ro<{@{target|ac} - (@{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers (there's a lot)>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]),1}kh1cs>19cf0 + @{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]}} {{critconfirm=2d20k1ro<{@{target|ac} - (4[CF] + @{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers (there's a lot)>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]),1}kh1cs>19cf0 + 4[CF] + @{selected|bab}[BAB] + @{selected|strength_mod}[STR] + <all other modifiers>[MOD] + @{selected|attack_bonus}[TEMP] + (@{selected|attack_condition})[CONDITION] + @{selected|rollmod_attack}[QUERY]}}{{atkvs=(Melee vs AC)}}{{descflag=1}}{{desc=must spend 1 mythic power}}{{shownotes=1}}{{notes=}}{{damage=1}} {{dmg1flag=1}} {{dmg1=2d10+@{selected|strength_mod}[STR] + <dmg modifiers>[MOD] + @{selected|damage_bonus}[TEMP] + @{selected|rollmod_damage}[QUERY] }}{{dmg1type=?{Damage type|piercing,p|bludgeoning,b}}}{{dmg1crit=((20 * 3) + (@{selected|strength_mod}[STR] + <dmg modifiers>[MOD] + @{selected|damage_bonus}[TEMP] + @{selected|rollmod_damage}[QUERY]) * 3)}} {{conditionsflag=@{selected|attack_condition}}} {{conditions=@{selected|conditions_display}}} {{conditionsnote=@{selected|attack_condition_note}@{selected|damage_condition_note}}} I tested the above roll, and it looks incomplete, and the attack and damage rolls aren't enclosed in [[ ]] so it doesnt roll. Do you have a working version of this roll, using just a basic attack roll (none of the three special rules you want incorporated)? I'm curious about these two rules and how they interact: “…whenever you make an attack roll … and miss, you may immediately roll again. You must take the second roll, even if it’s lower.”  “When making a Sudden Attack, you roll twice and take the better result, adding your tier to the attack roll.”  How do both of these apply together? Do you roll twice, take the better roll, and then if you still miss, roll twice again, take the best of those, and must accept it if its better than the first paired roll? It's not too hard to do a custom roll, even with rules as complex as this - the tricky part is combining it with a rolltemplate (especially since the html entity replacement crops up when interacting with scripts), but i have an idea how to do it and look mostly right. Your calling macro would have the rolltemplate broken into parts, something like !bossattack --attack --damage --template attack would be the entire attack string , except for the roll part (all the bonuses basically). damage would be the damage string without the [[ ]], to make sure roll20 doesnt roll it before the script gets it. and template would be the rest of the roll template without the attack and damage sections. In the script, I'd handle making the attack roll, then adding on the bonuses. The damage roll would then be made, taking critical effects into account. And then a fake attack and damage rolltemplate element would be added into the template, and it would be printed out as a complete attack. a {{desc=}} element could be added to show how many d20s were rolled on the attack, and the critical options (how many times crits were rolled, and how much stamina could be spent).  The main issue with this is you would lose the mouseover text (you know where you mouse over a roll and see how it is made) - but you shouldnt need that. Actually i could probably fake a mouseover to include those, but you might want to see them more easily if you are deciding how much stamina to spend.
1558301741

Edited 1558319524
Seph
Pro
GiGs said: I tested the above roll, and it looks incomplete, and the attack and damage rolls aren't enclosed in [[ ]] so it doesnt roll. Do you have a working version of this roll, using just a basic attack roll (none of the three special rules you want incorporated)? That was my bad. The example I gave was a cut down version of the current macro I have, and I accidentally erased more than I intended. Since the attack roll itself can't be adjusted on the sheet, I copied the normal roll to a macro and edited the attack roll directly. Here's the attack as rolled directly from the character sheet, without any of the additions I made to the template in the macro: @{Qelsimur Paladyktes|whispertype} &{template:pc} {{name=Sudden Attack}} {{type=attackdamage}} {{showchar=@{Qelsimur Paladyktes|rollshowchar}}} {{charname=@{Qelsimur Paladyktes|character_name}}} {{nonlethal=[[1[Nonlethal]]]}} {{attack=1}}{{roll=[[1d20cs>19 + 30[BAB] + 10[STR] + (10[TIER]+1[DVN]+5[CLOSE]+1[AOMF]+2[HRMK]+1[WF]+1[GWF])[MOD] + 0[TEMP] + (@{Qelsimur Paladyktes|attack_condition})[CONDITION] + @{Qelsimur Paladyktes|rollmod_attack}[QUERY] ]]}} {{critconfirm=[[1d20cs20 + 30[BAB] + 10[STR] + (10[TIER]+1[DVN]+5[CLOSE]+1[AOMF]+2[HRMK]+1[WF]+1[GWF])[MOD] + 0[TEMP] + (@{Qelsimur Paladyktes|attack_condition})[CONDITION] + @{Qelsimur Paladyktes|rollmod_attack}[QUERY] + @{Qelsimur Paladyktes|critconfirm_bonus}[CRIT CONFIRM BONUS] ]]}}{{atkvs=(BAB+STR vs AC)}}{{descflag=[[1]]}}{{desc=must spend [[1]] mythic power Each time the wielder damages an opponent with the weapon, its enhancement bonus increases by +1 when making attacks against that opponent (to a maximum total enhancement bonus of +5). This extra enhancement bonus goes away if the opponent dies, the wielder uses the weapon to attack a different creature, or 1 hour passes. (Amulet) (use fist status icon on tokens to represent the stack)}}{{shownotes=[[1]]}}{{notes=Bypass all DR By spending [[5]] stamina points, you can treat a hit with an unarmed strike as a critical hit for the purpose of determining the benefits that you gain from Hamatulatsu. When you fail to confirm a critical hit with a melee attack, you can spend [[2]] stamina points to attempt to disarm the target anyway. When you do, reroll the confirmation roll and use it to determine if the disarm attempt exceeds the opponent’s CMD. This reroll is used only for the disarm combat maneuver; it can’t cause the critical to be confirmed. You still can’t make the attempt if the target is immune to critical hits. When you hit with an attack and the roll fails to threaten a critical hit by 3 or less, you can spend [[5]] stamina points to attempt to deal double damage anyway. Roll as if confirming a critical hit. If this confirmation roll succeeds, your attack is still not a critical hit, but it deals double damage.}}{{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d10+10[STR] + floor((7[CLOSE]+1[AOMF]+2[HRMK]+2[WS]+2[GWS])/3)[MOD] + 0[TEMP] + @{Qelsimur Paladyktes|rollmod_damage}[QUERY]]]}}{{dmg1type=s/p}}{{dmg1crit=[[((2d10+2d10+2d10) + (10[STR] + floor((7[CLOSE]+1[AOMF]+2[HRMK]+2[WS]+2[GWS])/3)[MOD] + 0[TEMP] + @{Qelsimur Paladyktes|rollmod_damage}[QUERY]) * 3)]]}} {{conditionsflag=[[@{Qelsimur Paladyktes|attack_condition}]]}} {{conditions=@{Qelsimur Paladyktes|conditions_display}}} {{conditionsnote= @{Qelsimur Paladyktes|attack_condition_note}@{Qelsimur Paladyktes|damage_condition_note}}}
1558303228

Edited 1558319627
Seph
Pro
GiGs said: I'm curious about these two rules and how they interact: “…whenever you make an attack roll … and miss, you may immediately roll again. You must take the second roll, even if it’s lower.”  “When making a Sudden Attack, you roll twice and take the better result, adding your tier to the attack roll.”  How do both of these apply together? Do you roll twice, take the better roll, and then if you still miss, roll twice again, take the best of those, and must accept it if its better than the first paired roll? That was my guess as well, though I couldn't find a definitive answer in any forums or rules text. That's how I ended up changing the attack roll to this {{attack=1}}{{roll=[[2d20k1ro<{@{target|ac} - (30[BAB] + 10[STR] + (10[TIER]+1[DVN]+5[CLOSE]+1[AOMF]+2[HRMK]+1[WF]+1[GWF])[MOD] + 0[TEMP] + (@{Qelsimur Paladyktes|attack_condition})[CONDITION] + @{Qelsimur Paladyktes|rollmod_attack}[QUERY]),1}kh1cs>19 + 30[BAB] + 10[STR] + (10[TIER]+1[DVN]+5[CLOSE]+1[AOMF]+2[HRMK]+1[WF]+1[GWF])[MOD] + 0[TEMP] + (@{Qelsimur Paladyktes|attack_condition})[CONDITION] + @{Qelsimur Paladyktes|rollmod_attack}[QUERY] ]]}} which seems to work well. The main trouble I was having was figuring out how best to incorporate the ability regarding rerolling confirmation rolls. I assumed exploding dice could work, but that doesn't work well with the 2d20k1 roll as intended. I also found mixed opinions regarding whether the above two abilities would be applied to the confirmation roll at all, some saying it shouldn't and some saying it should since the rules describe it as "another attack roll". It may be easier to just copy the confirmation rolls for each attack as a separate macro, and manually reroll them that way.