PDA

View Full Version : New Extension: TheoGeek's Improved Critical



TheoGeek
October 11th, 2016, 21:59
NOTE!
This extension is being updated here: 5E - Theogeek's Improved Critical (https://www.fantasygrounds.com/forums/showthread.php?61376-5E-Theogeek-s-Improved-Critical)


AUTHOR: Is FGU & FGC compatible (updates as of 12 July 2020).

---------------- Version 3.1 ----------------
Download: 37637 (rev 3.1)

Changed method of handling the handlers. :) Makes this play well with others.
------------------------------------------------

IMPORTANT NOTE:
Version 3.1 still contains the menu option introduced in 2.3a called "Temporary calculation fix" [On* | Off]. The purpose of this option is to fix a bug in the 5E ruleset in the way that damage is calculated if the damage is critical and the target is immune, resistant, or vulnerable to one of the damage types.

I have tested this as far as I could and it worked for every scenario I ran it through, but there may be side-effects I haven't encountered yet. If you would, please use this version with this new option set to "On" and report any errors you may see. If you set it to "Off", it will revert back to the standard 5E ruleset method for computing damage.

The bug is on the radar to be fixed, but all of the effort is going towards Unity (which is the right way to do it) so it may be a while until the actual fix makes it in.

If I don't hear about any errors in this, this band-aid will be included in future releases of this extension until such time as the 5E ruleset is updated.

Please use this to test the damage calculation and report back!

============

Hey all!

So, I made this extension because I have had players be consistently disappointed in critical hits that do less damage than a standard hit. This extension only modifies the RAW to max the standard damage dice. All else is equal. For example, a half-orc with 18 strength (and no other bonuses) wielding a greatsword, if he crits, will do:


MAX(2d6) + bonuses + 3d6 = 12 + 4 + 3d6

The 3d6 is the crit damage: weapon dice (2d6) + the Half-Orc's Savage Attack bonus (1d6).

That same half-orc with a greataxe does:

Max(1d12) + 4 + 2d12 = 12 + 4+ 2d12.

Without the extension, a half-orc critical with a greatsword might look like this:

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=30397

With the extension enabled, a half-orc critical with a greatsword might look like this:

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=30777

(Note: the output "D1=4(6)" means that the first damage dice was originally rolled as a "4" but was maxxed to a "6")

This extension ONLY guarantees that any critical attack will do at least the maximum damage of the weapon used (i.e. it raises the floor). It does not guarantee maximum damage (unless the options are set for it to do maximum damage), and it will never do greater maximum damage than a critical without this extension.

Have fun with it and let me know if you have any additional ideas!

Thanks to everyone who helped (check out https://www.fantasygrounds.com/forums/showthread.php?34354-5th-edition-question-create-custom-critical-damage-as-a-global-rule if you want to follow the discussion as to how this came about.)
Jeff.

Option settings:

Combat Settings -> Improved Critical -> Dice to maximize = [Damage Dice | Critical Dice | Both | None] - Defaults to "Damage Dice"
- Damage Dice = All damage dice are maxxed, critical dice are rolled
- Critical Dice = All critical dice are maxxed (including extra critical dice from features like Savage Critical, Brutal Critical, etc.), damage dice are rolled
- Both = All damage AND all critical dice are maxxed
- None = revert to standard critical damage handler

Combat Settings -> Improved Critical -> Include effect dice [No | Yes] - Defaults to "Yes"
- No = Damage dice from effects are rolled as normal
- Yes = Damage dice from effects (such as sneak attack) are included in the calculations above
- Note: This option is dependent on the method chosen. For example, if the maxxing is "Damage Dice" and this is "Yes", then the normal damage and the effect damage will be maxxed.
- Note: If the maxxing is "Both" and "Include effect dice = Yes", on a critical hit, you will do the maximum possible damage from all dice so be careful. :)

Combat Settings -> Improved Critical -> Max if target has critical immunity [No | Yes] - Defaults to "No"
- No = Effectively bypasses this extension and rolls damage for a critical hit normally if the target has the "IMMUNE: critical" effect (i.e. no maxxing of anything regardless of other options selected for this extension)
- Yes = Maxxes normal damage on a critical hit, even if the target is critical immune, if the "Dice to maximize" setting is set to "Damage Dice" or "Both"

Combat Settings -> Improved Critical -> Show die rolls for targets [First only | Crit immune | All ] - Defaults to "First only"
Note: This setting is only useful when multiple targets are critically hit in one attack and there is a mix of crit immune and non-crit immune targets. Mainly, this is to help the DM understand what happens if "Max if target has critical immunity" is set to "No" since that setting will override maxxing and roll damage for targets that are immune to critical damage, which makes the damage done to a critical immune target different from the displayed roll for non critical immune targets.
- First only = Only display the damage roll for the first target hit (this is the normal Fantasy Grounds behavior)
- Crit immune = Display the die roll for the first target hit and all crit immune targets
- All = Display the die rolls for all targets hit

Combat Settings -> Improved Critical -> Disable critical damage dice [Remove crit dice | Force crits to 0 | No] - Defaults to "No"
Note: This setting is intended to make damage from critical hits behave like damage from normal hits, effectively disabling critical damage. This will NOT override other settings from this extension (such as maxxing normal damage and effect damage).
Note: Enabling this option will basically make abilities like Savage Attack and Brutal Critical useless, so only use this if your table wants to ignore critical damage entirely.
- Remove crit dice = Remove critical damage dice from the roll entirely such that they don't show up in the chat window at all, and are not included in any calculation
- Force crits to 0 = Keep the critical dice in the roll, but set their values to 0
- No = critical hits create critical damage as expected

---- Updated (12 July 2020) ----
Version 3.1
- Update to be consistent with the way Unity now computes damage

---- Updated (05 May 2020) ----
Version 3.0
- Change way handlers are handled.
- Many thanks to kentmccullough (https://www.fantasygrounds.com/forums/member.php?62515-kentmccullough) for working to get our extensions working together!

---- Updated (18 April 2020) ----
Version 2.4
- Added new option "Disable critical damage dice"
- Minor code improvement

---- Updated (9 December 2019) ----
Version 2.3
- Renamed options and selections to make it more understandable
- Added new option "Show die rolls for targets"
- Slightly changed output to show the original roll and the roll calculated from the Improved Critical function (for example, the output D1=4(6) means that the original roll was "4" and the extension maxxed it to a "6")

---- Updated (30 November 2019) -----
Version 2.2:
- General cleanup
- Replaced temporary bug fix from version 2.1 with an actual fix

---- Updated (28 November 2019) -----
Version 2.1:
- BUGFIX...this works, but is temporary. It will be replaced when the code is cleaner.

---- Updated (21 November 2019) -----
Version 2.0:
- Refactor to use onDamage instead of onDamageRoll
- Add option to roll damage dice if target is immune to critical damage (basically ignores this extension)
- Ignore this extension if the critical hit is due to the Chaos Bolt spell

---- Updated (15 July 2019) -----
Version 1.9:
- Fix coding error in wrapper

---- Updated (5 July 2019) ------
Version 1.8:
- Add icon created by Glassstaff - thanks Glassstaff!
- Refactor the code to make it integrate better with existing ruleset:
- Add wrapper function to conditionally call either the ImprovedCritical handler or the onDamageRoll handler
- Remove code copied from ActionDamage.onDamageRoll and simply call that function when necessary

---- Updated (4 March 2019) ------
Version 1.7:
- Remove REROLL since that is not in the ActionDamage.onDamageRoll this code replaces.
- Copy-n-Paste Max damage modifier code from ActionDamage.onDamageRoll.
- Fix bug in options settings that prevented the ActionDamage.onDamageRoll routine from running when this extension is turned off.
- Fix bug that included Effect damage, even if it was excluded, if "Max Both" was selected.

Hopefully this is the last of the bugs. :) If you find something, please let me know!

---- Updated (2 March 2019) ------
Version 1.6:
- Make output more descriptive.

Version 1.5:
- Add support for manual MAX damage modifier (note, HALF already works)
- Streamline code

---- Updated (25 February 2019) ------
Improved Critical (new version numbering 1.4) - Add settings item controls as follows:

Trenloe
October 11th, 2016, 22:38
Nice work! :)

TheoGeek
October 11th, 2016, 22:41
Thanks! It's pretty cool how you guys made it so extensible. That's pretty awesome!

Zacchaeus
October 11th, 2016, 23:01
Well done.

TheoGeek
October 12th, 2016, 02:24
Had to update this to v2 - I forgot to add back in the "if critical" guard around it. :) It works now.

LordEntrails
October 28th, 2016, 04:05
Thanks, just talked with one of my groups tonight and we all agreed to start using this. Thanks!

rob2e
October 28th, 2016, 09:27
Great job. Nice to have available. I personally love it (as a DM) when people roll two ones plus their modifier on a cirt. Hilarious. As a player... I HATE IT!

