Jump to content

How to resurrect a dead actor, but still in ragdoll state?


Recommended Posts

Hi all,

 

I'm wondering if anyone can help - I'm trying to put together my first mod, and making some slow but pleasing progress so far :) Have hit a bit of a challenge though:

 

I want to know if it's possible to resurrect a dead actor that's in a ragdoll state, but for them to actually stand up from that ragdoll once revived as though they were simply recovering from a knocked down state (kinda like the "Reanimate" spell from Syrim's CK.)

 

Is this possible, or is *actor*.Resurrect() only able to totally replace the original dead actor with a brand new reference, thus "popping" it into existence in a standing pose?

 

Thanks!

Link to comment
Share on other sites

Resurrecting actors does not change their reference ID in Fallout 4. Resurrecting is usually not enough, need to recycle(reset) them. Then they become "normal" and you can interact with them. But if they are generic( not unique actors), they can get another body, another appearence. Resurrecing and recycling generic settlers usually changes their model. But the reference stays the same. Resurrecting a unique actor does not cause this issue. I resurrected some named settler whom I accidently killed during an attack.He came back without changes. Has to disable/enable him to get him in clothes.

What about making them standing up...I don`t know how to do this. It has something to do with their animations and placing them in a right place in a right position.

And you can`t resurrect actors who have a "starts as dead" flag. That`s what I`m interested in... Those actors..who start as dead. I don`t want to resurrect them. But I can`t find a way to apply magic effects to them. I can change their state with console commands (scale, disable etc), but a magic effect that works for other dead bodies won`t work for loot corpses. Wondering if their is any way around this.

Link to comment
Share on other sites

Thanks for the reply Kitcat81,

 

I was messing around with the Resurrect function, and was wondering why a character that gets killed for a second time after being resurrected clips through the floor at an awkward angle when in ragdoll, but thanks to your suggestion of using Reset instead, this seems to be fixed. Shame about cycling different appearances and sexes, but there may be a way around that.

 

Sadly I'm not really any closer to having the actor get up from the ragdoll state. I did try setting them to be unconscious after reset, but quickly realised that the SetUnconscious function has nothing to do with ragdolling the actor as I had imagined. Have now tried using PushActorAway to trigger a ragdoll state and a subsequent "get up" routine, but still need to work out how to position the ragdoll in the same position that the dead body was in previously. Simply passing position data to the Actor after ragdolling freezes it in a sort of "flying" position, hovering about a metre above ground!

 

Oh, and thanks for the tip about the reference IDs - managed to transfer control over to the new instance of the Actor using GetFormID and GetForm :smile:

Edited by ChunkeeMunkee
Link to comment
Share on other sites

Not all all :smile:. I was tinkering with it myself.

Sometimes there is no need to "reset" , the actor is normal and talking without it. Not sure what it related to, have not tested it enough. If it`s a settler, he looses his assignment to the settlement so you have to "move" him in workshop mode. If an actor had some body parts dismembered , he will look totally broken after resurrecting...his limbs will follow him on the ground. And the only way I know to fix it is to reset the reference, which can change the model( if the actor is templated). Maybe there are some other ways...but I don`t know about them.

Not sure that I understood about the control over new instance. If you mean to get control over the resurrected actor...you dont need to do this. For the game it`s the same actor. If it`s all in one script then it can look like :

akActor.resurrect()

akActor.reset()

akActor.addtofaction(your faction) or something else that you need to do with him. The game does not lose control over the reference. But maybe you meant someting else, sorry then .

 

 

In theory to put an actor in the same place you need to get his coordinates before resurrecting. But I don`t know if it`s possible at all and what functions to use for it.

Edited by kitcat81
Link to comment
Share on other sites

  • 1 month later...

I experimented with resurrect and reset in my zombie mod and noticed some of the same quirks. Resurrect would sometimes result in an immobile actor in a strange state and reset would fix this but change clothing/looks if templated (like a Raider). I also ran into the weird clipping issue when the actor was killed a second time. Also note that limbs are magically healed with reset as well (if that matters to you).

 

I ended up going down a different path, but I'm not happy with it. I spawned a separate Actor and then worked to transfer things like clothing to it. The problem here is this process is a bit slow and the available CK functions (outside of F4SE) make it difficult. Transferring items seems to require draining the inventory on the corpse to populate the new actor. You can register a listener to check if the item is equippable and equip it (I used a form list of keywords to check for). Also, why are there setters with no getters sometimes (eg. you can change/remove a head part but not get them)? F4SE would probably help, but I really want to maintain console support.

 

Maybe there are alternatives to cloning an actor that I just don't know about?

Edited by joefor
Link to comment
Share on other sites

  • Recently Browsing   0 members

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