Jump to content

Photo

My Umbra Bug

Bug Umbra

  • Please log in to reply
16 replies to this topic

#1
ququq

ququq
  • Newbie
  • Layman
  • Joined: 25-March 13
  • 4 posts

As soon as i kill Umbra i get a constant stream of "Your journal has been updated." notifications.

 

A Screenshot:

_imageshack.us/photo/my-images/818/gxbe.jpg_

 

Here is my loadorder:

 

[spoiler] Morrowind.esm=1
Tribunal.esm=1
Bloodmoon.esm=1
Morrowind Patch 1.6.5 Beta (BTB Edit).esm=1
DB_Attack_Mod.esp=1
Clean_bloodmoonpatch_05.esp=1
Syc_HerbalismforPurists (Pearl Bug Edit).esp=1
Syc_HerbalismforPurists_TB.esp=1
Syc_HerbalismforPurists_BM.esp=1
Clean UMPP-fixes-BTB-v2.esp=1
arvisrend - fixes - books.ESP=1
arvisrend - fixes - scripts.ESP=1
arvisrend - fixes - dialogue.ESP=1
arvisrend - fixes - objects.ESP=1
arvisrend - fixes - dren plantation.ESP=1
arvisrend - fixes - persistent corpses.ESP=1
LGNPC_NoLore_v0_83.esp=1
Lgnpc_SN.esp=1
LGNPC_Pelagiad_v1_31.esp=1
LGNPC_HlaOad_v1_32.esp=1
LGNPC_VivecFQ_v2_20.esp=1
LGNPC_VivecRedoran_v1_61.esp=1
LGNPC_Aldruhn_v1_20.esp=1
LGNPC_Aldruhn_v1_22_suppl.esp=1
LGNPC_PaxRedoran_v1_20.esp=1
LGNPC_SoulSicknessPatch_v1_00.esp=1
LGNPC_TelUvirith_v1_20.esp=1
LGNPC_TelMora_v1_30.esp=1
LGNPC_SecretMasters_v1_30.esp=1
LGNPC_MaarGan_v1_20.esp=1
LGNPC_AldVelothi_v1_20.esp=1
LGNPC_IndarysManor_v1_51.esp=1
LGNPC_Khuul_v2_21.esp=1
LGNPC_GnaarMok_v1_20.esp=1
Less_Generic_Nerevarine.esp=1
Less_Generic_Tribunal.esp=1
Less_Generic_Bloodmoon.esp=1
MQE_MainQuestEnhancers.ESP=1
Weapons Overhaul.esp=1 [/spoiler]

 



#2
ququq

ququq
  • Newbie
  • Layman
  • Joined: 25-March 13
  • 4 posts

Clean UMPP-fixes-BTB-v2.esp seems to cause this bug. After i disabled this plugin the journal notification works as normal.

The esp is part of EnderAndrew's "Unofficial Morrowind Patch Project Bug Fixes" (UMPP 1.6.5 fixes).

.


Edited by ququq, 03 August 2013 - 02:43 PM.


#3
latendresse76

latendresse76
  • Members
  • Pip
  • Curate
  • Joined: 06-December 09
  • 460 posts
  • Location:Earth

i made and attempt to correct that and replied to your post at GHF



#4
Gez

Gez
  • Members
  • PipPipPipPip
  • Master
  • Joined: 01-April 06
  • 7082 posts
if ( GetHealth <= 1 )
       SetHealth 0
       if ( GetJournalIndex, "MS_Umbra" >= 30 )
               Journal, "MS_Umbra", 60
       else
               Journal, "MS_Umbra", 70
       endif
endif
That's going to make an infinite loop!

I guess the reason for changing from an "if ( OnDeath == 1 )" was so that if for some reason (poor performances? lag spike?) the script isn't run in the frame where Umbra dies, the journal is still updated. But there should be a safety to run it only once anyway!

if ( GetHealth <= 0 )
       if ( GetJournalIndex, "MS_Umbra" < 60 )
              if ( GetJournalIndex, "MS_Umbra" >= 30 )
                      Journal, "MS_Umbra", 60
              else
                      Journal, "MS_Umbra", 70
              endif
       endif
