Jump to content

Global HealthFix turning Damage into Heal?


nexusgilb

Recommended Posts

Hello,

if not this forum i don't know which spot on the net could help me. I run MGSO, Firemoth, MasterIndex, CastReduce 3.1 by Aragon and the Health Fix mod by Kosta Darjania. Pretty basic because i like to keep things simple. However even that simple mod setup seems to cause some major problems. To be precise it seems to be the fault of that Health Fix mod as it doesn't happen when it's deactivated.

 

Playing as a Breton Atronach i like to summon an Ancestral Ghost to absorb its first 2 spells to replenish my magicka. Now what happens is: if ever that ghost curses me with effect number #23 "damage health" (checked via "tms" in console) i return to almost my max health as calculated by that HealthFix script. At first i didn't notice it but when the complete Caldera Mages Guild turned on me for stealing some s*** and they couldn't finish me off with their spells (i am level FOUR) that behavior got really irritating. However i did not check all the spell effects that were going on in that fight.

 

So i tried to figure it out myself, learning about scripting and all the things that could go wrong, and even the bad Set/ModStat functions, but i could not find any bug in that health script that would cause such an error. So why do i get healed if i should receive magical damage?

 

The health script by costa:

begin health_fix

short kdlvl
short kdend
short kddmg
short kdchp
short kdmhp

if ( ( player -> getendurance ) == kdend )
if ( ( player -> getlevel ) == kdlvl  )
return
endif
endif

if ( ( player -> gethealthgetratio ) == 0 )
return
endif

set kdend to ( player -> getendurance )
set kdlvl to ( player -> getlevel )
set kdchp to ( player -> gethealth )
set kdmhp to ( kdchp / ( player -> gethealthgetratio ) )
set kddmg to ( kdchp - kdmhp )
set kdmhp to ( ( kdend + kdlvl ) * 2 )
player -> sethealth, kdmhp
player -> modcurrenthealth, kddmg

end
Edited by nexusgilb
Link to comment
Share on other sites

 

Hello,

if not this forum i don't know which spot on the net could help me.

You could try the official Bethesda forums :tongue:

 

Anyways, I had used Health Fix mod and it worked perfectly for me. :ermm: From the script, health shouldn't get updated unless Strength or Endurance change. But it looks like its updating every frame for you.

 

To check it change the script to

begin health_fix

short kdlvl
short kdend
short kddmg
short kdchp
short kdmhp

if ( ( player -> getendurance ) == kdend )
if ( ( player -> getlevel ) == kdlvl )
return
endif
endif

if ( ( player -> gethealthgetratio ) == 0 )
return
endif

MessageBox "This message shouldn't appear unless STR or END changes"

set kdend to ( player -> getendurance )
set kdlvl to ( player -> getlevel )
set kdchp to ( player -> gethealth )
set kdmhp to ( kdchp / ( player -> gethealthgetratio ) )
set kddmg to ( kdchp - kdmhp )
set kdmhp to ( ( kdend + kdlvl ) * 2 )
player -> sethealth, kdmhp
player -> modcurrenthealth, kddmg

end

This notifies when the health calculation occurs, so you can be sure of the problem.

Link to comment
Share on other sites

Yeah endurance changes in that case because the Ghost definitely (and the Mages in the guild may be) cast "Drain Endurance" 5 points on you. With natural magic resistance that makes -3 and my max health goes from 100 to 94, all correct.

 

So i start the fight with 50 of 100 max health.

Ghost curses me (Endurance -3) and health changes to 44 of 94.

Next curse might be Drain Fatigue, all good.

Then the Damage Health curse brings me up between 87 and full 94 health.

I kill of the ghost, endurance restores, and i am some around 95 of 100 health.

 

The endurance calculations are exactly as i would expect them from the script. However i still can't find the bug.

I looked if the healing end result had do do something with the Damage Health value, but i got (-4) 90 of 94 health from a -3 health damage. (could be a rounding issue though)

 

Can i remove my natural magic resistance via console or something else to narrow it down even further?

Also the effect #23 was shown in "tms" a couple of times for that 1 second duration. Always with a negative modifier, but i don't know what that means.

 

