PDA

View Full Version : Strain-Injury HP Variant Extension



darrenan
October 9th, 2015, 23:29
This extension modifies the base 3.5/PF ruleset to support the Strain-Injury HP Variant rules. You can find these rules at either of the following links:

https://paizo.com/threads/rzs2njly?StrainInjury-Variant-A-Minor-Change-to-Hit
https://docs.google.com/document/d/1Jcp6udyHU-cURn5u7MzunsOfrCruk0ywDkvmdVk0fGQ/edit

This extension handles everything in these rules automatically, with one exception, failed saving throws. Since the ruleset does not establish any connection between saving throws rolled via the Cast button, and any subsequent damage roll, a little manual user intervention is required in this case. On the modifiers window you will find a new "Injury" button, which you should click before rolling the damage against any targetted creatures that failed their save.

Version History
0.1 10/09/2015 Initial Release
0.2 10/11/2015 Fixed compatibility issue with the RemoveEffectTag extension. Fixed bug where FHEAL and REGEN wouldn't work if the target only had Injury damage.
1.0 11/04/2015 Updated for 3.1.3 release of FG.
1.1 11/04/2015 Token dot/bar health indicators are now colored correctly. Previously, changes to the injury field did not trigger updating.
1.2 02/27/2016 Updated for 3.1.6. Removed nonlethal damage, strain is now equivalent to nonlethal. Merged in some ruleset changes that were being overwritten.
1.3 07/23/2016 Updated for 3.2.0.
1.3.1 11/04/2016 A few more changes for the final release of 3.2.0. Should be completely 3.2.0 compatible now.
1.3.2 11/15/2016 Fix Modifier Window Title String Resource.
1.3.3 01/14/2017 3.2.2 compatibility changes.
1.4.0 04/14/2017 3.3.0 compatibility changes.
1.5.0 09/19/2017 3.3.2 compatibility changes
1.5.1 09/25/2017 3.3.2 client CT compatibility changes.
1.5.2 09/27/2017 Apparently FG doesn't like '--' comments in <script> blocks. Removed them so that updateHealthDisplay is defined once again.
1.5.3 10/15/2017 Fix script error when checking for existence of "Stable" effect.
1.6 4/28/2018 3.3.5 compatibility changes.
1.7 7/25/2018 Fix token health dot/bar color issue.
1.8 8/3/2018 3.3.6 compatibility changes.
1.9 11/26/2018 3.3.7 compatibility changes.
1.10 12/19/2018 Fix health bar discrepancies in party sheet.
1.10.1 12/19/2018 Fix client CT script errors and UI layout problems.
1.20 1/13/2019 Damage taken as a result of a failed saving throw is now injury damage.
1.22 7/23/2019 3.3.8 compatibility changes.

darrenan
October 9th, 2015, 23:30
1.20 for 3.3.7: 28045

1.22 for 3.3.8: 28044

darrenan
October 9th, 2015, 23:37
List of ruleset files modified:
campaign\record_char_main.xml
campaign\record_charmini_main.xml
campaign\scripts\char_main.lua
ct\ct_client.xml
ct\ct_host.xml
ct\template_ct.xml
ct\scripts\ct_entry.lua
ct\scripts\ctclient_entry.lua
ps\ps_main.xml
ps\scripts\manager_ps2.lua
ps\scripts\ps_mainitem.lua
scripts\manager_action_damage.lua
scripts\manager_actor2.lua
scripts\manager_combat2.lua
scripts\manager_gamesystem.lua
utility\utility_modifiers.xml

Ruleset files added:
extension.xml
campaign\template_charinjury.lua
scripts\manager_effect2.lua
strings\strings_35e_2.xml

darrenan
October 9th, 2015, 23:37
Reserved

Old Man Trouble
October 10th, 2015, 21:02
Will be trying this out tomorrow. I'll let you know how it goes.

