Create an activator on an actor when he's dead

Post » Sat Nov 17, 2012 7:43 am

Hey guys, I'm working out the details on a suggested idea for my hunting mod, which is to create a trophy from your kill. What I want to do is have the player remove an animals head when it's dead, which I'll later allow to be mounted. I can make activators and stuff like that :smile:

There are 2 ways I can go about it. 1 is to create a unique item on the animal that can be used in scripting to make a head. 2 is to simply make an activator, which has a choice of to Remove Head and Dispose of Body.

My question is, how can I make that activator for the animal, when he can be killed in a large area and won't die in the same place twice? Is there a way to add/enable the activator on the animal when he dies?

Thanks guys :smile:
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm

Post » Sat Nov 17, 2012 9:24 am

Actually that seems really messy. Is it possible to disable viewing the animal's inventory, instead making an activator with the option to take it's head + dispose of corpse (for example), which in turn disables the animal so it's no longer there?

(I can do activate scripts, and disable scripts)
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Fri Nov 16, 2012 11:38 pm

I think you could use an OnDeath script that would look like this:
Event OnDeath(Actor akKiller)Disable()EndEvent
This disables the Npc once they die meaning you can't interact with them or search them.

I actually think you should just keep the bodies loot-able and just have a menu pop up when they search the bodies asking if you would like to keep as a trophy, because I'm not sure why you wouldn't be able to loot the animal just because you want it as a trophy. Not to mention some people might not like the fact that they can no longer collect loot from the animals effected by this mod.
User avatar
Shirley BEltran
 
Posts: 3450
Joined: Wed Jul 26, 2006 4:14 pm

Post » Sat Nov 17, 2012 9:30 am

I think you could use an OnDeath script that would look like this:
Event OnDeath(Actor akKiller)Disable()EndEvent
This disables the Npc once they die meaning you can't interact with them or search them.

Thanks Steez. Would it then be possible to enable an activator on the creature do you think? Maybe as an aliases, created ON the animal (similar to how IN makes the alias - like an item - get created inside the animal)?
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Sat Nov 17, 2012 7:31 am

Actually that seems really messy. Is it possible to disable viewing the animal's inventory, instead making an activator with the option to take it's head + dispose of corpse (for example), which in turn disables the animal so it's no longer there?

(I can do activate scripts, and disable scripts)

It seems like disabling the animal's inventory and placing the activator would be easy IF you have your own script running on the animal.

With what I know (meaning, there's a LOT I still need to learn) about the CK, this is how I would do it:
1. Create an alias in the quest
2. Attach a script to that alias and create your OnDeath event - now you can do whatever you want and use the http://www.creationkit.com/BlockActivation_-_ObjectReference if needed.
3. When hunting, force the animal target in to the alias.

Another way to do it, with less coding, would be to simply add the "head" to the animal's (actor) death item. If you don't want to modify each actor in the CK, then probably would use the alias and add the item on death. (As a player, I would expect to activate the corpse as normal and find the head as an item, but I don't know the full context of your mod.)
User avatar
The Time Car
 
Posts: 3435
Joined: Sat Oct 27, 2007 7:13 pm

Post » Sat Nov 17, 2012 6:06 am

Well if you just don't want the player to loot them you could use a remove all items script, then have a messagebox pop up when they try to search the animal. I agree with Sollar and think that putting the animals head in their inventory is a good solution to this and wouldn't require any menus. The player could just simply choose to take the head as a trophy from the animal's inventory. The only problem with this is making the animal headless once the player takes the head from the inventory.
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Sat Nov 17, 2012 5:32 am

The only problem with this is making the animal headless once the player takes the head from the inventory.

That's why I'm thinking of doing it as an activation, because it seems too false if the player can remove the head item, and the body still be intact. Which is why I was thinking of "disposing of the body" Morrowind style.

However, I could maybe just instruct (in the manual for the mod ingame) that when the player removes the trophy, the body is disposed of also. (to make more realistic, perhaps I could also add to the player's inventory the Pelt etc, so it seems the player has skinned the animal for all they can)
User avatar
Andrew Perry
 
Posts: 3505
Joined: Sat Jul 07, 2007 5:40 am

Post » Sat Nov 17, 2012 12:33 pm

Well if you want to do that you could use a OnContainerChanged script or something like that.
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Sat Nov 17, 2012 4:58 am

Well if you want to do that you could use a OnContainerChanged script or something like that.

Yea man I think that's what I'll use. OnContainerChanged(trophy item)
-Disable the animal
-Add to inventory say 1 pelt and 2 meat, plus trophy quest object

Seems pretty straightforward. Using aliases will make things easier :)
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Fri Nov 16, 2012 10:48 pm

That's why I'm thinking of doing it as an activation, because it seems too false if the player can remove the head item, and the body still be intact. Which is why I was thinking of "disposing of the body" Morrowind style.

However, I could maybe just instruct (in the manual for the mod ingame) that when the player removes the trophy, the body is disposed of also. (to make more realistic, perhaps I could also add to the player's inventory the Pelt etc, so it seems the player has skinned the animal for all they can)

Also, keep in mind, even in vanilla, taking all the meat from the animal still leaves the body intact... not totally real either. Are you making it so the player can get trophies from any game or just specific animals? If you really wanted realistic, maybe you could use the "decapitation" effect when they loot the head? I've seen this option in the CK. If it were me though, I think I would just make removing the head clean up the whole body.
User avatar
Darian Ennels
 
Posts: 3406
Joined: Mon Aug 20, 2007 2:00 pm

Post » Sat Nov 17, 2012 1:14 am



Also, keep in mind, even in vanilla, taking all the meat from the animal still leaves the body intact... not totally real either. Are you making it so the player can get trophies from any game or just specific animals? If you really wanted realistic, maybe you could use the "decapitation" effect when they loot the head? I've seen this option in the CK. If it were me though, I think I would just make removing the head clean up the whole body.

Yea mate see my above post :) and just on a beast for a hunting quest, not all animals.
User avatar
Darlene Delk
 
Posts: 3413
Joined: Mon Aug 27, 2007 3:48 am

Post » Sat Nov 17, 2012 1:25 am

Yea mate see my above post :smile: and just on a beast for a hunting quest, not all animals.

I didn't see it. I guess I took to long to reply ;) I'm glad you have it figured out!
User avatar
[ becca ]
 
Posts: 3514
Joined: Wed Jun 21, 2006 12:59 pm

Post » Sat Nov 17, 2012 12:17 pm

If you want an Activator to appear in lieu of a dead creature; that's possible. Of course you need to create a custom Activator object; then in the script assign it its own property. Then in your onDeath event you'd .disable or setAlpha. Next line would be placeAtMe... then the line after that would be needed to correct any strange angles that may have occured in the process.

This would be attached to whichever actor you want it to be.
Spoiler

scriptName deadAnimalHeadScript extends actorobjectReference tempActactivator property yadaYada autoevent onDeath   ;or onContainerChanged as mentioned above, like if you want some carcass to appear after looting it  self.disable()  ;or self.setAlpha(0.0)  tempAct = self.placeAtMe(yadaYada)  tempAct.setAngle(0.0, 0.0, self.getAngleZ())   ;or whatever you want the angles to do... ths line not even needed if your headMesh has havok collision - just let it roll around  self.delete()endEvent
User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm


Return to V - Skyrim