(Oh and sorry i forgot to mention i also run "Linoras Leveling Mod 2.0 Medium" however i don't think that matters.)

Link to comment
Share on other sites

Hiya, sorry for the absence, was busy slaughtering chocolate bunnies the last days.
So here my load order:

 

 

_001_ Morrowind.esm
_002_ Tribunal.esm
_003_ Bloodmoon.esm
_004_ Texture Fix - Bloodmoon 1.1.esm
_005_ Morrowind Patch 1.6.5 Beta (BTB Edit).esm
_006_ Poorly Placed Object Fix 1.2.esm
_007_ Texture Fix 2.0.esm
_008_ master_index.esp
_009_ Siege at Firemoth.esp
_010_ SirLuthor-Tools.esp
_011_ Unique Banners and Signs.esp
_012_ Better Bodies.esp
_013_ Windows Glow.esp
_014_ Key Replacer Trib & BM.esp
_015_ JEB_muffin_fix.esp
_016_ Barabus' fireplaces 2.esp
_017_ Windows Glow - Tribunal Eng.esp
_018_ Windows Glow - Bloodmoon Eng.esp
_019_ Syc_HerbalismforPurists.esp
_020_ Syc_HerbalismforPurists_BM.esp
_021_ Syc_HerbalismforPurists_TB.esp
_022_ Windows Glow - Raven Rock Eng.esp
_023_ WA_Signy_Signposts(!).ESP
_024_ Better Skulls.ESP
_025_ Particle Arrow Replacer.esp
_026_ Psy_VGR_Armour.esp
_027_ MA_snowprincetomb_v3.esp
_028_ Better Clothes_v1.1.esp
_029_ abotWindowsGlow.esp
_030_ Statue Replacer - Normal.esp
_031_ bones.esp
_032_ Shieldfx.esp
_033_ Book Jackets - Morrowind.esp
_034_ Book Jackets - Tribunal.esp
_035_ Book Jackets - Bloodmoon.esp
_036_ NewBlood_MwTbBm1.1.esp
_037_ Neo's Unique Creatures.esp
_038_ BetterClothesForTB.esp
_039_ ExcellentMagicSounds.esp
_040_ correctUV Ore Replacer 1.0.esp
_041_ llm-medium.esp
_042_ Bloated Caves.esp

 

*here the HealthFix is loaded if i was activated when i copy pasted it

 

_043_ almalexia armor.esp
_044_ Psy_UniqueDremora_T.esp
_045_ Golden Gold.esp
_046_ Vurt's Grazelands Trees.esp
_047_ AtmosphericSoundEffects-3.0-Tribunal.esp
_048_ More Better Clothes.ESP
_049_ Animated Morrowind.esp
_050_ New Voices.esp
_051_ Sleepers, Awake!.esp
_052_ LeftGloves_Addon_v2.esp
_053_ guarskin_drum_replacer.esp
_054_ UniqueFinery.esp
_055_ Unique Jewelry and Accessories.esp
_056_ TLM - Complete.esp
_057_ New Bodies - Mature.esp
_058_ Clean MCFC_1.0.esp
_059_ imperial chain fix.esp
_060_ UF_HortRobeF001.esp
_061_ Better_Sounds.esp
_062_ Female Armor - Complete.esp
_063_ Better Weapons and Armors.esp
_064_ OTR_Coast_Variety.esp
_065_ STA_guides_replacer.esp
_066_ CastReduce-v31.esp

99% of these mods is from Morrowind Overhaul and they installed with their load order rules i suppose.

I changed "Graphical Herbalism" to "sycs herbalism for purists" but left the bloated caves.

I tried out GCDlean and Horatios casting but removed them again without problems. GCD was even in another save file.

CastReduce is at the end because i modified it to my needs, however that just affects mana.

Link to comment
Share on other sites

Ok, i did some more testing, deactivated ALL the mods but Health Fix. MGSO is still running though.

 

The behavior occurs exactly the moment that "Drain Endurance" and "Damage Health" are cast at the same time. May be that is the reason why you didn't notice something?

Edited by nexusgilb
Link to comment
Share on other sites

(my response to some message box advise from the bethesda forums)

 

Thx, that was helping, at least i am one tiny step closer.

 

So i added a message box after each of the last 3 set commands that displays the concerning variable value.

Because they don't fade away once my endurance is drained i conclude the the COMPLETE script is running every frame for the curse duration.

Furthermore, whenever that ghost pokes me with his fingers (physical damage) the first calculated max HP flickers down for an instant before showing the same value as the last calculated.

 

That makes me wonder if that division by health ratio line is even necessary ......................

 

I didn't finish that thought. Instead i turned all the "short" variables into "floats". No idea why, but the calculation engine seems to like them better. It works fine now. Just got a rounding error of 1 but that's negligible.

Even the message boxes are not shown throughout the curse duration meaning the script doesn't run completely every frame. Just as it is supposed to. HOORAY! http://static.zenimax.com/forums.bethsoft.com/public/style_emoticons/default/smile.png

 

(however that doesn't explain why you could not reproduce the bug or could it be a hardware thing, or why nobody ever wrote about such bug with that mod before)

Link to comment
Share on other sites

  • 2 months later...

 

I didn't finish that thought. Instead i turned all the "short" variables into "floats". No idea why, but the calculation engine seems to like them better. It works fine now. Just got a rounding error of 1 but that's negligible.

Even the message boxes are not shown throughout the curse duration meaning the script doesn't run completely every frame. Just as it is supposed to. HOORAY! http://static.zenimax.com/forums.bethsoft.com/public/style_emoticons/default/smile.png

 

(however that doesn't explain why you could not reproduce the bug or could it be a hardware thing, or why nobody ever wrote about such bug with that mod before)

Any time your dealing with values that go into decimals or player stat values you should be using floats. Shorts are only good for script control and global triggers. The only time its any different is if your dealing with something like VBScript or some high level scripting language.

Edited by Skibidyboparoobopadopa
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...