Reconstructing the Reanimate archetype from scratch.

Post » Thu Jun 21, 2012 8:20 pm

So I am attempting to create a script that will mimic a reanimation spell as closely as possible.


Here are some things that I am trying to accomplish and some issues that I have run into and wish to figure out.


Playing the "animation" where the actor is lifted onto its feet. This is proving to be difficult, I tried sendanimationevent() but I don't think I am doing it right. Does an actor have to first be alive to use this function?

Resurrecting the actor. This is easy enough, but the function seems to "reset" the actor's inventory. How can I retrieve the actor's inventory, when it is dead, so that I can "re-establish" it's inventory after the resurrection?
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm

Post » Thu Jun 21, 2012 8:41 pm

bump!
User avatar
Jesus Lopez
 
Posts: 3508
Joined: Thu Aug 16, 2007 10:16 pm

Post » Thu Jun 21, 2012 3:16 pm

For the second one, you can have an empty container somewhere. Before resurrecting the actor, move all items to the chest. After resurrection, remove all items from the actor, then move all the items in the chest back to the actor.
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Thu Jun 21, 2012 2:15 pm

The problem is that the reanimation screw the AI and the resurrection the model (it creates a new one). Fixing any of the two problems seem equally complicated. You could use RandomNoob's advice and add a fog/explosion effect of some kind to hide the fact that you are spawning a new NPC. The problem is that generic NPCs use to spawn with a different face.
User avatar
Nicole Elocin
 
Posts: 3390
Joined: Sun Apr 15, 2007 9:12 am

Post » Thu Jun 21, 2012 10:10 am

I have tried everything with sendanimationevent I could think of and nothing is working. The reason I am doing this is so that I can basically specify my own AI for the reanimated creature rather than using the default behavior, which should in theory let me use functions like "pathtoref()" and "startcannibal" by suspending any pathing due to packages, along with being able to do things like have the actor wait/follow/attack specific targets.

For your suggestion, what function should I be looking at to "move" items? I see additem, removeitem, and removeallitems(), but the only thing I can think of would require a huge formlist to check for each item from the list in the actors inventory and then move it one item at a time.



-Play the "reanimate" or "reanimatefacedown" animations on the dead actor.
-"clone" their inventory in a container somewhere.
-Resurrect() them.
-Remove all the actors items.
-Add all the items from the container to the actor.
-Remove the actor from all factions.
-Add the actor to some player-friend faction.
-Set the actor's agressiveness and helpfulness.
-Stick the actor in an alias to give it the required packages to behave how I want it to.
-Change the voice type of the actor so that it moans and junk.
-Remove the ability to speak with the actor.


I can do a couple of those things, but I am stuck on most of them, and the two pivotal things that I cannot master are the two problems mentioned in the OP. I appreciate your help.
User avatar
James Smart
 
Posts: 3362
Joined: Sun Nov 04, 2007 7:49 pm

Post » Thu Jun 21, 2012 6:44 am

Could you explain more what you mean when you say that reanimation creates a new model?

Edit: Doh, Removeallitems can transfer items. Silly me. That solves problem 2, kind of. Would there perhaps be some way to duplicate the items instead of removing them? Maybe using Event OnItemAdded on a script on the container to add the items to the source container? Or would that not fire individually since all the items are being moved at once? Basically I would like to avoid having a naked NPC for any length of time.

Oh yea, does anyone know a way to get the condition IsUndead() to return true on an actor that is not undead? Thanks! Looks like changing the voice type will be hard too.
User avatar
JUan Martinez
 
Posts: 3552
Joined: Tue Oct 16, 2007 7:12 am

Post » Thu Jun 21, 2012 8:53 am

Oh yea, does anyone know a way to get the condition IsUndead() to return true on an actor that is not undead? Thanks! Looks like changing the voice type will be hard too.

Ask the SKSE guys to make a SetUndead command. There must be something similar, since the vanilla Reanimate archetype accomplishes it, but we don't have access to it in the CK (afaik).
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Thu Jun 21, 2012 9:56 am

Playing the "animation" where the actor is lifted onto its feet. This is proving to be difficult, I tried sendanimationevent() but I don't think I am doing it right. Does an actor have to first be alive to use this function?

In case anyone is still interested in this, the way to get the actor back on their feet is by:

Debug.SendAnimationEvent(TargetActorRef, "GetupBegin")

You can also catch the exact moment they are fully upright like so in your effect script:

RegisterForAnimationEvent(TargetActorRef, "GetupEnd")Event OnAnimationEvent(ObjectReference akSource, string asEventName)if ( akSource == TargetActorRef && asEventName == "GetupEnd" )	 UnRegisterForAnimationEvent(TargetActorRef, "GetupEnd")	 ; Actor is back on his feet, do more stuff hereendIfendEvent

Once upright they will still be dead as far as the game is concerned, so you'll need to call Resurrect() on them after having taken whatever steps you want to preserve their inventory etc. Be aware that Resurrect() will wipe your magic effect away, so you'll need some other means (like a reference alias) to keep hold of the actor after that.
User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm


Return to V - Skyrim