drakonin
October 28th, 2016, 20:14
Does this effect NPC crits as well?

vodokar
October 28th, 2016, 20:24
What rulesets does this work for? Any built on CoreRPG?

Trenloe
October 28th, 2016, 20:36
What rulesets does this work for? Any built on CoreRPG?
Specifically for 5E.

TheoGeek
October 28th, 2016, 21:17
What rulesets does this work for? Any built on CoreRPG?

Yeah, as Trenloe said, I only wrote it for 5e because that's what I use it for. I never tried it for other systems.

TheoGeek
October 28th, 2016, 21:18
Does this effect NPC crits as well?

YES! :)

All critical hit rolls result in this behavior. Sort of scary, eh? :)

JohnD
October 28th, 2016, 23:39
Does this effect NPC crits as well?

Good question. Fair is fair.

trembot_89
March 5th, 2017, 07:13
I'm having trouble getting it to work with TASagent's Vitality extension, has anyone seen this too?

Zacchaeus
March 5th, 2017, 09:14
I'm having trouble getting it to work with TASagent's Vitality extension, has anyone seen this too?

It may well be an issue with the Vitality extension since that hasn't been updated to work with 3.2

trembot_89
March 5th, 2017, 14:59
It may well be an issue with the Vitality extension since that hasn't been updated to work with 3.2

Are there any resources I can look at that will make me a little more competent modifying extension files? I'd like to try and fix it if possible but I don't have any experience...

EDIT: The Vitality extension by TASagent seems to work with 3.2 but there is still the compatibility issue...

Thegroo
March 6th, 2017, 01:14
Thanks so much

trembot_89
March 24th, 2017, 00:26
Are there any resources I can look at that will make me a little more competent modifying extension files? I'd like to try and fix it if possible but I don't have any experience...

EDIT: The Vitality extension by TASagent seems to work with 3.2 but there is still the compatibility issue...

So a buddy of mine and I were able to combine Theogeek's Improved Critical and TASagent's Vitality extension, but I only touched the parts that do the mechanical work so TheoGeek's Improved Critical isn't mentioned in the credits -- but I'd like to fix that before posting our mix up for download. Is it as simple as adding a few lines of text or am I going to have to roll up my sleeves?

rob2e
March 24th, 2017, 00:48
Are there any resources I can look at that will make me a little more competent modifying extension files? I'd like to try and fix it if possible but I don't have any experience...

EDIT: The Vitality extension by TASagent seems to work with 3.2 but there is still the compatibility issue...

I support your efforts here (mentally). Good karma!

TheoGeek
March 27th, 2017, 02:54
So a buddy of mine and I were able to combine Theogeek's Improved Critical and TASagent's Vitality extension, but I only touched the parts that do the mechanical work so TheoGeek's Improved Critical isn't mentioned in the credits -- but I'd like to fix that before posting our mix up for download. Is it as simple as adding a few lines of text or am I going to have to roll up my sleeves?

Awesome! Thanks!

trembot_89
August 4th, 2017, 05:13
So I finally picked this back up and think I have a finished product for you guys. The base extension is TASagent's and I slapped TheoGeek's in where needed. One problem is that I'm not really sure how to upload it here on the forum... which is kind of embarrassing, I feel that of all things, I should know how to do that :confused:

Zacchaeus
August 4th, 2017, 09:04
Click on the advanced button at the bottom of the post you are making and then find the manage attachments button to get the upload dialog.

trembot_89
August 4th, 2017, 15:18
Thanks, my mind is doing a big "duh" to myself right now.
Anyway, this is the "Character Vitality and Improved Criticals" extension. It has the optional rule of Vitality shown in Unearthed Arcana (og ext written by TASagent) and adds TheoGeek's extension for superior crits. The reason why I merged the two was that before the merge, the Vitality extension would override the ImprovedCrit like it wasn't even there - but now, since they are one, that is not an issue.

Update: see this thread https://www.fantasygrounds.com/forums/showthread.php?39559-Character-Vitality-and-Improved-Criticals&p=349413#post349413 for the (updated) extension.

Stripe_dog
July 20th, 2018, 20:10
What about maximising the damage on things added to the attack from effects, such as Sneak Attack or Divine Smite? Is it possible, and if so, how do?

Example: A level 5 rogue with Dex mod +3 scores a crit using a short sword attack on which Sneak Attack applies, and so the Rogue deals [Max]1d6(Short Sword)+3{Dex mod}+[Max]3d6(Sneak Attack) + [Crit]1d6(Short Sword)+[Crit]3d6(Sneak Attack)

TheoGeek
July 21st, 2018, 04:04
What about maximising the damage on things added to the attack from effects, such as Sneak Attack or Divine Smite? Is it possible, and if so, how do?

Example: A level 5 rogue with Dex mod +3 scores a crit using a short sword attack on which Sneak Attack applies, and so the Rogue deals [Max]1d6(Short Sword)+3{Dex mod}+[Max]3d6(Sneak Attack) + [Crit]1d6(Short Sword)+[Crit]3d6(Sneak Attack)

Currently, it does not function this way, it only MAXs the weapon damage, not effect damage (but it does roll effect damage twice). I'm not sure what it would take to MAX the effect damage prior to the additional roll.

LordEntrails
August 2nd, 2018, 00:52
Anybody try this with 3.3.6 yet? This is one of the extension I use and don't want to update until I know or have time to test. Anyone :) ?

LordEntrails
August 2nd, 2018, 05:31
Tested, works with 3.3.6.

Verified both with natural 20s and using the shift/damage to force crit damage rolls.

Dax Doomslayer
August 2nd, 2018, 16:11
Yup - I used it last night and there were no issues when criticals were rolled.

Rebecca
November 3rd, 2018, 17:00
This does not affect spell crits right?

TheoGeek
November 5th, 2018, 00:25
It does. It affects any critical hit.

Tielc
January 22nd, 2019, 15:30
Would it be possible to not show the dice rolls for the dice that are being maximized with this extension? It may be confusing for players seeing 2 dice rolling ie(2d8 = 6 + 4), and then the result is say 8 + 4.

Trenloe
January 22nd, 2019, 19:31
Would it be possible to not show the dice rolls for the dice that are being maximized with this extension? It may be confusing for players seeing 2 dice rolling ie(2d8 = 6 + 4), and then the result is say 8 + 4.
I know you've seen this response already. Mentioning it here for others who may read and spend time responding. There's a good reason why the extension doesn't change the dice rolling but just the result. Details here: https://www.fantasygrounds.com/forums/showthread.php?47617-Alternate-Critical-Rolls&p=423434&viewfull=1#post423434

sjbehindthescreen
February 21st, 2019, 02:21
My group is liking the ImprovedCritical extension, thanks Theogeek!

I did notice that in 5e the "half" and "max" modifiers didn't work right (er, at all) when this mod was loaded. With a bit of copy-paste and a few edits I added a branch to check for those 2 descriptions and then set the damage roll to maximum on the die/dice, or half the maximum when those modifier buttons are selected. Lua is pretty straightforward thankfully.

If someone wants to make or use the same mods, let me know.

LordEntrails
February 21st, 2019, 03:17
My group is liking the ImprovedCritical extension, thanks Theogeek!

I did notice that in 5e the "half" and "max" modifiers didn't work right (er, at all) when this mod was loaded. With a bit of copy-paste and a few edits I added a branch to check for those 2 descriptions and then set the damage roll to maximum on the die/dice, or half the maximum when those modifier buttons are selected. Lua is pretty straightforward thankfully.

If someone wants to make or use the same mods, let me know.
I never noticed that. Perhaps ou could upload here and then if Theo wants he could incorporate into the first post?

TheoGeek
February 21st, 2019, 03:41
Yeah, I guess I never tried that. I'd be happy to add it to the original extension if I get time. Or, you could make an "Improved Improved Critical" :)

Zetesofos
February 22nd, 2019, 19:16
This is EXACTLY what I was looking for. This is awesome!

sjbehindthescreen
February 23rd, 2019, 02:32
Here's the version I hacked on. Again, in 5e the maximum modifier button maxes all the dice, and the half halves all the dice. The critical mod button works as Theogeek intended.

Theogeek, I updated the announcement text so I could tell the difference in testing, but I have no issues with you modding the original and removing my vanity.

Tielc
February 25th, 2019, 19:52
I was being extremely stupid, never mind. I was downloading the mod on my laptop which I am screen sharing with my workstation using Synergy. I was overwriting it in the wrong place.

Tielc
February 25th, 2019, 20:07
This latest update is super awesome TheoGeek! I love it. Have you considered making the effect damage optional? I'm not sure how you would do this.

TheoGeek
February 26th, 2019, 04:30
Here's the version I hacked on. Again, in 5e the maximum modifier button maxes all the dice, and the half halves all the dice. The critical mod button works as Theogeek intended.

