Jump to content

Resurrection Spell


AGLNM01

Recommended Posts

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

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

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 by Contrathetix
Link to comment
Share on other sites

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...