Taking item from dead body make the body disappear

Post » Tue Jun 19, 2012 4:48 am

Everything is in the title.

I don't even know where to begin with this, already is set up i just need a hand with the script :

1. Kill someone
2. Take his ribcage
3. His ribcage is now in your inventory
( Those three steps are already working )
4. His body disappear
5. A new object appear at the place of his body

I just need some help for the two last steps. Thanks.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Tue Jun 19, 2012 3:05 am

Hmm, maybe you could use the PlaceAtMe function to place the new object and the Disable function to hide they body?
User avatar
Red Sauce
 
Posts: 3431
Joined: Fri Aug 04, 2006 1:35 pm

Post » Tue Jun 19, 2012 4:37 am

Use an OnObjectRemoved event on a script on the body, or an OnContainerChange event on the script on the ribcage, and you can catch when the bones are taken. Then you can use Disable and PlaceAtMe to remove his body and place a new one. The Necromancer's amulet (MS11InnocuousAmulet) is a good starting point, as the amulet is set up to advance the quest when you pick it up- you just need to copy that and change it to disable the old container and PlaceAtMe a new one.
Give it a shot and post however far you've got with your script if you can't get it to work.
User avatar
Milagros Osorio
 
Posts: 3426
Joined: Fri Aug 25, 2006 4:33 pm

Post » Tue Jun 19, 2012 9:19 am

Can't manage to do [censored].

My skills in scripting are way too light to do anything.

Can't you just give me a dummy script that looks like i should do ? Maybe i ask a little bit too much, but all this scripting business is like chinese.
User avatar
Jade MacSpade
 
Posts: 3432
Joined: Thu Jul 20, 2006 9:53 pm

Post » Tue Jun 19, 2012 6:43 am

ScriptName BloodyRibcageScript extends WhateverMiscObject Property BloodyRags01 AutoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)	If akNewContainer == Game.GetPlayer()		akOldContainer.PlaceAtMe(BloodyRags01, 1)		akOldContainer.Disable()	EndIfEndEvent
User avatar
xemmybx
 
Posts: 3372
Joined: Thu Jun 22, 2006 2:01 pm

Post » Tue Jun 19, 2012 11:18 am

Thank you very much Justin.

Just an issue, the script is running flawlessly, the dead body disappear without any problem, but sadly the object doesn't.

I've probably done goofed, cause i'm basically a total [censored] when it comes to scripting :

Scriptname BloodyRibcageScript extends ObjectReferenceForm Property BloodyRags01 AutoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)		If akNewContainer == Game.GetPlayer()				akOldContainer.PlaceAtMe(BloodyRags01)				akOldContainer.Disable()		EndIfEndEvent
User avatar
Jennie Skeletons
 
Posts: 3452
Joined: Wed Jun 21, 2006 8:21 am

Post » Mon Jun 18, 2012 9:45 pm

MiscObject Property BloodyRags01 Auto

Be sure to fill the property so it points to BloodyRags01.
User avatar
Sakura Haruno
 
Posts: 3446
Joined: Sat Aug 26, 2006 7:23 pm

Post » Tue Jun 19, 2012 1:24 am

Awesome thanks. Work fine now.

Since you are here, what should i add to have " more " objects appearing, like three of four when the ribcage is taken ?

Just adding this line and modifying the property for another miscitem ?

	akOldContainer.PlaceAtMe(BloodyRags01)
User avatar
Kelly James
 
Posts: 3266
Joined: Wed Oct 04, 2006 7:33 pm

Post » Tue Jun 19, 2012 12:32 am

More properties and more PlaceAtMe()
User avatar
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Mon Jun 18, 2012 7:52 pm

And that's it, it works.

Thanks again for the help Justin.
User avatar
James Hate
 
Posts: 3531
Joined: Sun Jun 24, 2007 5:55 am

Post » Tue Jun 19, 2012 5:41 am

Ok, everyhing is now working fine with the script. I'm just running into a problem, but not related to the script, i think.

I've set my ribcage in a leveleditem called DeathItemHumanParts so every human NPC have this in their inventory when they're dead.

So the script is trigger /playing flawlessly on the first person i kill and take the ribcage, but not on the other ones, the script doesn't play at all.

Why ?
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Post » Mon Jun 18, 2012 10:12 pm

Nevermind, i'm dumb.

If you got already a ribcage in your inventory, of course the script will not trigger one more time since it's based on this exact item being present or not in the player inventory.
User avatar
Elena Alina
 
Posts: 3415
Joined: Sun Apr 01, 2007 7:24 am


Return to V - Skyrim

cron