Theogeek, I updated the announcement text so I could tell the difference in testing, but I have no issues with you modding the original and removing my vanity.

IGNORE ALL THIS...I WAS BEING STUPID: [So, I went to test this but your "hack" got overwritten by my update I was working on before I saw this. :) Can you re-attach it but name it something else so it doesn't overwrite the one I just uploaded? I'd like to check out what you did and possibly incorporate it into the base extension.]

Just DL'd this and will take a look at incorporating the changes.

Thanks!

paladiusdarkhelm
February 27th, 2019, 17:26
Is this functionality going to be merged into the Vitality/Improved Criticals combo extension as well? If not,is there a way to take advantage of this new update and still use vitality?

TheoGeek
March 2nd, 2019, 20:56
My group is liking the ImprovedCritical extension, thanks Theogeek!

I did notice that in 5e the "half" and "max" modifiers didn't work right (er, at all) when this mod was loaded. With a bit of copy-paste and a few edits I added a branch to check for those 2 descriptions and then set the damage roll to maximum on the die/dice, or half the maximum when those modifier buttons are selected. Lua is pretty straightforward thankfully.

If someone wants to make or use the same mods, let me know.

OK.. Maybe I'm missing something, but even with my extension disabled, the MAX modifier doesn't seem to work. When I select the "Critical" button, it rolls critical damage, but when I select "Max" or "Critical" AND "Max" it doesn't Max it.

With or without my extension enabled, Half works fine.

Is the MAX modifier broken?

TheoGeek
March 2nd, 2019, 23:39
Is this functionality going to be merged into the Vitality/Improved Criticals combo extension as well? If not,is there a way to take advantage of this new update and still use vitality?

I don't plan on adding this support only because I didn't write the combo extension. I am more than happy to let trembot_89 add this though if he wants. I'm sure either one of us could update that extension.

deer_buster
March 3rd, 2019, 07:15
OK.. Maybe I'm missing something, but even with my extension disabled, the MAX modifier doesn't seem to work. When I select the "Critical" button, it rolls critical damage, but when I select "Max" or "Critical" AND "Max" it doesn't Max it.

With or without my extension enabled, Half works fine.

Is the MAX modifier broken?

I just tested it with no extensions loaded, MAX works just fine. 2D6+2 MAX CRITICAL returned 4x 6s for a total of 26 damage. 2d6+2 MAX returned 2x 6s for a total of 14 damage.

EDIT:
With just your extension loaded, MAX does not work at all. That is because your mod replaces the onDamageRoll function (which handles MAX) in manager_action_damage.lua.

deer_buster
March 3rd, 2019, 07:51
If you replace your existing ImprovedCritical code with this, it should work fine...NOTE: It does not have the changes from anything after v3 of your extension...



function ImprovedCritical(rSource, rRoll)
-- Handle max damage
local bMax = rRoll.sDesc:match("%[MAX%]");
local bCrit = rRoll.sDesc:match("%[CRITICAL%]");
if bMax then
for _,vDie in ipairs(rRoll.aDice) do
local sSign, sColor, sDieSides = vDie.type:match("^([%-%+]?)([dDrRgGbBpP])([%dF]+)");
if sDieSides then
local nResult;
if sDieSides == "F" then
nResult = 1;
else
nResult = tonumber(sDieSides) or 0;
end

if sSign == "-" then
nResult = 0 - nResult;
end

vDie.result = nResult;
if sColor == "d" or sColor == "D" then
if sSign == "-" then
vDie.type = "-b" .. sDieSides;
else
vDie.type = "b" .. sDieSides;
end
end
end
end
end
if bCrit then
for _,vDie in ipairs(rRoll.aDice) do
local sSign, sColor, sDieSides = vDie.type:match("^([%-%+]?)([dDrRgGbBpP])([%dF]+)");
if sDieSides then
local nResult = vDie.result;
if sDieSides == "F" then
nResult = 1;
else
if sColor ~= "g" and sColor ~= "G" then
nResult = tonumber(sDieSides) or 0;
end
end

if sSign == "-" then
nResult = 0 - nResult;
end

vDie.result = nResult;
end
end
end

decodeDamageTypes(rRoll, true);
end

TheoGeek
March 3rd, 2019, 14:02
Yeah, the MAX modifier works fine with my extension enabled (as of the update I made last night - v 1.6), and it also works when my extension is not loaded at all.

However, when my extension is loaded but disabled (via the settings option), it executes this code ...

ActionsManager.registerPostRollHandler("damage", onDamageRoll);

... which I believe is the default handler. At that point, my extension does not execute (as evidenced by some debug code I add) at all, and damage works normally then, but MAX stops working. HALF continues to work.

Any clues there?

deer_buster
March 3rd, 2019, 18:09
Yeah, the MAX modifier works fine with my extension enabled (as of the update I made last night - v 1.6), and it also works when my extension is not loaded at all.

However, when my extension is loaded but disabled (via the settings option), it executes this code ...

ActionsManager.registerPostRollHandler("damage", onDamageRoll);

... which I believe is the default handler. At that point, my extension does not execute (as evidenced by some debug code I add) at all, and damage works normally then, but MAX stops working. HALF continues to work.

Any clues there?

Yeah, you are trying to call a function that isn't defined in your scope....use ActionsManager.registerPostRollHandler("damage", ActionDamage.onDamageRoll);

TheoGeek
March 3rd, 2019, 18:33
Yeah, you are trying to call a function that isn't defined in your scope....use ActionsManager.registerPostRollHandler("damage", ActionDamage.onDamageRoll);

DOH! That'd do it!

It works now. :) I'll be uploading a new version soon.

Thanks!

Tielc
March 5th, 2019, 13:58
I just got to looking at the recent changes, including how you added options for this mod. You sir, are freaking amazing. I love the customization of this mod!

sjbehindthescreen
March 7th, 2019, 01:48
Thanks Theogeek, for updating. I like the more verbose text in the chatlog, and now Critical and Max work perfectly. But the 5e HALF modifier button doesn't work for me whether I load the extension or not. Weird.

What results do you see? An example from my chatlog:


[DAMAGE] Claw [HALF] [TYPE: slashing (2d6+7=16)]

