AGLNM01 Posted July 4, 2017 Share Posted July 4, 2017 Hi All, I am trying to create a spell which would allow the player to bring back to life dead NPCs using the Resurrect console command in a script, without having to select it with the cursor first, as opposed to using the reanimate spell. Can someone please tell me whether this is possible? Thanks. Link to comment Share on other sites More sharing options...
dizzy Posted July 6, 2017 Share Posted July 6, 2017 I would look at these 2 OBSE functions that allow to run console commands: RunScriptLine - runs a line of script as if it were called from the console. If bRunOnRef is 1, the line of script will be executed on the calling object, if any. If bSuppressOutput is true, no output will be generated in the console while the script line is executing.(nothing) reference.RunScriptLine formatString:string var1 var2 ... var20 bRunOnRef:bool bSuppressOutput:bool RunBatchScript - runs a specified text file under the Oblivion directory as a script. Works the same as the console function bat. The optional second parameter causes the script to execute on the calling object, if any. The optional third parameter prevents any output from appearing in the console while the script executes.(nothing) reference.RunBatchScript bRunOnRef:bool bSuppressOutput:bool My idea is to try to use: <targetRef>.RunScriptLine "resurrect 1" true Which I'm hoping runs console "resurrect 1" as if <targetRef> was selected first with "prid". But if that doesn't work try running "prid <targetRef>" and then "resurrect 1". Link to comment Share on other sites More sharing options...
Surilindur Posted July 7, 2017 Share Posted July 7, 2017 (edited) Is there a reason not to use the normal Resurrect command in a script? According to the wiki there seem to be some... issues and limitations. But I suppose the console one also has them, if they actually are the same function...? :huh: Or are they not? Hmm. Maybe Bethesda could do two separate functions for the same thing, but it makes no sense. For example something like (untested, an idea only!): scriptname YourPrefixResurrectTestSpellScript begin ScriptEffectFinish if ( GetDead && GetIsReference PlayerRef == 0 ) Resurrect 1 endif end Edited July 7, 2017 by Contrathetix Link to comment Share on other sites More sharing options...
dizzy Posted July 7, 2017 Share Posted July 7, 2017 Ah lol, no that's just me being stupid. I searched for a resurrect script command before posting but I only searched for that in the OBSE command list page, didn't search for it in the Bethesda function list... d0h. Definitely try using the built-in "Resurrect" function first, running console commands through scripts is kinda of a hack. Link to comment Share on other sites More sharing options...
Surilindur Posted July 8, 2017 Share Posted July 8, 2017 Oh okay. I sometimes end up making all sorts of weird workarounds myself, too, for various things. However that workaround is actually quite nice! Also simple and short. :thumbsup: Link to comment Share on other sites More sharing options...
AGLNM01 Posted July 8, 2017 Author Share Posted July 8, 2017 :thumbsup: Thanks for your script suggestion, Contrathetix. Just what I wanted. Link to comment Share on other sites More sharing options...
Surilindur Posted July 8, 2017 Share Posted July 8, 2017 No problem. Also thanks to dizzy for the workaround! Just remember to be careful with what you resurrect, it could be that some NPCs or creatures are not necessarily intended to be resurrected. For example Mannimarco or the Gatekeeper or something. Dialogue topics, quests and scripts can have checks to see if something is dead, too, to handle progress. Normal bandits and necromancers and wolves might be fine, though... ? Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted July 9, 2017 Share Posted July 9, 2017 I suppose I arrive too late but I know a spell that resurrects people without resetting them. Are you interested AGLNM01? Link to comment Share on other sites More sharing options...
AGLNM01 Posted July 9, 2017 Author Share Posted July 9, 2017 Thanks so much for the offer, Oblivionaddicted, but Contrathetix has solved it for me. Link to comment Share on other sites More sharing options...
Surilindur Posted July 10, 2017 Share Posted July 10, 2017 The wiki page for the resurrect command mentions how the command might remove some items from actors. If you notice anything odd, like items being there on an NPC when you loot them, and not being there after using the resurrect command, then it could be that the issue with items disappearing is actually happening. And that can be problematic if some relevant item relevant disappears by accident. Maybe that is what the "reset" means... ? Or not? Some other alternatives might include the Reanimate effect or something similar, if you only need to temporarily resurrect the NPC. Link to comment Share on other sites More sharing options...
Recommended Posts