Edit: The strain/injury portion of the mod seemed to work as intended. However, version 1.1.2 of Remove Effect Tag ceased to function. Also, damage in the Injury column did not heal on overnight rest.

I also had some masks removed from my maps, but I was not able to replicate this error. It may have just been a random fluctuation of the universe.

darrenan
October 12th, 2015, 01:54
According to what I read, Injury is not supposed to heal on an overnight rest. Here's the quote from the doc that leads me to believe this:


The Heal skill
Injuries don’t heal on their own. Unlike the original Hit Point rule, you can’t just sleep off a gut-slash or a second-degree burn in a few days. You need medical attention to heal Injuries, be it a use of the Heal skill or magical healing. In many situations, characters are going to see much greater value in the Heal skill now that splinting their own broken leg is a need that might arise.


Of course there are some other variants proposed in that thread on the Paizo forums (a Fort save lets you heal injuries while resting for instance).

Adding settings for this extension is an option, but not sure when I would get to it.

Nickademus
October 12th, 2015, 02:10
Need to splice the block of code from the Remove extension into the manager_effect.lua file. It's a single piece of code with tagged beginnings and ends. Shouldn't be hard to incorporate into this extension.

darrenan
October 12th, 2015, 03:09
Trenloe helped me fix the Remove Effect issue in a way that didn't require duplicating the code for that extension in mine. Also found and fixed a bug where FHEAL and REGEN wouldn't work if the target only had Injury damage. Version 0.2 has been uploaded.

lachancery
October 13th, 2015, 16:36
I also had some masks removed from my maps, but I was not able to replicate this error. It may have just been a random fluctuation of the universe.

I've experienced this behavior with masks applied to maps coming from adventure modules, and that adventure module gets updated. It seems to break the link between the map and the mask.

darrenan
November 5th, 2015, 03:23
Updated to version 1.0 for 3.1.3.

...and uploaded version 1.1 which fixes token health bar/dot coloring.

darrenan
February 27th, 2016, 18:13
Updated to version 1.2 for 3.1.6. The extension was applying nonlethal damage incorrectly. According to the Strain-Injury document, nonlethal damage is applied to Strain and not tracked separately, but is never applied to Injury. When at zero Strain, any subsequent nonlethal damage does not change Strain or Injury. The way I read it, this is the correct behavior, and the extension now obeys this rule. Nonlethal number controls have been removed entirely from the character sheet, character mini, and combat tracker.

Hit point coloration requires a little explanation though. According to the Strain-Injury document, when nonlethal puts you down to zero Strain you are supposed to go unconscious which should show Strain and Injury as purple. However, because of the way the ruleset is structured, at the point that the status and color are determined there isn't any way to tell how the target got to zero Strain (nonlethal vs. normal). Thus, you will no longer see the purple coloration of Strain and Injury when dropped to zero by nonlethal damage. Dropping Strain to zero will be treated as Disabled, regardless of how it happens, and the color will be red. Likewise, if your Strain+Injury drops you below zero HP the coloration will be grey, regardless of how it happened. GMs should be aware of this behavior and manually apply unconsciousness and prone in this case.

I also merged in some ruleset changes to affected files since the last drop of this extension.

darrenan
July 23rd, 2016, 19:45
Version 1.3 for 3.2.0.

darrenan
November 5th, 2016, 06:42
I found a few more differences in the final release of 3.2.0, which have been fixed in version 1.3.1. Should be fully 3.2.0 compatible now.

Gwaihir Scout
November 6th, 2016, 04:38
Thanks.

darrenan
November 16th, 2016, 03:08
Version 1.3.2 fixes a minor discrepancy with the Modifiers Windows Title Bar String resource identifier for the FG 3.2.1 release. Download from Post #2 above.

darrenan
January 15th, 2017, 04:39
Version 1.3.3 updates a couple files to be compatible with 3.2.2. Download from Post #2 above.