(that's 2d6 roll of 6 and 3)

TheoGeek
March 7th, 2019, 23:44
Thanks Theogeek, for updating. I like the more verbose text in the chatlog, and now Critical and Max work perfectly. But the 5e HALF modifier button doesn't work for me whether I load the extension or not. Weird.

What results do you see? An example from my chatlog:


[DAMAGE] Claw [HALF] [TYPE: slashing (2d6+7=16)]

(that's 2d6 roll of 6 and 3)

Initial Conditions:
Improved Critical Extension set to "Max Damage Dice"
Barbarian/Rogue
Manual Modifiers: CRITICAL, HALF
Weapon: Greatsword
Barbarian Brutal Critical (for an extra crit dice)
Rogue Sneak Attack (for the effect dice)

Here's what I see as my output:
----------
[DAMAGE (M)] Greatsword [EFFECTS 1d6+2] [CRITICAL] [HALF] [ImprovedCritical OVERRIDING Damage Dice: (Die #1: d6, Normal Damage, overriding 2 with 6), (Die #2: d6, Normal Damage, overriding 1 with 6)] [TYPE: slashing (3d6+6=23)] [TYPE: slashing,critical (4d6=12)]

<dice graphics and total>

Damage [17] -> [to Aarakocra] [HALF] [STATUS: Wounded]
----------

Here's only HALF:
----------
[DAMAGE (M)] Greatsword [EFFECTS 1d6+2] [HALF] [TYPE: slashing (3d6+6=14)]

<dice graphics and total>

Damage [7] -> [to Aarakocra] [HALF]
----------

The HALF modifier is applied after the total normal damage is computed.

Do you see that last HALF damage line?

sjbehindthescreen
March 8th, 2019, 03:41
I'm dumb. The half damage works just fine when you APPLY the damage, not when rolled.

Thanks!

TheoGeek
July 5th, 2019, 23:34
Just updated with some code refactoring and an icon by Glassstaff!

paladiusdarkhelm
July 8th, 2019, 17:52
Hi, TheoGeek. Will you be adding an update for the combine Vitality and Improved Critical module as well?

Thanks!

TheoGeek
July 9th, 2019, 00:04
Hi, TheoGeek. Will you be adding an update for the combine Vitality and Improved Critical module as well?

Thanks!

That extension is not mine, but I did reply to trembot's thread about it.

Thanks!

Intruder
July 15th, 2019, 14:32
Hi TheoGeek, This is a GREAT extension!
But with the latest update (1.8), the IMMUNE and RESIST effects no longer work.
I am testing 5e with no other extensions present.

If yourself or others are unable to replicate, please post so I know to look at something else.

TheoGeek
July 15th, 2019, 14:43
Thanks for the kind words! I'll take a look and see what I can see. I take it 1.7 worked for these effects?

I should also create some kind of test procedure or something..hehe

Intruder
July 15th, 2019, 14:45
It had worked previously. Had never thought to check otherwise.

TheoGeek
July 16th, 2019, 00:08
Got it! Stupid coding error.

Uploaded v1.9

Intruder
July 17th, 2019, 17:32
Many thanks TheoGeek for the timely response.

spoonhead
October 29th, 2019, 06:50
Not sure if this extension is being updated or not, but we use it in my game. One of the players now has adamantine armour which ignores criticals. When I actually rolled a critical hit, your extension still rolled the improved critical dice, it applied maximum on the damage dice but the extra dice was ignored. I was expecting it to just roll normal damage, i.e. random on the damage die not maximum. Is this how it should roll?

I hope this makes sense.

LordEntrails
October 29th, 2019, 20:44
I believe this extension now has an option to set which die are maximized. If you switch it, then I think you will get desired behavior.

TheoGeek
October 29th, 2019, 20:59
Yeah, I think if you set it to "Max Crit Dice" you'll get the effect you desire since then, the damage dice would be rolled, and the crit dice would be maxxed, but your armor would cause the crit dice to be ignored, so it wouldn't matter. The downside to this is that in the case of characters that get extra crit dice, those would get maxxed. Like if a PC or NPC had the brutal critical ability with a longsword, the damage would be d8+8+8 (17-24) instead of 8+d8+d8 (10-24).

TheoGeek
October 30th, 2019, 03:59
Hey spoonhead!

This extension has a couple of options:

1) Improved Critical:Include Effect Dice (On | Off)
2) Improved Critical:Control (Max Damage Dice | Max Crit Dice | Max Both | Off)

If Improved Critical:Include Effect Dice = "On", when a critical is rolled (and Improved Critical:Control is not "Off"), any effect dice are also included in the maximizing (i.e. sneak attack damage), otherwise, they are rolled normally.

If Improved Critical:Control = "Off" then my extension is disabled and critical rolls are done per FantasyGrounds built-in handler.

If Improved Critical:Control = Max Damage Dice, when a critical is rolled, the "normal damage" dice are maximized and the "critical damage" dice are rolled.

If Improved Critical:Control = Max Crit Dice, when a critical is rolled, the "critical damage" dice are maximized and the "normal damage" dice are rolled.

If Improved Critical:Control = Max Both, when a critical is rolled, both the "normal damage" dice and the "critical damage" dice are maximized.

I added this pretty far into the resolving damage process so that I could just modify the already rolled damages depending on the options set. It doesn't know anything about the target. I may have to figure something out for this case, but a workaround is to look at the output in the chat window - it will tell you what was overridden and the value that was replaced. You could manually restore the "max damage" done and then subtract the original damage.

Thanks for using the extension!

spoonhead
October 30th, 2019, 09:14
Thanks for the replies. I will try out and see what is best.

I also thought of another potential problem when casting Chaos Bolt spell, in that if you roll doubles on the d8s you get to attack another creature within 30ft, however the critical dice would be dobles automatically. Any ideas?

TheoGeek
October 31st, 2019, 03:17
Thanks for the replies. I will try out and see what is best.

I also thought of another potential problem when casting Chaos Bolt spell, in that if you roll doubles on the d8s you get to attack another creature within 30ft, however the critical dice would be dobles automatically. Any ideas?

Yeah, by definition, when using this extension, damage is maxxed, so the rolls are also maxxed. You'll need to find out a different way to roll damage. For example, at our table, people love rolling physical die, so I always have the manual roll setting turned on, and use it often.

rigs19
November 4th, 2019, 03:36
Would it be possible to call this extension from a crit table?

I'd like to do a crit table like:

1 - 12 Normal crit
13 - 19 Improved crit (Max damage dice)
20 - 20 Improved crit (Max both)

TheoGeek
November 5th, 2019, 23:18
That sounds like a sweet idea, but I don't think tables work that way. You could do a crit table that would tell you to change a setting, but I don't think you can apply effects like that programatically.

Anyone got any info on this?

rigs19
November 11th, 2019, 23:50
Unfortunately this is the most up-to-date info I was able to find, and it's from 2012 (https://www.fantasygrounds.com/forums/showthread.php?16716-crit-table-mod).....


Looks like tables can't output to or affect the manager_action_damage.lua without an extension so as far as I can tell the only way to do it would be to have the crit table just output the number rolled, parse that in a state machine inside the extension (not the table, thus making the table redundant but it'll keep players in the loop as to what happened) and then roll the crit damage based on the state machine. Not too difficult but that puts a lot more on you than I was hoping it would.

TheoGeek
November 20th, 2019, 03:54
OK...updating this extension. :) I'll repost here when it's debugged. It's close.

This update is mainly to address the case where the target has the "IMMUNE: critical" effect.

Options Menu Items:
- Improved Critical: Control = [Off | Max Damage Dice | Max Crit Dice | Max Both] (default = Max Damage Dice)
- Improved Critical: Include Effect Dice = [On | Off] (default = On)
- Improved Critical: Roll if Immune = [On | Off] (default = Off)

In a nutshell:

- "Control"
pretty self explanatory

- "Include Effect Dice"
Only takes effect if "Control" is not off and maxxes the effect die per the control setting (damage, critical, both)

- "Roll if Immune"
This will cause the Damage die to be rolled instead of maxxed if the target has the "IMMUNE: critical" effect.

I also changed the output to be more consistent with other things that override rolls (like REROLL). The output will include this:

"[IMPROVED CRITICAL D1=5,D2=4]"

if the first two dice were rerolled. You'll see the maxxed values in the dice graphics that are displayed. I can add a "verbose" option if a more verbose output is desired.

It would take a lot of thinking to get the "Chaos Bolt" type damages working. In the meantime, I'd suggest remembering to disable this extension prior to casting that spell because maxxing its damage will break it no matter what.

====

EDIT: I figured out a workaround for the "Chaos Bolt" thing. I just bypass the Improved Critical extension entirely when the damage is from that spell (i.e. it rolls damage for a critical hit as if my extension were not loaded).

I'll test it more tomorrow and upload it soon afterwards!

TheoGeek
November 21st, 2019, 23:17
New version uploaded!

In a nutshell, I added an option to basically ignore this extension if the target has the "IMMUNE: critical" effect.
I also bypass this extension if the critical hit was from a Chaos Bolt spell.

Let me know what you think!
Jeff.

MSW
November 25th, 2019, 17:33
Hi TheoGeek,

where can i find the downlaod link for the extension? i can't see it. :-)

Thanks for your work.

TheoGeek
November 25th, 2019, 17:38
Hi TheoGeek,

where can i find the downlaod link for the extension? i can't see it. :-)

Thanks for your work.

DOH! I could see the links for the attachments, but maybe not everyone else could? I just added a download link to the first post. :)

MSW
November 25th, 2019, 17:42
Hi thanks
I just found it and thought to myself: I'm blind, it's still at the beginning anyway.

Now I wanted to delete my post ...

TheoGeek
November 25th, 2019, 17:45
Hi thanks
I just found it and thought to myself: I'm blind, it's still at the beginning anyway.

Now I wanted to delete my post ...

HA! I've thought the same thing about things I've posted MANY times.

TheoGeek
November 28th, 2019, 16:54
UPDATED!!

Found a crazy bug if multiple targets were selected. Should be fixed.

I tested it with a ton of scenarios, and they all *seemed* to be right (ignoring the critical damage bug that is being investigated by the devs).

Feedback appreciated!

TheoGeek
November 28th, 2019, 18:30
Gosh...this'l learn me to try to upload stuff when I'm tired. I just uploaded a new version. Still 2.1. As of the time on this post, the download link on the main page is the most recent one.

Notes: Adding the capability to handle options if the target has the "IMMUNE: critical" effect was harder than I thought, likely because of both my lack of understanding of the architecture of the ruleset, and my trying to be "too clever by half" in making the code compact. Some things may have fallen through the cracks, and I'll be updating this periodically as I find bugs. All that said, this is a pretty fun exercise and I'm learning a lot through it.

In the spirit of Thanksgiving, THANKS to everyone who has provided direction and input along the way!

spoonhead
November 29th, 2019, 09:35
Gosh...this'l learn me to try to upload stuff when I'm tired. I just uploaded a new version. Still 2.1. As of the time on this post, the download link on the main page is the most recent one.

Notes: Adding the capability to handle options if the target has the "IMMUNE: critical" effect was harder than I thought, likely because of both my lack of understanding of the architecture of the ruleset, and my trying to be "too clever by half" in making the code compact. Some things may have fallen through the cracks, and I'll be updating this periodically as I find bugs. All that said, this is a pretty fun exercise and I'm learning a lot through it.

In the spirit of Thanksgiving, THANKS to everyone who has provided direction and input along the way!

