maxarturo Posted January 6, 2020 Share Posted January 6, 2020 The title says it all. I'm trying to calculate something for 2 specific cells that i need them to be clear/clean of bodys the third or fourth time he/she returns, and i'm trying to avoid if possible further scripts in those cells (there is already too much going on). * I do have a simple solution, but requires a small script to be attached to every single dead npc. I did try to test this in game, but the "Wait" seems to not trigger the deletion, and i'm trying to save some time that it will be wasted while playing it normally (without using "wait"). If anyone knows... he/she will save me some precious time !. Thanks a lot. Link to comment Share on other sites More sharing options...
HadToRegister Posted January 6, 2020 Share Posted January 6, 2020 Might want to take a look at how tonycubed2 did it?Dead NPC Body Cleaner RemoverYou can burn them with the beginner fire spell or torches Link to comment Share on other sites More sharing options...
maxarturo Posted January 6, 2020 Author Share Posted January 6, 2020 Thanks for that HadToRegister. But is kind of the two ideas i had. 1) Auto self delete (dead npc) on "OnCellDetach()" 2) Auto self move (dead npc) to a "Dead Cell" after three "OnCellDetach" (which is actually what i want). But as i said i'll like to let the game handle this to avoid further scripts in those cells. Nevertheless... thank you !. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted January 7, 2020 Share Posted January 7, 2020 (edited) Hmm.. next script is for Actor, if you use a quest with ReferenceAlias scripts you should adjust. TestRemoveDeadNPCScript Scriptname TestRemoveDeadNPCScript extends Actor ; https://forums.nexusmods.com/index.php?/topic/8294483-how-many-ingame-days-does-the-game-needs-to-delete-dead-npcs/ ObjectReference PROPERTY DeadCellMarker auto ; use a Xmarker placed into the cell you want to move the dead NPCs Int PROPERTY iCounter = 3 auto ; detach counter Bool bDead ; [default=False] ; -- EVENTs -- 4 ; maxarturo wrote: actually what i want ; 1) Auto self delete (dead npc) on "OnCellDetach()" ; 2) Auto self move (dead npc) to a "Dead Cell" after three "OnCellDetach" EVENT OnInit() ;============= Debug.Trace(self+" OnInit() - has been reached..") ; a bit info here ENDEVENT EVENT OnReset() ;============== Debug.Trace(self+" OnReset() - has been reached..") ; a bit info here ENDEVENT EVENT OnDeath(Actor akKiller) ;============================ bDead = TRUE ENDEVENT EVENT OnCellDetach() ;=================== IF ( bDead ) iCounter = iCounter - 1 IF (iCounter <= 0) myF_CleanUp() ENDIF ENDIF ENDEVENT ; -- FUNCTION -- ;--------------------- FUNCTION myF_CleanUp() ; for actor script ;--------------------- ; wiki tells us: "If an actor is already in the cell, and the player is also in the cell, ; leaving the cell, or arriving in the cell, MoveTo() does not" work. self.DisableNoWait() self.MoveTo(DeadCellMarker) Utility.Wait(0.1) self.Delete() ENDFUNCTION use that to cleanup an alias script ;-------------------------- FUNCTION myF_CleanUpAlias() ; for ReferenceAlias script ;-------------------------- objectReference oRef = self.GetReference() IF ( oRef ) oRef.DisableNoWait() oRef.MoveTo(DeadCellMarker) Utility.Wait(0.1) oRef.Delete() self.Clear() ; unassign the ObjectRef from ReferenceAlias ENDIF ENDFUNCTION Happy new Year.. Edited January 7, 2020 by ReDragon2013 Link to comment Share on other sites More sharing options...
maxarturo Posted January 8, 2020 Author Share Posted January 8, 2020 Thanks for that ReDragon2013. Since i can't find any references of this in the web, i decided to just move all dead npcs to a "Dead Cell" and let the game do its thing whenever it wants. I will just use a 4 line script for this, i don't think that this needs unnecessary further scripting. Happy new year to you too my friend. Link to comment Share on other sites More sharing options...
Recommended Posts