darrenan
April 14th, 2017, 23:00
Required update to version 1.4.0 to be compatible with FG 3.3.0 update. Download from Post #2 above.

dellanx
September 20th, 2017, 01:41
I had problems with Strain & Injury extension in RFPG FG update V.3.3.2.

Thanks!

darrenan
September 20th, 2017, 04:47
Version 1.5.0 for 3.3.2 compatibility attached to post #2 above.

dellanx
September 21st, 2017, 03:32
Version 1.5.0 for 3.3.2 compatibility attached to post #2 above.

Wonderfull!

darrenan
September 25th, 2017, 06:33
The client-side CT functionality is still broken, working on a fix...

darrenan
September 25th, 2017, 06:56
I might need an assist. Now that combattracker_client has merge="join" on it, I can't figure out how to change the ordering of the labels and the client_ct_entry controls. I've been trying to figure this out for a couple hours now, and I guess I just don't understand how the merge stuff works. If someone could pop open the extension and look at ct_client.xml and clientct_entry.lua and give me a hint, I would really appreciate it.

For the column labels, what's currently in the extension seems to produce a union of what's in 3.5 and what's in my extension, which I assume is the default join behavior. The two problems are 1) getting the Injury label to appear at the right instead of next to Order, and 2) removing the nonlethal label.

When I tried to do 2) with merge="delete" it seems that the label is implicitly referenced somehow? I got script errors saying it was nil, but when I searched the 3.5 ruleset I didn't really find any other references to it.

I couldn't figure out any way to do 1), neither merge="add" or merge="resetandadd" seemed to make any difference.

Nickademus
September 25th, 2017, 08:02
The 'merge="join"' means that it is making changes to the same windowclass in the CoreRPG ruleset. That's where you'll find the controls and code you are looking for.

darrenan
September 25th, 2017, 16:11
That part I understand, I wasn't looking for the windowclass in corerpg. I'm asking how to correctly change/override it to match the previous functionality of this extension.

darrenan
September 25th, 2017, 16:16
Maybe my confusion is coming from the interaction between merge semantics and how extensions operate. I thought that extensions simply replaced entire ruleset files all-up i.e. no layering. But that doesn't seem to be the case. When replacing a windowclass that already has a merge on it, is it then doing another merge as part of applying the extension?

Moon Wizard
September 25th, 2017, 17:50
Extensions are really just another layer, so they work almost identically to the ruleset layers.

Since multiple ruleset layers and extensions can all use the same file names, you can't just replace files wholesale. You actually need to re-specify the asset tags for which ones you are trying to change. Even if you are just overriding a script file, you have to update the asset tags. Asset tags include global scripts, window classes, templates, fonts, icons, frames, ...

For window classes, you can use no merge tag (to replace fully), merge="join" (to modify in place) or merge="delete" (to remove). When using "join", scripts are nested (like templates), and controls within sheetdata tag are matched by tag name and name attribute.
For all the other assets, you can only replace.

Hope that helps,
JPG

darrenan
September 25th, 2017, 19:49
Ok, so in the 3.5 ruleset, the combattracker_client windowclass is defined in CoreRPG, and then 3.5 merges in some additional elements using merge="join". What I want to do is replace/overwrite the stuff that 3.5 joined in. That would be a skip-join for lack of a better term i.e. join my new windowclass with the one in CoreRPG, and bypassing the 3.5 stuff. Is that even possible?

It also seems very hard to insert elements in a particular place. In this case, the definitions of the labels and controls in combattracker_client and client_ct_entry are very order-dependent and I'm having trouble figuring out how to get my new Injury label and control to render in the right location relative to the other ones.

What happens if I define windowclass combattracker_client in my extension with no merge attribute (where the corresponding 3.5 element has merge="join")? Does it replace everything from CoreRPG and 3.5? I'm beginning to think that doing a hand-merge of those two windowclasses from CoreRPG and 3.5, then applying my changes, is the only way I'm going to be able to get back to my previous functionality.