Thanks for all your work on this. My group (especially the Dwarf with Adamantine armor) will be very happy.

TheoGeek
December 2nd, 2019, 17:18
Thanks for all your work on this. My group (especially the Dwarf with Adamantine armor) will be very happy.

Glad you like it! Let me know if it's behaving as you expect/desire.

Beemanpat
December 9th, 2019, 16:31
TheoGeek this is great extension, thank you.

TheoGeek
December 10th, 2019, 03:16
Thanks for all the feedback!

I just uploaded 2.3 which should be the last one for a while as it works as expected now, and the code is pretty cleaned up.

I added a new option as well. :)

Combat Settings -> Improved Critical -> Show die rolls for targets [First only | Crit immune | All ] - Defaults to "First only"
Note: This setting is only useful when multiple targets are critically hit in one attack and there is a mix of crit immune and non-crit immune targets. Mainly, this is to help the DM understand what happens if "Max if target has critical immunity" is set to "No" since that setting will override maxxing and roll damage for targets that are immune to critical damage, which makes the damage done to a critical immune target different from the displayed roll for non critical immune targets.
- First only = Only display the damage roll for the first target hit (this is the normal Fantasy Grounds behavior)
- Crit immune = Display the die roll for the first target hit and all crit immune targets
- All = Display the die rolls for all targets hit

Let me know what you think and if you'd like anything new added...I'll get to it as I have time.

LordEntrails
December 10th, 2019, 04:11
Thanks. This is one of the few extensions I use all the time. Appreciate it :)

arcanjl
December 10th, 2019, 04:24
Thanks. This is one of the few extensions I use all the time. Appreciate it :)

Here here! (Ditto)

TheoGeek
December 13th, 2019, 03:11
Uploaded version 2.3a to address a bug I reported in the 5E ruleset. Consider it a "test" version, but you can always revert back to the standard 5E method by setting the new option "Temporary calculation fix" to "Off".

This bug is on the radar but most of the development time is being spent on Unity (which is a good thing), so I don't know the timeline for getting this fixed in the ruleset.

So, please test this out and let me know if you see any errors.

Thanks!

Dosamer
December 15th, 2019, 23:32
Is the 2.3a supposed to be standalone? If so, it doesn't pop up on my fantasy grounds, whereas if I use the 2.3 regular, the extension shows up.
Not sure how to troubleshoot that.

TheoGeek
December 16th, 2019, 00:13
Is the 2.3a supposed to be standalone? If so, it doesn't pop up on my fantasy grounds, whereas if I use the 2.3 regular, the extension shows up.
Not sure how to troubleshoot that.

Man, thanks a ton! Extensions are simply renamed ZIP files...the 2.3a I uploaded was a RAR file. I uploaded the correct version and verified that it works. :)

And yes, it is supposed to be standalone, just like the others.

Astaroshe
January 5th, 2020, 02:36
Not sure if this was coverd already, but I am working on my own little Critical System. My version basically modifies the Crit/Fumble Tables that you can enable in the 5e options instead of normal crits. As far as I understand that Module it can roll the result "CRITICAL HIT", which means the critical is rolled normally, or roll on a Table for some fun effects. Is this Extension also working if I enable this Module or do they conflict?

A second question (which was what brought me here in the 1st place. My Tables have serveral results that state "Do 2x Damage" and a Damage-Table, with some special effects and "Do 1,5x Damage". I'm currently trying to implement that in some way, my Idea was that the Damage Table act's a a normal Critical Hit (eg. you get the extra die of that weapon/attack) while the 2x uses maxed out hitdice.
Therefore my question would be, if it would be possible to do some neat command-snippet for my tables that trigger a normal critical hit (eg. normally this extension would be off) and another one that turns it on for the "2x Damge result" (temporary set this extension here to "On" for that attack)

TheoGeek
January 5th, 2020, 04:36
Not sure if this was coverd already, but I am working on my own little Critical System. My version basically modifies the Crit/Fumble Tables that you can enable in the 5e options instead of normal crits. As far as I understand that Module it can roll the result "CRITICAL HIT", which means the critical is rolled normally, or roll on a Table for some fun effects. Is this Extension also working if I enable this Module or do they conflict?

A second question (which was what brought me here in the 1st place. My Tables have serveral results that state "Do 2x Damage" and a Damage-Table, with some special effects and "Do 1,5x Damage". I'm currently trying to implement that in some way, my Idea was that the Damage Table act's a a normal Critical Hit (eg. you get the extra die of that weapon/attack) while the 2x uses maxed out hitdice.
Therefore my question would be, if it would be possible to do some neat command-snippet for my tables that trigger a normal critical hit (eg. normally this extension would be off) and another one that turns it on for the "2x Damge result" (temporary set this extension here to "On" for that attack)

1) The improved critical extension works with the built in crit/fumble tables, so it should work with any crit/fumble table.

2) I think there was a similar question asked before, but I don't think tables work that way. I could be wrong, but I'm the wrong person to ask. I think it would be pretty cool to tie this into a crit table, so if you figure it out, post back! :)

Zacchaeus
January 5th, 2020, 13:39
Therefore my question would be, if it would be possible to do some neat command-snippet for my tables that trigger a normal critical hit (eg. normally this extension would be off) and another one that turns it on for the "2x Damge result" (temporary set this extension here to "On" for that attack)

Extensions are loaded when the campaign is loaded. You can't switch an extension on or off; if it is loaded then it is 'on' until you exit the campaign and deselect it. Of course the extension can have options built into it which could switch parts of it on or off - depending on what it does.

TheoGeek
January 5th, 2020, 14:53
Extensions are loaded when the campaign is loaded. You can't switch an extension on or off; if it is loaded then it is 'on' until you exit the campaign and deselect it. Of course the extension can have options built into it which could switch parts of it on or off - depending on what it does.

Hey Zacchaeus!

So, the extension wouldn't need to be enabled or disabled, but if the table handler can manipulate the extension's options, or call other functions, Astaroshe could achieve any desired effect.

There are a couple of ways that my extension can facilitate this:

1) If the table can execute code that would set the Improved Critical option "Dice to Maximize" to one of [Damage, Crit, Both, None], then the table results could be written to control how the criticals work and no change to the extension is necessary.

2) If options cannot be changed by a script, I could write wrapper functions to do the same things that could be executed by the table code

I've not tried this before so I don't know how table handlers can or can't execute other scripts.

Thanks!

arcanjl
March 18th, 2020, 19:38
thank you!

izzle121
March 21st, 2020, 04:39
This is a phenomenal extension! It makes my job SO much easier!

Raven Darkstone
March 24th, 2020, 00:05
Hello, I have enjoyed using your crit mod, but I am coming to a situation that makes it over-kill. In my case I have someone cast a spell that does 4d6 damage. On a crit it calculates 4d6 as all 6's, then rolls the rest of the 4 d6s. That rolls a minimum of 36 damage (if the rest of the d6's are 1's), id there a way to have multiple die from one source be configured to half of them being d6? I probably wouldn't have noticed, except that the group is only level 3 and it turns into one hit kills on a crit during the game with CR 2 enemies.

TheoGeek
March 24th, 2020, 00:52
Hello, I have enjoyed using your crit mod, but I am coming to a situation that makes it over-kill. In my case I have someone cast a spell that does 4d6 damage. On a crit it calculates 4d6 as all 6's, then rolls the rest of the 4 d6s. That rolls a minimum of 36 damage (if the rest of the d6's are 1's), id there a way to have multiple die from one source be configured to half of them being d6? I probably wouldn't have noticed, except that the group is only level 3 and it turns into one hit kills on a crit during the game with CR 2 enemies.

First...Thanks!

Second, by rule, a critical without the extension enabled would deal 4d6 normal damage and 4d6 critical damage, so you'd already be rolling 8d6. :)

That said, I'm not entirely sure I know what you are asking for "multiple die from one source being configured to half of them being d6". If you could give an example given your spell attack that would be helpful. But also know that there are weapons like greatswords that do 2d6 damage so whatever you come up with for your 4d6 example would likely affect that too...

Did you mean something like Spell does 4d6. Currently, a crit = (max(4d6) = 24) + 4d6. "New" crit = (max(2d6) = 12) + 6d6?

That would make the damage range as follows:

No extension = 8-48
Current Extension = 28-48
Desired = 18-48

This would affect the greatsword crit as well to be 9-24 instead of 14-24.

Of course, you could always set the option to not max anything before you cast spells like that one and then it would act like no extension.

Raven Darkstone
March 24th, 2020, 01:30
First...Thanks!

Second, by rule, a critical without the extension enabled would deal 4d6 normal damage and 4d6 critical damage, so you'd already be rolling 8d6. :)

That said, I'm not entirely sure I know what you are asking for "multiple die from one source being configured to half of them being d6". If you could give an example given your spell attack that would be helpful. But also know that there are weapons like greatswords that do 2d6 damage so whatever you come up with for your 4d6 example would likely affect that too...

