qwertypol012 Posted February 21, 2020 Share Posted February 21, 2020 As the title says, i'm in the making of a mod, and i have this NPC as a boss whom need to be defeated. I flagged him as essential, but when his health goes down into a critical level, he will just stand in place without bleeding out like any other essential npcs. Somehow his health meter dissappeared after i hit him until reaching his supposed-to-be "bleeding out" health level, but he just won't bleed out.I totally have no clue on what's going on. I do have a script attached to him, and it's a script to trigger a transformation when his health is low or he's entering bleed out, but i don't think it's related. So, what did i do wrong here? Why won't he bleed out in low health? As a reference, here's the script attached to him (it's probably unrelated, but i'll just post it if somehow it's actually related): Scriptname NPCBossScript extends Actor ;Scriptname NPCBossScript extends ObjectReference MusicType PROPERTY Default Auto MusicType PROPERTY MUSSpecial Auto MusicType PROPERTY MUSCombat Auto MusicType PROPERTY MUSCombatBoss Auto ObjectReference PROPERTY HumanNPC Auto Spell PROPERTY TransformSpell Auto Idle PROPERTY BleedOutStop auto float PROPERTY HPThreshold = 0.05 auto EVENT OnCombatStateChanged(Actor akTarget, int aeCombatState) IF (aeCombatState == 1) ; MUSCombat.Remove() ; MUSCombatBoss.Remove() ; Default.Remove() MUSSpecial.Add() ELSEIF(aeCombatState == 0) MUSSpecial.Remove() ; Default.Add() ELSEIF(aeCombatState ==2) MUSSpecial.Remove() ; Default.Add() ; ENDIF ENDIF ENDEVENT EVENT OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) IF Self.GetActorValuePercentage("Health") <= HPThreshold ; Debug.SendAnimationEvent(HumanNPC, "BleedOutStart") Self.SetGhost() Self.SetRestrained(TRUE) IF ( Is3DLoaded() ) TransformSpell.Cast(Self, Self) ELSE RegisterForSingleUpdate(0.5) ENDIF ELSEIF ((Self.GetActorValue("Confidence") as Int) < 4) || (((HumanNPC as Actor).GetActorValue("Confidence") as Int) < 4) Self.ForceActorValue("Confidence", 4) (HumanNPC as Actor).ForceActorValue("Confidence", 4) ELSE RETURN ENDIF ENDEVENT EVENT OnEnterBleedout() ; (Self as Actor).SetGhost() ; Utility.Wait(1.0) Self.SetGhost() Self.SetRestrained(TRUE) ; Self.RestoreActorValue("Health", 50) ; Self.PlayIdle(BleedOutStop) Utility.Wait(3) IF ( Is3DLoaded() ) ; Debug.SendAnimationEvent(Self, "BleedOutStop") TransformSpell.Cast(Self, Self) ELSE RegisterForSingleUpdate(0.5) ENDIF ENDEVENT EVENT OnUpdate() IF ( Is3DLoaded() ) ; Debug.SendAnimationEvent(Self, "BleedOutStop") TransformSpell.Cast(Self, Self) ELSE RegisterForSingleUpdate(0.5) ENDIF ENDEVENT Link to comment Share on other sites More sharing options...
maxarturo Posted February 21, 2020 Share Posted February 21, 2020 (edited) You have this lines in your script. IF Self.GetActorValuePercentage("Health") <= HPThreshold ; Debug.SendAnimationEvent(HumanNPC, "BleedOutStart") Self.SetGhost() ....etc - First you have the condition that when your actor gets to 5% of his health to trigger the "SetGhost()", and here is where the problem lies. Actors that are flag as 'Ghost" they don't actually become ghosts but the "SetGhost" will make the npc to not take damage from any source and automaticly to ignore all releated to that function/animations acions, like bleeding out, it overwrites all of the actor's taking damage releated functions. Edited February 22, 2020 by maxarturo Link to comment Share on other sites More sharing options...
qwertypol012 Posted February 22, 2020 Author Share Posted February 22, 2020 You have this lines in your script.IF Self.GetActorValuePercentage("Health") <= HPThreshold ; Debug.SendAnimationEvent(HumanNPC, "BleedOutStart") Self.SetGhost() ....etc - First you have the condition that when your actor gets to 5% of his health to trigger the "SetGhost()", and here is where the problem lies.Actors that are flag as 'Ghost" they don't actually become ghosts but the "SetGhost" will make the npc to not take damage from any source and automaticly to ignore all releated to that function/animations acions, like bleeding out, it overwrites all of the actor's damage releated functions. Oh, i see. So that's the reason. Thanks for helping me solving this issue :) Link to comment Share on other sites More sharing options...
Recommended Posts