SKKmods Posted May 7, 2022 Share Posted May 7, 2022 This may be a well known thing but it just cost me a solid day of super-tedious debugging. When an actor is Reset() (no, not resurrect thats broken) by script or magic effect (in my case crGlowingOneBurst spell > GlowingOneReanimate MGEF > PermanentReanimate architype) ... ... the actor re-animiates with rerolled face/inventory but all of the keywords, actor values and spells directly applied to the original are still on the actor ... EXCEPTING the spell magic effects do not run, the spells have to be removed and reapplied to work. The bastard is that there is no OnInit or OnLoad event triggered by actor.Reset() and any magic attached scripts ofcourse dont run. The ONLY workaround I could figure is a script directly attached to the actor form to detect the condition with; Bool bHasDied = False ; script is not CONST ;******************************************************** Event OnCombatStateChanged(Actor akTarget, int aeCombatState) If (bHasDied == True) bHasDied = False ; for the next reanimation Self.RemoveSpell(ThisSpell) Self.AddSpell(ThisSpell, abVerbose = false) EndIf EndEvent ;******************************************************** Event OnDeath(Actor akKiller) bHasDied = True EndEvent ;******************************************************** Could make it CONST by using an actor attached actorvalue as the HasDiedAlready flag (except that script also uses states anyway). If this saves someone else a day thats pay-back. Link to comment Share on other sites More sharing options...
PJMail Posted May 8, 2022 Share Posted May 8, 2022 I will add this to my annoyance list of situations where magic effects 'dissappear' on NPCs... Thanks SKK. Do you think this is related to the 'all Magic effects stop when weapon/clothing is equipped' bug?I assume the reset does not return a naked NPC so equips would happen in that process. Link to comment Share on other sites More sharing options...
PJMail Posted May 8, 2022 Share Posted May 8, 2022 Another one for you - Clothing Enchantments dissappear 'onload' of an NPC who is set to EnableAI(false) Link to comment Share on other sites More sharing options...
Recommended Posts