unknownhero2827 Posted July 4, 2014 Share Posted July 4, 2014 (edited) I think this is the right place to post this... I want a script to MoveTo an NPC... upon 3 days after death... to a cell, Trashcan00. Then, I want to resetinterior that cell -- or Trashcan00 -- automatically every so often to permanently delete the NPC. I'm very new to scripting, and I'm not sure how to do that. If someone could at the least point me in the right direction... very appreciated. Edited July 5, 2014 by unknownhero2827 Link to comment Share on other sites More sharing options...
pyrotx Posted August 9, 2014 Share Posted August 9, 2014 (edited) You could try something like: Event OnDeath()Utility.wait(however many seconds)self.moveto(wherever)EndEvent And attach the same script to each npc in question. If you just want to get rid the a dead body, then try:Event OnDeath()Utility.Wait(however many seconds)Self.Disable()Self.Delete()EndEvent Edited August 9, 2014 by pyrotx Link to comment Share on other sites More sharing options...
Maskar Posted August 9, 2014 Share Posted August 9, 2014 That doesn't look like Oblivion scripting. I'm probably not fully understanding the question, but normally actors are automatically removed from the game when the cell they're in resets (usually 72 hours). Link to comment Share on other sites More sharing options...
Deleted3619564User Posted August 9, 2014 Share Posted August 9, 2014 @unknownhero2827: also i don't understand what do you want to do.Anyway...to do something like you want, you need to create a quest script like this. Scriptname TheQuest float Timershort SBegin GameMode if S == 0 set Timer to xxx (where xxx is your period in seconds) set S to 1 endif set Timer to Timer - GetSecondsPassed ;(NPCRef > the ref of your npc, CellMarkerRef > a XMarker that you need to place in the cell) if (Timer <= 0) && (NPCRef.GetDead == 1) NPCRef.Disable NPCRef.MoveTo CellMarkerRef ResetInterior TheCell StopQuest TheQuest endifEnd An actor cannot be deleted/reset if it is a static Ref (not created by the PlaceAtMe command but by the CS editor), but also if it is a dynamic ref (created by the PlaceAtMe command). You can delete only dynamic objects (not actors). You can only disable actors and/or move them in another place. When you reset the cell the ref is not deleted suddenly, but the cell will be restored to the initial state on the next loading of the cell marked as expired (as Maskar wrote 72 hours after the reset). Oblivion reset the cell when it need to load the cell; if you never enter the cell, Oblivion never restores it. Link to comment Share on other sites More sharing options...
unknownhero2827 Posted August 9, 2014 Author Share Posted August 9, 2014 (edited) I'm just trying to delete NPCs spawned with PlaceAtMe (From CS) So, PlaceAtMe NPCs can't be deleted? In-game, I clicked on the NPC with the console so that I had their ref. I then killed the NPC, and two days later it moved to the cell I wanted. Resetinterior was then also used on that cell. The NPC ref was still in my console. Then I entered the cell myself, and the NPC ref was gone. I took this as the NPC was deleted. For if I had just disabled the NPC, it would still be selected in my console. Is not not deleted? Edited August 9, 2014 by unknownhero2827 Link to comment Share on other sites More sharing options...
Deleted3619564User Posted August 10, 2014 Share Posted August 10, 2014 It's correct. PlaceAtMe actors (not only NPC) cannot be deleted directly by a command. You need to wait that Oblivion removes them. Actors work in a different way from the other objects.You can check out the wiki here: http://cs.elderscrolls.com/index.php?title=List_of_Functions. unknownhero2827 wrote:In-game, I clicked on the NPC with the console so that I had their ref. I then killed the NPC, and two days later it moved to the cell I wanted. Resetinterior was then also used on that cell. The NPC ref was still in my console. Then I entered the cell myself, and the NPC ref was gone. Yes. As i wrote, if you enter the cell, the ref is removed but if you never enter the cell, the ref is marked as expired but it is not disposed in memory until you enter the cell. Only Oblivion's code can destroy an actor's ref, you cannot by external code (there is no commands to do it). Link to comment Share on other sites More sharing options...
unknownhero2827 Posted August 10, 2014 Author Share Posted August 10, 2014 I'm not sure what you're saying unfortunately. I'm pretty sure I'm doing it right though, and as you said "wait till Oblivion removes them," through resetinterior. Link to comment Share on other sites More sharing options...
Deleted3619564User Posted August 11, 2014 Share Posted August 11, 2014 I think you are not reading with attention......this is a fault of many people......do as you prefer. Bye bye! Link to comment Share on other sites More sharing options...
unknownhero2827 Posted August 12, 2014 Author Share Posted August 12, 2014 (edited) I'm pretty sure i'm following correctly as you are saying. That you cannot delete NPCs by direct command, but only indirectly through oblivion resetting the cell after 72hrs (but also which can be done instantly through ResetInterior written in script). Once Oblivion re-spawns the cell, you have to go to the cell to permanently trash the (marked for deletion) ref, or else the ref is still stuck in memory. So I think we are on the same page, sorta. I just wasn't completely sure we were, and that'd be a big problem for my mod if I got the wrong message. Regardless, thank-you for the help. Edited August 12, 2014 by unknownhero2827 Link to comment Share on other sites More sharing options...
Recommended Posts