darrenan
September 25th, 2017, 21:01
Is it intentional that the client CT is using the CoreRPG string "Order" instead of the 3.5 string "Init"?

Trenloe
September 25th, 2017, 21:39
It also seems very hard to insert elements in a particular place.
This is something I sent to Dulux Oz over a year ago:


So… looking at the 3.5E ruleset, there’s a new field I’ve never seen before:

<button_checkbox name="showonminisheet" insertbefore="carried">

So, it can be done. Here’s the new merge windowclass just to add one button before the carried control:

<windowclass name="char_invitem" merge="join">
<sheetdata>
<button_checkbox name="showonminisheet" insertbefore="carried">
<anchored width="12" height="12">
<top offset="6" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<default>1</default>
</button_checkbox>
</sheetdata>
</windowclass>

Awesome! That will make relative anchoring through templates/merging a lot easier. ��
Sorry that is just a contextless copy/paste from our discussion - I'm super busy at the moment. But the insertbefore tag should help to add new controls.

darrenan
September 25th, 2017, 21:47
Thanks Trenloe. I had glossed over all the usages of insertbefore thinking they were related to screen layout/positioning, then, lightbulb...

Unfortunately, the embedded scripts in ct_client.xml means I need to do a complete replace on the windowclass anyway. Even if I add a new version of the problematic function, the old one still exists as a super and references the inexistent control causing script errors. So, I'm doing the hand-merge of combattracker_client and client_ct_entry and completely replacing both of them. It's going to make forward compatibility a bear, but I don't see any other way around it.

darrenan
September 25th, 2017, 22:37
Ok, finally fixed. New version is attached to Post #2.

Gwaihir Scout
September 27th, 2017, 04:26
My players were still getting errors tonight. Unfortunately, I forgot to ask them to copy the messages. It seemed to be the same problem with the combat tracker. They got errors when they opened it and it didn't look right. Might be a collision with another extension, but I don't have time to experiment.

darrenan
September 27th, 2017, 06:37
Send me a list of the extensions you're running and I'll try to reproduce it.

RobboNJ69
September 28th, 2017, 03:45
Fantastic Extension! Thank you for all the work.

Is there any way to force (or trick, cajole, bribe, etc) "drag & drop" damage to be injury instead of strain (in the CT)? I know I can type a damage number into the Injury field, but is there any keyboard shortcut - like dropping healing?

Thanks again for the extension!

darrenan
September 28th, 2017, 05:02
I added an Injury button to the Modifiers dialog box. Trying clicking that before dragging, might work, I haven't tried it.

darrenan
September 28th, 2017, 06:10
New version in post #2 which fixes scripting bug.

Is it a known issue that '--' LUA comments are not allowed in windowclass <script> blocks? I added some after I got the previous fix figured out, which caused updateHealthDisplay() to no longer be defined. Maybe it's an end-of-line character issue? Anyway, didn't expect that.

RobboNJ69
September 28th, 2017, 13:17
Darrenan - Thanks! The Injury button does work. So does using the Critical button in the Modifiers box. I didn't even think of trying that.

Moon Wizard
September 28th, 2017, 17:20
Yes, the Lua comment issue in window classes is a known limitation of entering Lua code in an XML document.
In those cases, you can use "--[[" to start a comment, and "]]" to end a comment.

Cheers,
JPG

darrenan
October 16th, 2017, 05:02
Fixed a script error that popped up when checking for the existence of a "Stable" effect. Version 1.5.3 can be downloaded from post #2.

paladiusdarkhelm
January 17th, 2018, 17:17
Hi, darrenan.

If the GM enables this extension and the GM or players add numbers to stain and/or injury to try and use this capability, and then the GM or players open the combat tracker or main-front sheet of most character tabs, it seems to start a chain reaction of scripting errors that pop up in the GM console. Example:

