hexagonlux Posted September 4, 2013 Share Posted September 4, 2013 Just wondering if the base id of the original actor is stored anywhere in the pile. When you open one to loot it, it gives their name so I figure it's stored somewhere.I am asking for resurrection purposes. I know you can't just click on an ash pile and run a resurrect command on it. I'm hoping to write a script that will pull the base id out so I can either resurrect or respawn the npc from there. Thanks! ^_^ Link to comment Share on other sites More sharing options...
jazzisparis Posted September 4, 2013 Share Posted September 4, 2013 Just wondering if the base id of the original actor is stored anywhere in the pile. When you open one to loot it, it gives their name so I figure it's stored somewhere.The disintegrated/gooified actor is removed from the game, and its ID is no longer retrievable by any means. The function AttachAshPile gives the spawned ash/goo pile the name of the dead actor. Link to comment Share on other sites More sharing options...
hexagonlux Posted September 5, 2013 Author Share Posted September 5, 2013 (edited) Just wondering if the base id of the original actor is stored anywhere in the pile. When you open one to loot it, it gives their name so I figure it's stored somewhere.The disintegrated/gooified actor is removed from the game, and its ID is no longer retrievable by any means. The function AttachAshPile gives the spawned ash/goo pile the name of the dead actor. This is exactly the information I was looking for. Thank you. What about this, then? - I create a list/ database of all the actors that has their corresponding ID? The mod reads the actors name from the container, looks for it on the list, the list gives the ID and then it just spawns a new actor from there? Edited September 5, 2013 by hexagonlux Link to comment Share on other sites More sharing options...
rickerhk Posted September 5, 2013 Share Posted September 5, 2013 If the actor is persistent and you have their refID, then you can resurrect them. But then you are faced with another fun fact of ash piles - If you happen to activate the ash pile, you will enter dialog with your NPC, much like a talking activator. So you would have to find the nearest ashpile to the resurrected actor and 'assume' that was the one attached to the actor REF, then disable and markfordelete it. I did this for my FO3 companion mod, but didn't bother for FNV - Ash pile == permadead for that one :)I'm not sure about picking out the name of the container from the UI. I haven't done any UI stuff. But if you could, you would use PlaceAtMe to spawn a new actor and then just disable/markfordelete the ash pile, avoiding the resurrection activator issue. Link to comment Share on other sites More sharing options...
jazzisparis Posted September 5, 2013 Share Posted September 5, 2013 After running a little test, it turns out I was wrong - the disintegrated/gooified actor is not actually removed from the game, only disabled. That means you can retrieve its reference ID by REF walking over all the actors in the current cell, until you find an actor who is both dead and very close to the ash/goo pile. You then resurrect it and remove the pile. Note that this method is not 100% reliable, and may not perform as intended sometimes, but should be adequate to your needs. The following script should work. You will have to test it yourself, as I'm unable to do so at the moment. scn ResurrectorScript ref rTarget ref rActor short iRefs begin OnFire set rTarget to GetCrosshairRef if rTarget set rActor to 0 if rTarget.IsActor && rTarget.GetDead set rActor to rTarget elseif rTarget.GetIsID DefaultAshPile1 || rTarget.GetIsID DefaultAshPile2 set iRefs to GetNumRefs 200 1 0 if iRefs set rActor to GetFirstRef 200 1 0 Label 1 if rActor.GetDead && (rActor.GetDistance rTarget < 64) set iRefs to 0 rTarget.Disable rTarget.MarkForDelete else set rActor to 0 set iRefs to iRefs - 1 endif if iRefs set rActor to GetNextRef GoTo 1 endif endif endif if rActor rActor.Resurrect endif endif end Link to comment Share on other sites More sharing options...
hexagonlux Posted September 5, 2013 Author Share Posted September 5, 2013 After running a little test, it turns out I was wrong - the disintegrated/gooified actor is not actually removed from the game, only disabled. That means you can retrieve its reference ID by REF walking over all the actors in the current cell, until you find an actor who is both dead and very close to the ash/goo pile. You then resurrect it and remove the pile. Note that this method is not 100% reliable, and may not perform as intended sometimes, but should be adequate to your needs. The following script should work. You will have to test it yourself, as I'm unable to do so at the moment. scn ResurrectorScript ref rTarget ref rActor short iRefs begin OnFire set rTarget to GetCrosshairRef if rTarget set rActor to 0 if rTarget.IsActor && rTarget.GetDead set rActor to rTarget elseif rTarget.GetIsID DefaultAshPile1 || rTarget.GetIsID DefaultAshPile2 set iRefs to GetNumRefs 200 1 0 if iRefs set rActor to GetFirstRef 200 1 0 Label 1 if rActor.GetDead && (rActor.GetDistance rTarget < 64) set iRefs to 0 rTarget.Disable rTarget.MarkForDelete else set rActor to 0 set iRefs to iRefs - 1 endif if iRefs set rActor to GetNextRef GoTo 1 endif endif endif if rActor rActor.Resurrect endif endif end Wowzer! Thank you for that. Unfortunately, GECK would not save it. I definitely don't grok REFs enough to troubleshoot it. Will dig into the reference though ^_^ Link to comment Share on other sites More sharing options...
jazzisparis Posted September 5, 2013 Share Posted September 5, 2013 Unfortunately, GECK would not save it.I forgot to mention this script includes NVSE functions. This may be a stupid question, but are you launching the GECK via nvse_loader.exe?Just in case you aren't, this is done by creating a special shortcut. For more information, see the last paragraph under Installation on this page. Link to comment Share on other sites More sharing options...
hexagonlux Posted September 5, 2013 Author Share Posted September 5, 2013 Unfortunately, GECK would not save it.I forgot to mention this script includes NVSE functions. This may be a stupid question, but are you launching the GECK via nvse_loader.exe?Just in case you aren't, this is done by creating a special shortcut. For more information, see the last paragraph under Installation on this page. Haha! I was not launching with the nvse. I'm a noob. :) So I launched with the NVSE and the script saved without a hitch. I loaded it up in New Vegas and it worked like a charm!Thank you very kindly! I'll definitely be crediting you when I upload this version to the nexus. ^_^ Final question: Is the ash pile functionality just not possible without using the script extender?Thanks again! :D Link to comment Share on other sites More sharing options...
jazzisparis Posted September 5, 2013 Share Posted September 5, 2013 You're welcome, good to hear it actually works. :) Final question: Is the ash pile functionality just not possible without using the script extender?I doubt it, since the ash piles are special activators (not containers, as one might think) that are at least partially hardcoded. It's very possible, however that the same thing can be done in other ways - I certainly don't pretend to know all there is to know about scripting and the GECK.Anyway, you shouldn't be concerned about the NVSE requirement - it has become practically household by now, and anyone who doesn't have it - well, they should get it. Link to comment Share on other sites More sharing options...
Recommended Posts