Did you mean something like Spell does 4d6. Currently, a crit = (max(4d6) = 24) + 4d6. "New" crit = (max(2d6) = 12) + 6d6?

That would make the damage range as follows:

No extension = 8-48
Current Extension = 28-48
Desired = 18-48

This would affect the greatsword crit as well to be 9-24 instead of 14-24.

Of course, you could always set the option to not max anything before you cast spells like that one and then it would act like no extension.

My error, I was looking at it wrong. Thanks for the quick response and I still really do like this extension :-)

TheoGeek
March 24th, 2020, 17:56
My error, I was looking at it wrong. Thanks for the quick response and I still really do like this extension :-)

No worries! I like the feedback and am always looking for ways to improve it!

LeoKeros
March 28th, 2020, 19:36
Does this extension work in Unity?

TheoGeek
March 29th, 2020, 02:52
Does this extension work in Unity?

I just did a quick test and it worked for a critical attack. I didn't try all the options though. :)

TheoGeek
April 18th, 2020, 20:57
Just updated (based on a request) with a new option to basically remove critical damage dice entirely if you want.

Description in the first post!

spoonhead
April 19th, 2020, 14:54
I just got this when rolling critical damage, and even though the dice rolled, no results came out in the chat window.

Script Error: [string "scripts/ImprovedCritical.lua"]:217: bad argument #1 to 'ipairs' (table expected, got nil)34008

TheoGeek
April 19th, 2020, 17:24
I just got this when rolling critical damage, and even though the dice rolled, no results came out in the chat window.

Script Error: [string "scripts/ImprovedCritical.lua"]:217: bad argument #1 to 'ipairs' (table expected, got nil)34008

Hmmm, I downloaded that extension from the link in this thread, and started a new campaign with only that extension loaded and did not get that error. I also don't get that error with other extensions loaded. The only thing I could ask you to do is to "unzip" the extension and copy and paste the ImprovedCritical.lua file into a PM to me, and I'll take a look at it as soon as you do!

KyoMibo
April 21st, 2020, 11:46
You sir, are the best!
I have been using this rule for a while now, and I was stressing out how to use it in FGU.

spoonhead
April 21st, 2020, 11:55
Hmmm, I downloaded that extension from the link in this thread, and started a new campaign with only that extension loaded and did not get that error. I also don't get that error with other extensions loaded. The only thing I could ask you to do is to "unzip" the extension and copy and paste the ImprovedCritical.lua file into a PM to me, and I'll take a look at it as soon as you do!

Sorry for not getting back sooner. I rolled the extension back to an earlier version and it seemed to work again. I think it was also conflicting with this extension, https://www.fantasygrounds.com/forums/showthread.php?47946-LAE-ExpandedOptions-v1-1-for-5E

TheoGeek
April 21st, 2020, 19:49
Sorry for not getting back sooner. I rolled the extension back to an earlier version and it seemed to work again. I think it was also conflicting with this extension, https://www.fantasygrounds.com/forums/showthread.php?47946-LAE-ExpandedOptions-v1-1-for-5E

When I get home, I'll try it with that extension. Could you also try using version 2.4 with no other extensions loaded? Thanks!

TheoGeek
April 22nd, 2020, 01:59
Sorry for not getting back sooner. I rolled the extension back to an earlier version and it seemed to work again. I think it was also conflicting with this extension, https://www.fantasygrounds.com/forums/showthread.php?47946-LAE-ExpandedOptions-v1-1-for-5E

It is that extension - apparently, my extension and this one are incompatible. When only these two extensions are loaded, the rRoll structure that my extension gets is completely empty. Not sure where that's happening.

TheoGeek
April 22nd, 2020, 02:39
It is that extension - apparently, my extension and this one are incompatible. When only these two extensions are loaded, the rRoll structure that my extension gets is completely empty. Not sure where that's happening.

OK...I got them to play nice together. I forced a load order so my ImprovedCritical extension loads after the Expanded Options extension. That fixes the crash, but it makes certain options from the Expanded Options extension do nothing (like "Attack Prettifier"), but it won't crash. I'm not sure what other side effects this may have, so I'm not going to upload it until I test it more with other extensions, but if you want a version, you can unzip the .ext file into the "extensions" folder, and edit the extension.xml file and change:


<ruleset>
<name>5E</name>
</ruleset>

to


<ruleset>
<name>5E</name>
</ruleset>
<loadorder>
1
</loadorder>

Thanks!

Broadcast Bard
May 8th, 2020, 04:44
Hmmmm, I am having issues as well

https://i.imgur.com/vNvWLSV.png

https://i.imgur.com/e4VTqX1.png

https://i.imgur.com/yqtOMoN.png

I am trying to figure out which of these ext's isn't playing nice

I tried adding the load order to the .ext, but it didn't work.

rigs19
May 8th, 2020, 04:47
I was having all kinds of problems recently, resolved by uninstalling combat enhancer

Beemanpat
May 8th, 2020, 04:51
Is that pic a showing all the extensions you have loaded?

Broadcast Bard
May 8th, 2020, 04:54
Correct. I am working through them trying to narrow it down.

rigs19
May 8th, 2020, 04:55
Correct. I am working through them trying to narrow it down.

Ahh sorry, if it'd help I can post with my list of installed extensions when I get home

Broadcast Bard
May 8th, 2020, 04:56
Figured it out, its the elemental adept one, which has a similar effect, re-rolling 1s on spells that are elemental in nature.

TheoGeek
May 8th, 2020, 05:04
Interesting. I don't know what those other extensions are doing that causes that table to be "nil" when it gets to me, but I can check it out when I have time.

Here are the extensions I run with all the time (Unity), but I use all those in Classic as well save the font extension), so I know it works with all of these.

Enhanced_Spell_Window
AdvancedEffects
DeathIndicatorEx
5E_Language_Fonts_FR_Wizards
5E Next Level XP Automated and DM XP Edit Only
ImprovedCritical
WeaponHandling
5E_Attunement_Tracker
FG-5E-Enhancer
Font-Open-Sans-FGU
Theme_Simple_Gray
WindowSaverX_v3.4.0

Beemanpat
May 8th, 2020, 05:08
The Kent extensions are very recent. The elemental adept extension actually came out today.

TheoGeek
May 8th, 2020, 05:11
It may be a load order thing? But I can't test it because his extension costs money and I don't want to buy it. I can try to contact Kent and see if he'd loan me a copy to use for debugging mine.

Beemanpat
May 8th, 2020, 05:18
It may be a load order thing? But I can't test it because his extension costs money and I don't want to buy it. I can try to contact Kent and see if he'd loan me a copy to use for debugging mine.

Understood. Thanks TheoGeek.

Broadcast Bard
May 8th, 2020, 05:37
Yeah, I tried the load order fix you posted earlier and it didn't fix it. The Kent extensions are really good, and they have been coming out real quick. I think that one has overlap for whatever reason, putting the reroll 1's thing into place is a pretty similar stomping ground. He has been on the Rob2e discord a lot with all these.

Truthfully, I feel like your mod should just be built in to FG, since modifications to criticals are VERY common house rules, but, meh. I disabled the adept one, because crits that feel like crits make my players happy. And me, when I crit them.

TheoGeek
May 8th, 2020, 05:45
Yeah, I tried the load order fix you posted earlier and it didn't fix it. The Kent extensions are really good, and they have been coming out real quick. I think that one has overlap for whatever reason, putting the reroll 1's thing into place is a pretty similar stomping ground. He has been on the Rob2e discord a lot with all these.

Truthfully, I feel like your mod should just be built in to FG, since modifications to criticals are VERY common house rules, but, meh. I disabled the adept one, because crits that feel like crits make my players happy. And me, when I crit them.

If I get time tomorrow, I could try something. In recent versions of my mod I had to do more than just override the final die roll, I actually had to hijack damage handlers to get information about hte target (for things like critical immunity). I could disable those in a test version for you to test out. If he's rerolling 1's it may be that he also uses the damage handlers. I'll see what I can do.

kentmccullough
May 8th, 2020, 06:01
I’ll be looking at it tomorrow too TheoGeek. Let me know if there’s anything you need from me to help figure it out, I definitely try and make all my extensions play nice with others.

TheoGeek
May 8th, 2020, 06:10
I’ll be looking at it tomorrow too TheoGeek. Let me know if there’s anything you need from me to help figure it out, I definitely try and make all my extensions play nice with others.

Cool. Maybe a place to start is that in my code, I have wrappers around onDamageRoll and onDamage that do modify rRoll and at the very end, call ActionDamage.onDamageRoll or ActionDamage.onDamage.

My init function:



function onInit()
registerOptions();
ActionsManager.registerPostRollHandler("damage", ImprovedCritical_onDamageRollWrapper);
ActionsManager.registerResultHandler("damage", ImprovedCritical_onDamageWrapper);
end


