[Script] script that always Fires if someone dies. Dynamical

Post » Tue Jun 19, 2012 10:29 pm

Hi there i want to make a script that Fires every time when someone dies.
I found the right event already

Event OnDeath(Actor akKiller)  if (akKiller == Game.GetPlayer())    Debug.Trace("We were killed by the player!")  endIfendEvent

but where do i have to add the script?
it wouldnt be the solution that i add a the script manually to every actor :wink:
User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Post » Tue Jun 19, 2012 4:02 pm

Mmm, it kinda is.
User avatar
Tanya
 
Posts: 3358
Joined: Fri Feb 16, 2007 6:01 am

Post » Tue Jun 19, 2012 5:02 pm

rofl xD no other solution?
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Tue Jun 19, 2012 10:44 am

Use the Story Manager's Kill Actor Event. In the CK, Character -> SM Event Nodes -> Kill Actor Event, http://www.creationkit.com/Story_Manager for info on it. Have it trigger a quest every time an actor dies, and have your script on that quest.
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Tue Jun 19, 2012 8:46 am

There may be another solution, but the event you found is an Actor event, which means the OnDeath() event only fires if the script is attached to the actor whose death you want to respond to.

Poking around the Wiki, I would try using the radiant story system to respond to "kill actor" story manager events.
User avatar
Jon O
 
Posts: 3270
Joined: Wed Nov 28, 2007 9:48 pm

Post » Tue Jun 19, 2012 9:35 am

thx, looks great :wink:

what is the global value for player level? Oo
User avatar
Dustin Brown
 
Posts: 3307
Joined: Sun Sep 30, 2007 6:55 am

Post » Tue Jun 19, 2012 6:41 pm

.GetLevel() will get the level of an actor, game.GetPlayer().GetLevel() would get the players level if thats what u want
User avatar
Mike Plumley
 
Posts: 3392
Joined: Wed Sep 05, 2007 10:45 pm


Return to V - Skyrim