endif
Something like this ought to work just as well. (I'm not sure what was the point of looking for health <= 1.)

#5
gjerkson

gjerkson
  • Members
  • Pip
  • Curate
  • Joined: 12-March 11
  • 934 posts

funny fact, NPCs die when their health reaches 1, rather than 0.  so you need to detect for at least 1 health, otherwise there will be a rare chance that the npc dies and the script doesn't detect it.



#6
cyran0

cyran0
  • Members
  • PipPipPip
  • Diviner
  • Joined: 04-June 04
  • 2165 posts

funny fact, NPCs die when their health reaches 1, rather than 0.  so you need to detect for at least 1 health, otherwise there will be a rare chance that the npc dies and the script doesn't detect it.

 

I don't believe that is literally the case, but it sometimes may be effectively the case. What we do know is that NPCs, creatures - perhaps even the player - may 'die' before their health is reduced to zero. Even Bethesda seemed to recognize this fact since they sometimes check both OnDeath == 1 and GetHealth <= 0 to assure they detect death. This does not mean that Bethesda knew why one or the other sometimes failed.

 

For the GetHealth issue abot may have a better understanding. He advocates checking GetHealthGetRatio. I am working from memory, but I think his premise is founded on a rounding error and may use 0.005 as the cut off (one-half of one percent) - a logical conclusion even if it is just speculation. When the ratio falls below that the engine may round down to 0 for some checks (such as death).

 

The code from the patch looks like that which I started using years ago when I became aware of the problem. For any NPC or creature with less than 200 health, when its health falls below 1 it satisfies abot's condition. For a stronger opponent I might check for the health falling below 2. I then SetHealth 0 just to be certain death 'takes'. Some may bristle at the idea of killing a creature that is not dead, but I choose to be philosophical about it, It's probably a creature I added to the game. I can imagine giving it an extra health point so I don't feel like I am cheating to kill it with 1 point remaining.

 

As for the error, it is an easy mistake to make. The author used the original code structure but substituted the health check for the death check. However while the latter is true for only one frame (effectively do-once) the former is not, and that is why the journal updated repeatedly. Gez' journal check is a good condition to make it do-once.



#7
ququq

ququq
  • Newbie
  • Layman
  • Joined: 25-March 13
  • 4 posts

latendresse76 at GHF uploaded a fixed esp for the UMPP-BTB-Edit. You have to change the master file dependency to "Morrowind Patch 1.6.5 Beta (BTB Edit).esm" though.

 

esp: _fliggerty.com/phpBB3/download/file.php?id=4809_

 

Link to the thread: _fliggerty.com/phpBB3/viewtopic.php?f=32&t=5902&p=94203#p94203_



#8
Fritz

Fritz
  • Members
  • Adept
  • Joined: 05-April 09
  • 263 posts
  • Location:Russia
So what check better to using in scripts GetHealth <= 0 or GetHealth <= 1 or OnDeath == 1?

Edited by Fritz, 05 August 2013 - 07:11 AM.


#9
hollaajith

hollaajith
  • Members
  • PipPip
  • Disciple
  • Joined: 16-January 12
  • 1067 posts

So what check better to using in scripts GetHealth <= 0 or GetHealth <= 1 or OnDeath == 1?

GetHealth<=0 doesn't register in some cases.

 

GetHealth<=1 is best if you add DoOnce condition as it returns true every frame once the NPC is dead. So best if you want to check if an NPC is alive or not later.

 

OnDeath == 1 returns true only on the frme the NPC dies, but can't be used if you want to check if the NPC is dead or not after a while. You can use GetDeadCount, but its very FPS heavy.

 

P.S Also note that, NPC data resets after 72 hours, so GetHealth returns full health after 72 game-hours. So in that case GetDeadCount is better, but just make sure it isn't getting executed every frame.


Edited by hollaajith, 05 August 2013 - 07:44 AM.


#10
Fritz

Fritz
  • Members
  • Adept
  • Joined: 05-April 09
  • 263 posts
  • Location:Russia
Thanks for info, hollaajith.
So maybe this variant is better for Umbra?
Begin umbraScript

Short NoLore
Short doOnce

if ( GetHealth <= 1 )
SetHealth 0
if ( GetJournalIndex, "MS_Umbra" < 60 )
if ( GetJournalIndex, "MS_Umbra" >= 30 )
Journal, "MS_Umbra", 60
else
Journal, "MS_Umbra", 70
endif
endif
endif

End umbraScript

#11
hollaajith

hollaajith
  • Members
  • PipPip
  • Disciple
  • Joined: 16-January 12
  • 1067 posts

Thanks for info, hollaajith.
So maybe this variant is better for Umbra?
Begin umbraScript

Short NoLore
Short doOnce

if ( GetHealth <= 1 )
SetHealth 0
if ( GetJournalIndex, "MS_Umbra" < 60 )
if ( GetJournalIndex, "MS_Umbra" >= 30 )
Journal, "MS_Umbra", 60
else
Journal, "MS_Umbra", 70
endif
endif
endif

End umbraScript

Yours works.

But the one in the ESM is more efficient, corrected by  latendresse76 in GHF, as using OnDeath ensures only one frame processing.



#12
gjerkson

gjerkson
  • Members
  • Pip
  • Curate
  • Joined: 12-March 11
  • 934 posts

all I know is that setting health to 1 will kill npcs and creatures, but 1.0001 spares them.  easy to replicate with the console.



#13
Fritz

Fritz
  • Members
  • Adept
  • Joined: 05-April 09
  • 263 posts
  • Location:Russia
>But the one in the ESM is more efficient, corrected by latendresse76 in GHF, as using OnDeath ensures only one frame processing.
Yes, this variant is in russin fix too. But does this script needed to advanced check:
if ( GetJournalIndex, "MS_Umbra" < 60 )
like Gez writes?

#14
hollaajith

hollaajith
  • Members
  • PipPip
  • Disciple
  • Joined: 16-January 12
  • 1067 posts

Yes, this variant is in russin fix too. But does this script needed to advanced check:
if ( GetJournalIndex, "MS_Umbra" < 60 )
like Gez writes?

If you use "OnDeath, that check isn't required because it returns 1 only on the frame Umbra dies.

 

But if you use

If ( GetHealth<=1 )

it returns true for every frame after Umbra dies resulting in spam of journal.

 

So, you need additional check of 

if ( GetJournalIndex, "MS_Umbra" < 60 )

Edited by hollaajith, 05 August 2013 - 08:49 AM.


#15
arvythrend

arvythrend
  • Members
  • Adept
  • Joined: 28-September 10
  • 239 posts
  • Location:Germany

GetHealth can also fail for other reasons. When an NPC has a healing effect active on him while dying (because he has used a potion or a healing spell, or because the player trains his skills by alternatingly healing and fighting an enemy), he might die without his GetHealth ever getting even close to 0 (so <=1 or <=5 will fail, too).

 

The whole idea to replace OnDeath checks by GetHealth conditions for whatever perceived unreliability of OnDeath is a huge mistake. OnDeath used to confuse people for a couple reasons, most importantly I guess the fact that it can be called only once per frame per NPC (in every next call it will just return 0), so two OnDeath checks on the same NPC, even in the same script(!), must be separated by incompatible conditions. And of course, it cannot be used together with the "run-script-only-once-in-5-frames" kind of optimizations. Other than that, I never had it betray me.

 

Is anything wrong about the version of the script in MPP 1.6.5? It uses OnDeath:

 

begin LtM_umbraScript

Short NoLore

if ( OnDeath == 1 )
    if ( GetJournalIndex, "MS_Umbra" >= 30 )
        Journal, "MS_Umbra", 60
    else
        Journal, "MS_Umbra", 70
    endif
endif



end LtM_umbraScript


#16
hollaajith

hollaajith
  • Members
  • PipPip
  • Disciple
  • Joined: 16-January 12
  • 1067 posts

 

GetHealth can also fail for other reasons. When an NPC has a healing effect active on him while dying (because he has used a potion or a healing spell, or because the player trains his skills by alternatingly healing and fighting an enemy), he might die without his GetHealth ever getting even close to 0 (so <=1 or <=5 will fail, too).

 

I don't think having restore effect makes gethealth<=1 unreliable, because NPC dies in the frame the health gets below 1 and any spell effects gets disabled. So it shouldn't interfere, but I haven't checked it so not sure.

 

 

The whole idea to replace OnDeath checks by GetHealth conditions for whatever perceived unreliability of OnDeath is a huge mistake. OnDeath used to confuse people for a couple reasons, most importantly I guess the fact that it can be called only once per frame per NPC (in every next call it will just return 0), so two OnDeath checks on the same NPC, even in the same script(!), must be separated by incompatible conditions. And of course, it cannot be used together with the "run-script-only-once-in-5-frames" kind of optimizations. Other than that, I never had it betray me.

 

For the script in hand, OnDeath is tailor made. It executes one time and done. Only time I use GetHealth instead of OnDeath is when I want to do something a while after the NPC dies.

 

Is anything wrong about the version of the script in MPP 1.6.5? It uses OnDeath:
begin LtM_umbraScript

Short NoLore

if ( OnDeath == 1 )
    if ( GetJournalIndex, "MS_Umbra" >= 30 )
        Journal, "MS_Umbra", 60
    else
        Journal, "MS_Umbra", 70
    endif
endif



end LtM_umbraScript

Nope. Nothing is wrong in the script.

 

The problem of spammed journal occured because of "Clean UMPP-fixes-BTB-v2.esp" which changed the script to use GetHealth<= 1 instead of OnDeath.



#17
arvythrend

arvythrend
  • Members
  • Adept
  • Joined: 28-September 10
  • 239 posts
  • Location:Germany

I don't think having restore effect makes gethealth<=1 unreliable, because NPC dies in the frame the health gets below 1 and any spell effects gets disabled. So it shouldn't interfere, but I haven't checked it so not sure.

The spell effect *does* stop in the frame the NPC dies, but his health can be positive (and a lot higher than 1, depending on the magnitude of the effect) in that frame. I don't know how this comes; I just know it does.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users