We may be colliding there?

kentmccullough
May 8th, 2020, 06:51
That would be it, here's how I handle this kind of thing...



local onDamageRoll = nil;
local getEffectsByType = nil;

function onInit()

getEffectsByType = EffectManager5E.getEffectsByType;
EffectManager5E.getEffectsByType = customGetEffectsByType;

onDamageRoll = ActionDamage.onDamageRoll;
ActionDamage.onDamageRoll = customOnDamageRoll;

ActionsManager.registerPostRollHandler("damage", ActionDamage.onDamageRoll);
end


I then call the original (stored as a local) from within my custom function. Either before or after, whichever is appropriate.

TheoGeek
May 8th, 2020, 06:56
Cool. I'll try that. I coded my extension a long time ago when I was just learning FG and LUA, and never really went back to fix that stuff. I may need help. :)

kentmccullough
May 8th, 2020, 06:58
Let me know if there's anything you need, we'll make this work :D

TheoGeek
May 8th, 2020, 17:46
Let me know if there's anything you need, we'll make this work :D

We made it work! Thanks kentmccullough!

Try out the new versions of our extensions (Improved Critical's is now 3.0 on the first post of this thread).

Broadcast Bard
May 9th, 2020, 03:03
Just wanted to confirm, it's fixed.

TheoGeek
May 9th, 2020, 03:04
Just wanted to confirm, it's fixed.

Excellent!

Darkrin
June 1st, 2020, 15:41
I didn't read through all 11 pages but I was wondering is the extension able to max the first damage die on a crit and roll the rest? or is that even possible?

Beemanpat
June 1st, 2020, 15:43
If I remember correctly you can max damage die or crit die or both.

Darkrin
June 1st, 2020, 15:48
thank you Beeman

TheoGeek
June 1st, 2020, 16:30
I didn't read through all 11 pages but I was wondering is the extension able to max the first damage die on a crit and roll the rest? or is that even possible?

I'm assuming that you are asking if the extension can do the following:

"If the weapon damage does 2d6, on a crit, can I max 1d6 and roll 3d6?"

If that's what you are asking, then no, it does not do that.

It can do the following:


max weapon normal damage and roll critical damage
roll weapon damage and max critical damage
max both normal and critical damage
ignore critical damage if target is crit immune
ignore critical damage altogether


In 5e, a critical hit doubles the damage dice that are rolled, so a crit with a standard 2d6 damage weapon does 2d6 normal damage and 2d6 critical damage - there isn't really a concept of "the first damage die of a weapon with 2 damage dice", but that's an interesting idea. If that's what you are asking, I can look into it. :)

Darkrin
June 3rd, 2020, 02:12
I got the extension after Beeman answered and tried it out. it does what I was wanting I was assuming most weapons only had one damage(yeah I wasn't thinking it all the way through) die and it would add one to it. to prevent at snake eyes roll and at least do more than the normal damage possible I was wanting one of the die to max the other to roll normally as you pointed out that can be done or you can max both. thank you for your reply, Theo, much appreciated

TheoGeek
June 3rd, 2020, 15:40
to prevent at snake eyes roll and at least do more than the normal damage possible

This is exactly why I wrote that extension. Although as a DM it was kinda hilarious to see someone roll two 1s after a sweet crit, I felt for my players. :) I thought that this was a good balance between guaranteeing at least max normal weapon damage but not automatically doubling the damage.

Thanks for checking the extension out - hope you enjoy it!

kjbrona
June 17th, 2020, 13:24
Half-Orc Brutal Attacks does the following:

When you score a critical hit with a melee weapon attack, you can roll one of the weapon's damage dice one additional time and add it to the extra damage of the critical hit.
In this case the extra damage shouldn't be a part of the critical damage, I would think. With improved critical on, a lvl 1 Orc Barbarian does a minimum of 25 dmg + STR bonus on a crit.
You can fix that by turning off Use Effect Dice and adding an effect (DMG: 1d12 slashing, critical, melee) but then the Rogue doesnt get the extra damage on a sneak attack.
I am just wondering if there is a way to code around this?

TheoGeek
June 17th, 2020, 23:17
Half-Orc Brutal Attacks does the following:

In this case the extra damage shouldn't be a part of the critical damage, I would think. With improved critical on, a lvl 1 Orc Barbarian does a minimum of 25 dmg + STR bonus on a crit.
You can fix that by turning off Use Effect Dice and adding an effect (DMG: 1d12 slashing, critical, melee) but then the Rogue doesnt get the extra damage on a sneak attack.
I am just wondering if there is a way to code around this?

Thanks for the reply!

So, for the case of a half orc with a greatsword, a critical hit should cause this damage:

greatsword regular damage (2d6) + greatsword critical damage (2d6) + extra critical damage (1d6)

The extension gives the following options for raw weapon damage (excluding bonuses for strength, etc.):


No maxxing (2d6 + 2d6 + d6) = 5-30 damage
Max weapon damage (12 + 2d6 + d6) = 15 - 30 damage
Max critical damage (2d6 + 12 + 6) = 20 - 30 damage
Max both (12 + 12 + 6) = 30 damage
Remove critical damage: (2d6) = 2-12 damage
Ignore critical if target immune: (2d6) = 2-12 damage


Some options can be stacked (like 6 and 2 to give 12 damage).

Fantasygrounds considers the extra die from a savage attack as critical damage because it is only rolled on a critical hit, which is consistent with the rules, and makes crit immune characters only take the normal weapon damage of 2d6 (maxxed or not depending on options).

To achieve this, don't add an effect, rather, on the "Actions" tab of the character sheet, there is a magnifying glass next to the "Weapons" heading. Click that, and you'll see a "Extra Crit Dice" section. For melee, make it whatever your bonus is so, for our half-orc example, a 1st level half-orc would put a "1" in the melee box.)

The above example is achieved by setting the extra melee crit dice to 1.

My extension handles it properly then.

Unless there's a bug and you are seeing something different - if so, I'd like to know!

Thanks!
Jeff.

TheoGeek
July 3rd, 2020, 19:38
OK, so I have a really low rent version of exploding dice implemented in a "test" version of this extension. And by "low rent", I mean there are really no bells and whistles - no extra die rolling graphics, etc. The exploded dice are shown in the display of the final roll, and there is some text about the extra damage that resulted, but nothing super awesome.

Would you all like to hammer on it and give feedback? I can upload the "exploding test" version if there is interest.

Thanks!
Jeff.

Broadcast Bard
July 3rd, 2020, 21:05
Oh boy, exploding dice?

TheoGeek
July 3rd, 2020, 21:56
Oh boy, exploding dice?

hehe...yeah

Right now, it's a menu option to enable or disable, and it currently affects both critical and damage dice, but it also obeys the other settings like target critical immunity, maxxing, etc. So, if you have the options set to max normal damage on a critical and also have exploding dice on, then the only way a dice explodes is if the native roll was the maximum for the die type - in other words, maxxing damage does not automatically cause a dice to explode, it must be naturally max before the improved critical overrides it.

kerrigaj
July 8th, 2020, 21:22
Great extension TheoGeek - thanks.

Are you / is anyone aware of an extension that could roll the equivalent of ADVANTAGE dice for damage? E.g. a weapon usually does 1d8 damage - this would roll 2d8dl or ,two-d8 and drop lowest'. There is a feat in the AiME ruleset based on 5E that has this mechanic and I haven't found anyone who has developed anything. Thanks in advance all!

TheoGeek
July 10th, 2020, 20:48
Great extension TheoGeek - thanks.

Are you / is anyone aware of an extension that could roll the equivalent of ADVANTAGE dice for damage? E.g. a weapon usually does 1d8 damage - this would roll 2d8dl or ,two-d8 and drop lowest'. There is a feat in the AiME ruleset based on 5E that has this mechanic and I haven't found anyone who has developed anything. Thanks in advance all!

Sorry, I'm not familiar with an extension that provides that mechanic. Sounds cool though...I might have to check out adding that and renaming this extension to "Improved Damage" :)

jeffreydeman92
July 11th, 2020, 21:56
at the current version of FGU, which i updated today after the latest patch. the dice calculation is not working correctly.
in the first attachment is the manual roll view.
and in the second the result.
if i count the dice it should be a total of 26 dmg, but it only calculates 19.

hope you can help with this problem.
for the rest it is a great extension
37606
37607

TheoGeek
July 11th, 2020, 22:58
at the current version of FGU, which i updated today after the latest patch. the dice calculation is not working correctly.
in the first attachment is the manual roll view.
and in the second the result.
if i count the dice it should be a total of 26 dmg, but it only calculates 19.

hope you can help with this problem.
for the rest it is a great extension
37606
37607

I'll look into it, but it looks right...the damage says "2d6-2 = 10, 2d6 = 9" which means that Fantasygrounds thinks that your attack has a net "-2" modifier. That's not my extension. Are you attacking something that has resistance or does your character have some effect on it that is causing a negative modifier?

