What does "resurrect" do exactly?

Post » Fri Nov 16, 2012 7:48 am

I know it brings them back to life, but I'm wondering if it does weird stuff too, or doesn't do some things it should (such as flagging the actor as not dead). Basically, I have a once per day power that resurrects a follower, but I want it to resurrect them completely, as if they were any other live actor. I don't want any screwiness, and I was wondering if this function had any.
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Fri Nov 16, 2012 5:33 am

I think it would depend on which actor you want to have this ability. When certain actors die, they trigger quest-stages, scenes, dialog, and other stuff. Since Skyrim is so complex (compared to Obliv), it'd be difficult to pull off on certain actors (presumably 'uniques' and those that affect 'minor' quests and merchanting). I expect you'd have to reset quest-stages or anything else that was triggered; but some things may not be readily reset-able without fiery hoop-jumpage.

I foresee doing it on Player would be especially tricky (since SO many things are contingent on Player's state)... I know doing it from the console (on Player) causes drama.

But to do it on say.. a custom (and simple) actor that you set up as a follower or a unique enemy-boss, that may be quite easy and non-dramatic, and should work perfectly fine. Since you're the one who controls what that actor is 'hooked up to', you know what needs to be reset or changed should that actor pay the ultimate price and do a Lazarus.
User avatar
Kayla Bee
 
Posts: 3349
Joined: Fri Aug 24, 2007 5:34 pm

Post » Fri Nov 16, 2012 6:14 am

It will reset the actor's inventory to the default given to them in the CK, so if the player looted their corpse and they are assigned any unique items you will get duplicates, or if they died while carrying something important from elsewhere that will be lost.

If the resurrected actor is generated from a levelled list then they will be re-generated, possibly changing their level and/or their facial characteristics depending on how the list is set up and what gets chosen.

Any active magic effects running on them which don't come from abilities assigned in the CK or from their default gear will be removed.

I know it brings them back to life, but I'm wondering if it does weird stuff too, or doesn't do some things it should (such as flagging the actor as not dead). Basically, I have a once per day power that resurrects a follower, but I want it to resurrect them completely, as if they were any other live actor. I don't want any screwiness, and I was wondering if this function had any.
User avatar
Facebook me
 
Posts: 3442
Joined: Wed Nov 08, 2006 8:05 am

Post » Fri Nov 16, 2012 7:05 am

Crap. Thanks, thats what I wanted to know. The inventory thing is really gonna screw me over. I guess I could make it auto transfer all items to the player and then resurrect. Thanks for the info guys.
User avatar
Daniel Brown
 
Posts: 3463
Joined: Fri May 04, 2007 11:21 am

Post » Fri Nov 16, 2012 10:54 am

It's not THAT big a deal (at least the item thing). You could just dump the dead actor's inventory before resurrecting... simple code should be only a line or two really. If you can't delete/dump all the stuff, then I'd make an 'invisi' container placed somewhere out of the way; then dump the inventory to IT before resurrection.

I'd still be more concerned with quest-related stuff if you plan to have this effect on Vanilla actors (eg: non-custom). That level-list stuff is interesting... I haven't mess with them yet either so know nothing about them (but I get that facial geometry, as well as other stuff, changes randomly and/or based on circumstance).
User avatar
Carolyne Bolt
 
Posts: 3401
Joined: Mon Jul 10, 2006 4:56 am

Post » Fri Nov 16, 2012 7:56 pm

Yes, this is how I did it in one of my scripts:

ObjectReference Property TempContainerRef autoWeapon Property DummyWeapon auto; Store his inventory somewhereActorRef.RemoveAllItems(TempContainerRef); It's alive!ActorRef.Resurrect(); Remove what resurrect() added and get back his stored inventoryActorRef.RemoveAllItems()TempContainerRef.RemoveAllItems(ActorRef); Make him a teammate, then add and remove a weapon: forces him to re-evaluate his inventory; and dress himselfActorRef.SetPlayerTeammate(True)ActorRef.AddItem(DummyWeapon, 1)ActorRef.RemoveItem(DummyWeapon, 1)ActorRef.SetPlayerTeammate(False)

Only problem is that the resurrected actor will very briefly appear naked in between his gear being removed and re-added.

It's not THAT big a deal (at least the item thing). You could just dump the dead actor's inventory before resurrecting... simple code should be only a line or two really. If you can't delete/dump all the stuff, then I'd make an 'invisi' container placed somewhere out of the way; then dump the inventory to IT before resurrection.
User avatar
Breautiful
 
Posts: 3539
Joined: Tue Jan 16, 2007 6:51 am

Post » Fri Nov 16, 2012 6:41 pm

Would this help to eliminate the naked glitch? Setting the actor's alpha(0.0) before resurrecting, then after the inventory swap set it back to (1.0).

I like the way you went the extra mile to eliminate the NEW items, instead of the old/wanted ones (as my basic solution would have done).. pretty clever, and only another couple lines to achieve!
User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Fri Nov 16, 2012 10:44 am

Nice idea! That does make for a somewhat better effect, although the actor will still "pop out" and "pop in" again as the alpha effects are applied. Still looks better than seeing them in their underwear though.

Oh and scratch what I said earlier about levelled lists. In my attempt to create a "raise ghost" type effect I was looking into both ActorRef.Resurrect() and ActorRef.PlaceAtMe(ActorRef.GetLeveledActorBase()) and was getting their effects mixed up. I don't think that resurrecting a levelled actor will cause them to be regenerated.

Would this help to eliminate the naked glitch? Setting the actor's alpha(0.0) before resurrecting, then after the inventory swap set it back to (1.0).

I like the way you went the extra mile to eliminate the NEW items, instead of the old/wanted ones (as my basic solution would have done).. pretty clever, and only another couple lines to achieve!
User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Fri Nov 16, 2012 3:59 pm

Well, as it turns out that isn't going to work either. I think I'll just have to make Allies essential. It resets faction ranks, which are critical to my game.
User avatar
FITTAS
 
Posts: 3381
Joined: Sat Jan 13, 2007 4:53 pm

Post » Fri Nov 16, 2012 8:42 pm

I just glanced quickly through this thread, but I didn't see anyone mention that resurrect does NOT reset their dead status. If you do it fast enough after they die, it's fine. But if a few seconds pass, the game has registered them as dead and resurrect won't change that.

As you've discovered, you'll have to make them essential. At least Skyrim has different levels of essential, which is really nice.
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Fri Nov 16, 2012 4:54 am

What do you mean by "their dead status" here? Do you mean if I Resurrect() someone then IsDead() will continue to return True?

I just glanced quickly through this thread, but I didn't see anyone mention that resurrect does NOT reset their dead status. If you do it fast enough after they die, it's fine. But if a few seconds pass, the game has registered them as dead and resurrect won't change that.
User avatar
Svenja Hedrich
 
Posts: 3496
Joined: Mon Apr 23, 2007 3:18 pm

Post » Fri Nov 16, 2012 4:47 pm

Yup. If you do it fast enough, you're fine. I don't know what the timing is. I know for sure that in Oblivion if you weren't fast enough, then the game would still consider the actor dead and you would see or hear the results of that in rumours. So other NPC's would still talk about the guy being dead.

I've confirmed this for Skyrim too. I have a mod that marks where your horse is. If I was quick enough, I could resurrect Shadowmere and everything worked fine. One time Shadowmere died during a dragon attack and it was several minutes before I could resurrect him. He still worked ok, but the mod couldn't mark his position anymore because it thought he was dead.

So I'd definitely use isDead to determine the status of the actor after using resurrect if you need the game to truly think they are still alive.
User avatar
Richard
 
Posts: 3371
Joined: Sat Oct 13, 2007 2:50 pm

Post » Fri Nov 16, 2012 10:21 am

That's interesting, though I just did a (very quick) bit of testing with this simple magic effect script and I couldn't get it to say "Dead!" when the actor was in fact alive after being resurrected. I wonder if there are some specific circumstances when the dead state gets screwed up.

Event OnEffectStart(Actor akTarget, Actor akCaster)if ( akTarget.IsDead() )   Debug.Notification("Dead!")   akTarget.Resurrect()else   Debug.Notification("Alive!")endIfendEvent

Yup. If you do it fast enough, you're fine. I don't know what the timing is. I know for sure that in Oblivion if you weren't fast enough, then the game would still consider the actor dead and you would see or hear the results of that in rumours. So other NPC's would still talk about the guy being dead.

I've confirmed this for Skyrim too. I have a mod that marks where your horse is. If I was quick enough, I could resurrect Shadowmere and everything worked fine. One time Shadowmere died during a dragon attack and it was several minutes before I could resurrect him. He still worked ok, but the mod couldn't mark his position anymore because it thought he was dead.

So I'd definitely use isDead to determine the status of the actor after using resurrect if you need the game to truly think they are still alive.
User avatar
Toby Green
 
Posts: 3365
Joined: Sun May 27, 2007 5:27 pm

Post » Fri Nov 16, 2012 2:15 pm

A script that quick would probably fall under the 'fast enough' category.. try the test again with a wait(3.0) after the resurrect function. (change the wait accordingly to experiment HOW fast is fast enough, at least on your system with the current load)

That's interesting it gets flagged as dead.. I wonder if there's a way to unflag it; then either alter the nilla resurrect function (renamed for your custom mod of course)... or just unflag it in the script after the 'waiting' is over.

Another way for certain usages could be to set is essential; then have a looping script poll the health level. When it dips low enough, force an anim to simulate death, etc etc. This would only be useful for a very specific and/or custom actor(s).. not if you wanted to be able to apply it to any actor in-game. I suppose you could, but that may really cause drama.
User avatar
Jacob Phillips
 
Posts: 3430
Joined: Tue Aug 14, 2007 9:46 am

Post » Fri Nov 16, 2012 8:29 pm

Well I tried your suggestion, but I still can't get my effect script to spit out "Dead!" while the NPC is still running around and fighting. Using GetDead at the console also correctly identified them as alive, so I seem unable to provoke this bug that's being talked about.

A script that quick would probably fall under the 'fast enough' category.. try the test again with a wait(3.0) after the resurrect function. (change the wait accordingly to experiment HOW fast is fast enough, at least on your system with the current load)
User avatar
STEVI INQUE
 
Posts: 3441
Joined: Thu Nov 02, 2006 8:19 pm

Post » Fri Nov 16, 2012 6:09 am

Personally, I've never seen it or had the use to do such things. I was only commenting on the assumption that AndalayBay knew it happened all the time (ie: not a bug, but just the way the engine works). I don't really have time to mess with it to see for myself, at least not tonight. I suppose it wouldn't take but a few minutes to see though; I'll try and do it up in the morning and post back if I find or can verify anything either way.

[EDIT: It occurred to me that I didn't really need to make a test-mod and write a script to really test this... so I just went in-game, console 'killed' someone, then did a console getDead (1). It's not the Papyrus version isDead, but shouldn't it still return the same value essentially? But I console resurrected dude, immediately opened the console back up again, and getDead showed 0 which is alive. I doubt my pressing the button was fast enough to simulate a fraction of a second in a script, so this isn't really the best thing to go by.]
User avatar
Rob Davidson
 
Posts: 3422
Joined: Thu Aug 02, 2007 2:52 am


Return to V - Skyrim