Script on Item that unequips it when Actor dies

Post » Wed Jun 20, 2012 6:01 pm

I'm currently making the skeletons in Skyrim wear Helmets, Ring, Amulets etc. This works perfectly fine when they're alive, but as soon as the skeletons die and their bones fall apart, the items get stretched between skull and ribcage when these bones fall apart since the helmets are attached to those parts

So I was thinking of a script on every helmet (preferably always the same script, if that's possible) that unequips the helmet when the skeleton dies, leaving it in the inventory for the player to loot it and preventing the glitching of the mesh.

The problem is that I'm really bad at scripting, so I really need your help!

Any ideas how to approach this problem?

Cheers
Phil
User avatar
Monika Krzyzak
 
Posts: 3471
Joined: Fri Oct 13, 2006 11:29 pm

Post » Wed Jun 20, 2012 8:42 pm

bump
User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm

Post » Wed Jun 20, 2012 2:57 pm

event OnDeath()   Skeleton.UnequipAll()endEvent

EDIT: Oh, you want it on the item. Hmmm. Dunno, I'd do it on the actor though, as that takes care of all of their stuff.
User avatar
Amy Masters
 
Posts: 3277
Joined: Thu Jun 22, 2006 10:26 am

Post » Wed Jun 20, 2012 8:33 pm

hmm...I guess I could run it on the actor but then it would also unequip his weapon and shield...is there a way just to unequip the helmet?
User avatar
Your Mum
 
Posts: 3434
Joined: Sun Jun 25, 2006 6:23 pm

Post » Wed Jun 20, 2012 5:58 pm

Force equip, OnDeath(), an innocuous, unplayable ARMO form that uses the same slot?
User avatar
Richard Dixon
 
Posts: 3461
Joined: Thu Jun 07, 2007 1:29 pm

Post » Wed Jun 20, 2012 5:55 pm

I guess that could work...I'm testing it out right now

EDIT: no idea how to script -.-
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Wed Jun 20, 2012 5:36 pm

ScriptName YourScript extends ActorArmor Property InnocuousARMO AutoEvent OnDeath(Actor akKiller)	EquipItem(InnocuousARMO, True)EndEvent
User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am

Post » Wed Jun 20, 2012 5:45 pm

The skeleton wears the innocuous armor from the beginning, any way to prevent it from wearing it before his death?
User avatar
john palmer
 
Posts: 3410
Joined: Fri Jun 22, 2007 8:07 pm

Post » Wed Jun 20, 2012 3:02 pm

Make sure the other item has a higher armor rating. The skeleton should preferentially wear whatever's more protective or don't give it to them in the editor and let the script do it.

Note: http://www.creationkit.com/EquipItem_-_Actor will give the actor akItem in the event they've not already got one.

*Adds note
User avatar
Alan Cutler
 
Posts: 3163
Joined: Sun Jul 01, 2007 9:59 am

Post » Wed Jun 20, 2012 9:07 pm

Sctipt works now, the skeleton doesn't want to equip the armor...the helmet is still on his head after dying

EDIT: the initial helmet is part of the outfit, can those items even be unequipped?

EDIT: The skeleton now has no helmet at all and when it dies, it should equip a hide helmet (for testing purposes)...but nothing happens, it refuses to wear the helmet.
User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Wed Jun 20, 2012 5:49 pm

Event OnDeath(Actor akKiller)EndEvent
Edit: Are you certain the biped slots are shared?
User avatar
Angela
 
Posts: 3492
Joined: Mon Mar 05, 2007 8:33 am

Post » Wed Jun 20, 2012 11:55 am

Yes I am, since now the armor to be equipped is a playable helmet. If the helmet was part of the outfit the skeleton would have no problem wearing it...

just to make sure: the script has to be attached to the skeleton right?
User avatar
Roberto Gaeta
 
Posts: 3451
Joined: Tue Nov 06, 2007 2:23 am

Post » Wed Jun 20, 2012 1:31 pm

Script on skeleton: Yeah

Try tinkering with the armor rating and making the unplayable one more protective, but only add it with the script so they'll not have it until dead? By the same token equipping a dagger will remove a two handed sword, the added ARMO should unequip the previously equipped one, then not be available to take when looting.

You could use http://www.creationkit.com/DropObject_-_ObjectReference
User avatar
Brittany Abner
 
Posts: 3401
Joined: Wed Oct 24, 2007 10:48 pm

Post » Wed Jun 20, 2012 2:47 pm

I added a line to the script "UnequipAll"...and even then the helmet stays on the skeleton's head...I kinda have the feeling that the script doesn't make it into the game

EDIT: I change OnDeath to OnDying and now the "UnequipAll" works perfectly fine...still the other helmet doesn't want to be equipped...maybe I'll just use the "UnequipAll"

EDIT: OMG I totally forgot to define the "Innocuous Armor" as a property
User avatar
Claudia Cook
 
Posts: 3450
Joined: Mon Oct 30, 2006 10:22 am


Return to V - Skyrim