unknownhero2827 Posted July 5, 2014 Share Posted July 5, 2014 Begin OnDeath MoveTo MercTrashcanMarker00 End That's the script, attached to an NPC. When the NPC dies, it moves to the marker on death. But when I use coc to the marker location, the body is not there. If I resurrect it, it appears. Though If I kill it again, it doesn't spawn right at the marker, it just stays at the same spot. That's not my problem at the moment though. If I am already at the marker location, then kill the npc in a different location, the body moves to the marker and I can see it spawn, just as I wanted. The NPC is not set to respawn. So why can't I see the body when I move to the marker location after the NPCs death? I do use some cleanup mods to help with lag. Maybe one of those is hiding the body when it goes to a new location? Link to comment Share on other sites More sharing options...
kastano Posted July 5, 2014 Share Posted July 5, 2014 i think moveto doesnt work in dead npcsso perhaps you have to ressurect it and send it there and kill it again there(i dont know what exacty you want to accomplish) SCN AAAmoscript; Applied to npcShort Deadshort deadtwiceBegin OnDeathSet Dead to 1EndBegin GameModeif deadtwice == 0If GetDistance Player > 2000If Dead == 1ResurrectSet Dead to 0MoveTo MercTrashcanMarker00;kill conditions;kill codeset deadtwice to 1EndIfEndIfEnd Link to comment Share on other sites More sharing options...
unknownhero2827 Posted July 5, 2014 Author Share Posted July 5, 2014 The dead body does at least somewhat respond to MoveTo, as the body is transferred to MercTrashcanMarker00. But I guess it may be invisible, or else it gets sent to some type of purgatory. If it's only invisible, that might be fine for me. What I'm trying to do is send a dead NPC spawned with PlaceAtMe to a cell, which I will use Resetinterior on. I read ResetInterior will delete NPCs, thereby eliminating save game bloat from PlaceAtMe spawned NPCs. I'm not sure if I can have the NPC resurrect, since I want to delay 3 days to when it will move to the marker. And I'm not sure if delay functions (or "variable" is it?... I'm new to scripting) work on dead NPCs either, as I've tried adding it in, but after 3 days the body won't move to the marker. I need the body to remain for 3 days so that the player will have time to loot the body. I did test what would happen with MoveTo on a living NPC, and it did successfully move to the marker. I might be able to work with your suggestion, but it'd be a bit of a compromise I think. Link to comment Share on other sites More sharing options...
unknownhero2827 Posted July 5, 2014 Author Share Posted July 5, 2014 (edited) I think if I just resurrect and kill them after they've reached the marker (while dead) that'll work. It's just the delay timer now that I can't get working, and I don't think it will with a dead NPC. Maybe with a scripted token or something it will. Edited July 5, 2014 by unknownhero2827 Link to comment Share on other sites More sharing options...
kastano Posted July 5, 2014 Share Posted July 5, 2014 the delay timer work with dead npcsthis works with a normal npc(without place at me) SCN AAAmoscript; Applied to npcShort Deadshort deadtwiceshort dooncefloat CurrentDayref deadactorBegin OnDeathSet Dead to 1set deadactor to getselfset CurrentDay to GameDaysPassed;deadactor.MoveTo MercTrashcanMarker00 ;testEndBegin GameModeif doonce == 0set CurrentDay to GameDaysPassedset deadactor to getselfset doonce to 1endifif GameDaysPassed >= CurrentDay + 2 ;two days just for sureif deadtwice == 0If Dead == 1deadactor.disabledeadactor.MoveTo MercTrashcanMarker00deadactor.enabledeadactor.Resurrect;kill conditions;kill codeset deadtwice to 1killEndIf;else;deadactor.evp ;this doesnt seem to helpEndIfendifEnd Link to comment Share on other sites More sharing options...
The_Vyper Posted July 5, 2014 Share Posted July 5, 2014 Your "cleanup mods" may very well be getting rid of the body. One way to test this is to make your NPC a "Quest" item (there's a box you can select for this when editing the NPC). Quest items are not "cleaned up" when a cell resets. Link to comment Share on other sites More sharing options...
unknownhero2827 Posted July 6, 2014 Author Share Posted July 6, 2014 (edited) @kastano, That worked. I just have to do a few tweaks. Thank you very much for taking the time to write all that script. Well appreciated. @The_Vyper, Sorry for posting twice. I wasn't sure whether to post in mod talk or troobleshooting, I think troobleshooting is where I want to be. My NPC is a quest item. Does that mean it can never be deleted, even If I use resetinterior? Edit: My question has been answered on another topic. Thanks again for your replies. Edited July 6, 2014 by unknownhero2827 Link to comment Share on other sites More sharing options...
Recommended Posts