Facjad
November 2nd, 2025, 01:09
Hello,
I learned just now by searching in the code that the bonus critical damage for weapons in 4E are actually parsed by the system when added to a character sheet. The problem is that the field needs to end with "critical damage". It so happens that the items in the 4E compendium do not contain the keyword "critical", so that that field is always ignored by the system.
I think it would improve QoL of 4E users to just change the following on line 781 of manager_char.lua :
local nStarts, nEnds, sDice, sDmgType = string.find(sCritical, "%+(%d[d%+%d%s]*)%s?(%a*)%scritical%sdamage");
instead, use something like :
local nStarts, nEnds, sDice, sDmgType = string.find(sCritical, "%+?(%d[d%+%d%s]*)%s?(%a-)%s?c?r?i?t?i?c?a?l?%sdamage");
In other words, make the " critical" optional, and also the "+" at the beginning while we're at it.
This would make the system a lot more flexible.
Thanks in advance !
Edit: in hindsight, %s?c?r?i?t?i?c?a?l? is probably a bad idea, but (%scritical)? didn't work, I'm not very well versed in lua regexp...
I learned just now by searching in the code that the bonus critical damage for weapons in 4E are actually parsed by the system when added to a character sheet. The problem is that the field needs to end with "critical damage". It so happens that the items in the 4E compendium do not contain the keyword "critical", so that that field is always ignored by the system.
I think it would improve QoL of 4E users to just change the following on line 781 of manager_char.lua :
local nStarts, nEnds, sDice, sDmgType = string.find(sCritical, "%+(%d[d%+%d%s]*)%s?(%a*)%scritical%sdamage");
instead, use something like :
local nStarts, nEnds, sDice, sDmgType = string.find(sCritical, "%+?(%d[d%+%d%s]*)%s?(%a-)%s?c?r?i?t?i?c?a?l?%sdamage");
In other words, make the " critical" optional, and also the "+" at the beginning while we're at it.
This would make the system a lot more flexible.
Thanks in advance !
Edit: in hindsight, %s?c?r?i?t?i?c?a?l? is probably a bad idea, but (%scritical)? didn't work, I'm not very well versed in lua regexp...