jeffreydeman92
July 11th, 2020, 23:05
I'll look into it, but it looks right...the damage says "2d6-2 = 10, 2d6 = 9" which means that Fantasygrounds thinks that your attack has a net "-2" modifier. That's not my extension. Are you attacking something that has resistance or does your character have some effect on it that is causing a negative modifier?

i tried multiple rolls with setting it to a crit, and it looks like the modifier is lowered by the amount that the max weapon damage is increased to set it to max.
there are no effects on the character and no resistances
37608

TheoGeek
July 12th, 2020, 05:13
i tried multiple rolls with setting it to a crit, and it looks like the modifier is lowered by the amount that the max weapon damage is increased to set it to max.
there are no effects on the character and no resistances
37608

No matter what I try, different classes, different weapons, different manual entries, I cannot get that behavior...everything works as expected.

1) Which version of the extension are you using (I downloaded version 3.0 from the first post to test this)?
2) Can you export your character and send it to me?

Thanks!
Jeff.

jeffreydeman92
July 12th, 2020, 12:55
No matter what I try, different classes, different weapons, different manual entries, I cannot get that behavior...everything works as expected.

1) Which version of the extension are you using (I downloaded version 3.0 from the first post to test this)?
2) Can you export your character and send it to me?

Thanks!
Jeff.

i used the 3.0 version, redownloaded it yesterday after i noticed it was calculation wrong.
on classic it works normal, i only have this issue on unity.

also tried to fill in the manual values and than it shows the correct total.
but when using the roll button it is back to the problem

and should have been fixed according FGU.
Updates


[CoreRPG+] Rolls did not always total correctly when replacement values occurred in ruleset code (manual/reroll/max/etc). Fixed.
37628

TheoGeek
July 12th, 2020, 15:02
Ah...thanks for that last bit - I was testing it by manually entering values. But you are right, when rolling the damage, it doesn't compute the damage correctly. Apparently, the Unity code still isn't fixed? I can try to trace it out and find if it's an error in the ruleset code or an error in the way I create the rRoll structure.

TheoGeek
July 12th, 2020, 15:18
I think I found it...I'll upload a modified version of my extension today after church. Looks like FGU does compute damage differently than FGC - it's not an error in the ruleset, it's a change in the value FGU uses.

TheoGeek
July 12th, 2020, 19:24
Thanks for pointing this out. Updated the extension and uploaded it. Linked on the first post!

jeffreydeman92
July 12th, 2020, 21:12
Thanks for pointing this out. Updated the extension and uploaded it. Linked on the first post!

thanks TheoGeek for the quick update. My players and I are very grateful.

TheoGeek
July 12th, 2020, 23:49
thanks TheoGeek for the quick update. My players and I are very grateful.

Anytime! Let me know if you notice any issues.

Eltrym
July 13th, 2020, 01:08
I'm having trouble with critical hits and damage for the half orc champion in our group. It's not recognizing a 19 as a crit for him(improved critical) and it's not applying the extra die of damage for Savage Attack. Both of those worked fine before the last week's update. 37645

TheoGeek
July 13th, 2020, 02:05
I'm having trouble with critical hits and damage for the half orc champion in our group. It's not recognizing a 19 as a crit for him(improved critical) and it's not applying the extra die of damage for Savage Attack. Both of those worked fine before the last week's update. 37645

Hmmm....the only thing I can think of is that you don't have the "Crit on" and the "Extra crit dice" weapons options set right (clicking the magnifying glass circled in red). It's working for me...

37655

Eltrym
July 13th, 2020, 03:09
That’s what it was, somehow it got reset. Thanks!

RedhandJedi
July 27th, 2020, 13:32
I must say, this extension has been fantastic. Thank you for sharing this extension and keeping it updated.

V/R,
RHJ

TheoGeek
August 1st, 2020, 18:19
I must say, this extension has been fantastic. Thank you for sharing this extension and keeping it updated.

V/R,
RHJ

Thanks! I just found something else I need to change as well. Some weapons roll effect dice on a critical (for example, weapons with the "sharpness" attribute), and when this extension has "include effect dice" selected, those extra dice are maxxed as well.

Now, given that the intent of this extension is to max dice on criticals which is not standard 5E, it may be perfectly fine to do this.

Looking into how to address this now, so expect another update soon - like maybe another menu option to treat effects that are added because of a critical hit normally. :)

LordEntrails
August 1st, 2020, 19:08
One of our characters has a thunderous critical. I'm good with maxing the critical die, but I guess that is pushing the damage quite a bit huh? So yea, might be best to add or option, or to default to not having bonus crit damage maximized.

I guess in short, I'm good with any solution :) So, not very helpful!

TheoGeek
August 2nd, 2020, 00:57
One of our characters has a thunderous critical. I'm good with maxing the critical die, but I guess that is pushing the damage quite a bit huh? So yea, might be best to add or option, or to default to not having bonus crit damage maximized.

I guess in short, I'm good with any solution :) So, not very helpful!

hehe...

So apparently the sharpness property doesn't do an extra 4d6 damage...it does an extra 14 damage.

But, this did uncover a potential unintended max damage situation, and I'll look into a fix.

What is the thunderous crit you were talking about? Is it like how I misread the sharpness thing (the extra 4d6 on a crit)?

I started looking into that and I may need to intercept the roll earlier to parse it right. By the time my extension sees the roll, it can't tell what the effect dice are from. Sneak attack, for example, adds effect dice, and should be maxxed by the "include effect dice" option, but if something does extra damage on a critical hit, I don't think that should necessarily be maxxed. Basically, everything that the 5e rules say should be "rolled twice" on a crit, my extension will max if that option is selected.

I'll take any suggestions, and your suggestion counts! :)

LordEntrails
August 2nd, 2020, 04:03
Its a custom weapon, but I think I got it from the an official item, maybe Drawven thrower? Basically when the weapon hits with a crit, it does an extra 1d8 thunder damage. As you know, FG does support it. And thinking about it I don't think it should be maxed on a crit, since it is damage that only happens on a crit anyway.

The rules on sharpness changed, it used to be 4d6 and in an errata it was changed to 14 for some reason. Maybe too many die rolls? Don't know but imo was a poor decision. Personally I would keep it as a die roll rather than a fixed damage, since FG will automate it anyway and an extra roll and doing the addition won't take but milliseconds.

TheoGeek
September 2nd, 2020, 23:37
So, I updated this extension to a new version 4.0 over on the armory. I did that because I simplified some logic, but also added another extension - 5E - Theogeek's Natural 20 (https://www.fantasygrounds.com/forums/showthread.php?61375-5E-Theogeek-s-Natural-20) that required slight modification to this to make it work.

Instead of confusing the issue by updating this thread, I just created two new threads over there, largely because if you get the Nat20 one, you'lll need 4.0 of Improved Critical, but you can use improved critical 4.0 by itself.

Anyway, check it out and report any issues!

And LordEntrails, with the new version 4.0, damage types of "critical" are no longer maxxed since they only roll if the attack is a critical hit. :) That's what 5E expects.

So, pick it up and enjoy!

5E - Theogeek's Improved Critical (4.x) (https://www.fantasygrounds.com/forums/showthread.php?61376-5E-Theogeek-s-Improved-Critical)

EliForge
September 12th, 2020, 21:53
Picked them both up, and all seems right with the world.

toastsniffer187
May 29th, 2021, 15:01
I have used this extension for 3 weeks then update 18 came out for pf2 ruleset and now the extension halfway works. Whats happening is once a critical (nat 20) is rolled and damage is then rolled the damage appears correct in chat box but the creature takes 0 dmg. I have to drag and drop the dmg on the creature. I can include Screen shots if my question requires more elaboration.

TheoGeek
May 29th, 2021, 15:17
I have used this extension for 3 weeks then update 18 came out for pf2 ruleset and now the extension halfway works. Whats happening is once a critical (nat 20) is rolled and damage is then rolled the damage appears correct in chat box but the creature takes 0 dmg. I have to drag and drop the dmg on the creature. I can include Screen shots if my question requires more elaboration.

This extension was written for 5E so I have not tested this for PF2. I can look into it, but I cant make any guarantees since I am not familiar with that ruleset. :)

merkvah
May 7th, 2022, 20:59
Was this problem ever resolved? I'd love to use the extension, but I also cannot get it to work.

TheoGeek
May 7th, 2022, 22:46
hmmm...I think so...this thread is OBE by the way...check out this one: https://www.fantasygrounds.com/forums/showthread.php?61376-5E-Theogeek-s-Improved-Critical (it's now on the forge)

Also, what version shows up in your chat window when you start (the latest is 7.1.8)? I just ran a test in PF2 and it works fine for me, but I only ran it with the Improved Critical extension loaded.

Here's what I got with a critical hit:

52696