Script Error: [string "scripts/manager_token2.lua"]:175: attempt to call field 'getPercentWounded2' (a nil value)
Script Error: [string "scripts/manager_token2.lua"]:175: attempt to call field 'getPercentWounded2' (a nil value)

Do you know if this is something we are doing wrong in trying to use it or if this is a bug relating to the extension.

darrenan
January 17th, 2018, 17:33
It's probably a conflict with another extension. Can you try this in a new campaign with just the Strain/Injury extension loaded to verify?

paladiusdarkhelm
January 17th, 2018, 18:05
It's probably a conflict with another extension. Can you try this in a new campaign with just the Strain/Injury extension loaded to verify?

OK. I'll give that a try.

paladiusdarkhelm
January 17th, 2018, 18:16
OK. I'll give that a try.

You are right. It doesn't seem to cause an issue with a new campaign, a newly imported character into that new campaign, and your extension running.

I do notice that when we don't populate any information into the strain/injury boxes in the campaign experiencing the issue, it does not cause the console errors. I guess at this point, I could try systematically removing other extensions 1 at a time to see if I can figure out which is causing it.

paladiusdarkhelm
January 17th, 2018, 18:52
Found my issue and adding it for anyone else's reference in case what I learned is helpful to anyone else. I posted about it here (https://www.fantasygrounds.com/forums/showthread.php?41968-3-5-Campaign-Players-amp-GM-select-character-inventory-amp-get-script-error-pop-up&p=372178#post372178) in this thread as I thought an inventory issue I was also seeing was different. They both mapped back to the same extensions running that should not have been enabled. Thanks!

darrenan
April 28th, 2018, 23:24
Version 1.6 of this extension is now linked to post #2. This version addresses compatibility issues with v3.3.5 of FG.

darrenan
July 26th, 2018, 07:09
Version 1.7 of this extension is now linked to post #2. This version fixes an issue with the token health dot/bar color not updating correctly to match CT and current health levels.

Blackfoot
August 1st, 2018, 15:25
I think you'll find that there's an issue with this extension in the new rev.
I'm having the same problem in my Champions ruleset... please let me know if you figure out how to solve it before I do... I will do likewise.
Something is screwing up one of the main anchor points for the PCs.

darrenan
August 4th, 2018, 06:03
Version 1.8 of this extension is now linked to post #2. This version addresses compatibility issues with v3.3.6 of FG.

darrenan
November 26th, 2018, 21:49
Version 1.9 of this extension is now linked to post #2. This version addresses compatibility issues with v3.3.7 of FG. Can be used in the test channel until 3.3.7 is officially released.

Kelrugem
December 19th, 2018, 06:15
Hi :)

Thanks for your extension :) I just realized some very very little "issue"/aesthetical thing: On the Main Tab of the Party Sheet is the HP minus the Strain damage displayed as health bar but not HP minus (Strain and Injury) :) But that is of course not really important and not really a bug, but I was not sure if you wanted it differently or not :)

Best,

Kelrugem

EDIT:Also some other extremely little "issue": In the CT the colours of the Strain and Injury do not fit always. When the damage is exactly the amount of the hit points then the colour is purple, e.g. HP: 50 and Strain: 50, then the strain damage is purple. But when there is at least one Injury damage then it stays red as for heavy wounds, so Injury: 50 or Strain:49 and Inury:1 etc. do not give the "correct"/usual colour :) But that is also really not important, just something I saw :D
I really like your extension, thanks :)

darrenan
December 19th, 2018, 19:22
It's possible there were some other changes to the 3.5E or PF rulesets after I updated this extension to work with 3.3.7. I'll check again and if I find anything amiss I'll push another version. Thanks for the report.

UPDATE: The party sheet health bar issue reproduces for me as well, with just my extension loaded. I'll try to get a fix out for that today. For the second issue, what I see is that the color remains red even when strain+injury == HP, which is incorrect, it should be purple at that point. I only see purple if 100% of the damage is strain. That seems different from your description?

Kelrugem
December 19th, 2018, 19:23
Thank you :)

darrenan
December 19th, 2018, 21:14
Party Sheet issues fixed. Version 1.10 is now attached to post #2 above.

Kelrugem
December 19th, 2018, 21:16
Cool, thank you very much :)

Oh, I just saw your EDIT in the post before; what you've described was also exactly what I have observed :) (about the purple colour problem; so when there is at least one injury damage then purple does not arise)

Thanks for the fix https://www.fantasygrounds.com/forums/images/smilies/smile.png I just checked, the party sheet works now :)

Kelrugem
December 20th, 2018, 00:19
Oh, now I've found a major issue. I attached a picture which is taken from the player view. When a player opens the combat tracker then these errors in the console log are showing up and you can also see that the terms "HP, Strain" etc. are not on their correct position in the CT :)

25662

darrenan
December 20th, 2018, 05:15
v1.10.1 which fixes client-side CT script errors and layout problems is now attached to post #2.

Kelrugem
December 20th, 2018, 05:31
Wow, thank you very much for this quick fix :) I can confirm that it works now again :)

damned
December 20th, 2018, 13:13
Im here shilling for my Scammy Loan Business (https://maybeloan.com/installment-loans/nd-usa-il)

Bye bye.

Trenloe
December 20th, 2018, 17:35
Bye bye.
But you've left the scammy loan business link! :/

Blackfoot
December 20th, 2018, 18:51
Damn. What's with all the spammers today?

darrenan
January 13th, 2019, 22:47
Version 1.20 is now linked to post #2 above. This version applies damage from failed saving throws as injury, per the Strain-Injury rules. (took me long enough, right?)

Kelrugem
January 13th, 2019, 22:56
Version 1.20 is now linked to post #2 above. This version applies damage from failed saving throws as injury, per the Strain-Injury rules. (took me long enough, right?)

Wow, that is awesome! :D Thank you very much :)

Kelrugem
May 7th, 2019, 08:47
Hi :)

I just realised that in 3.5e the effect regeneration does not work anymore when StrainInjury.ext is loaded, but in Pathfinder it is working fine :) (I tried it also without any other extension or modifications)

Kelrugem
May 7th, 2019, 22:19
But as a workaround one can replace it with fast healing in the effects because the special way how it works (in 3.5) is gone in the Strain and Injury rules :) So nothing important :)

darrenan
July 23rd, 2019, 21:34
Version 1.22 is now linked to post #2 above. This brings the extension into compatibility with FG v3.3.8.

Kelrugem
July 23rd, 2019, 23:44
Version 1.22 is now linked to post #2 above. This brings the extension into compatibility with FG v3.3.8.

Thank you :)

darrenan
July 24th, 2019, 00:08
Since 3.3.8 is not actually Live yet, I have reinstated the link for version 1.20 for use with 3.3.7. Both of them are now in post #2.

darrenan
August 7th, 2019, 23:13
Going forward, @Kelrugem will be maintaining this extension, as well as all of his different flavors of extensions that add additional functionality on top of this extension. The two versions linked in post #2 will be the final versions that I will be providing.

@Kelrugem: if you would be so kind as to post links to the new versions here I would very much appreciate it.

Kelrugem
August 7th, 2019, 23:49
Going forward, @Kelrugem will be maintaining this extension, as well as all of his different flavors of extensions that add additional functionality on top of this extension. The two versions linked in post #2 will be the final versions that I will be providing.

@Kelrugem: if you would be so kind as to post links to the new versions here I would very much appreciate it.

Thank you very much for your extension and that I am allowed to maintain it :)

The versions of StrainInjury with additional things can be found here (just updated them all due to updates in the extension save versus tags): https://www.fantasygrounds.com/forums/showthread.php?50121-StrainInjury-packages

There (in the second post probably) I will then also upload the single StrainInjury extension, especially when future updates lead to an updated StrainInjury extension :)