Problem with function "IsDead"

Post » Tue Jun 19, 2012 11:31 am

Hi, I'm scripting a spell, I need to control if the target is dead. This is the function I wrote:


Event OnStoryCastMagic(ObjectReference akCastingActor, ObjectReference akSpellTarget, Location akLocation, Form akSpell)
Debug.Trace(akSpell + " was cast by " + akCastingActor + " at " + akSpellTarget)
if(akSpellTarget.IsDead())
Debug.Trace(akSpell + " was cast by " + akCastingActor + " at " + akSpellTarget)
endif
EndEvent

What is wrong? Thanks.
User avatar
Sami Blackburn
 
Posts: 3306
Joined: Tue Jun 20, 2006 7:56 am

Post » Tue Jun 19, 2012 7:14 pm

Becouse IsDead works only on the actor
User avatar
Klaire
 
Posts: 3405
Joined: Wed Sep 27, 2006 7:56 am

Post » Tue Jun 19, 2012 2:48 pm

Becouse IsDead works only on the actor

So, how can I make the control script?????
User avatar
Naughty not Nice
 
Posts: 3527
Joined: Sat Nov 04, 2006 6:14 am

Post » Tue Jun 19, 2012 5:31 am

I'm sorry but i don't know, check another scripts may be you will find this function
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Tue Jun 19, 2012 6:11 am

Cast the Target to the Actor object.

if (akSpellTarget as Actor)
if((akSpellTarget as Actor).IsDead())
Debug.Trace(akSpell + " was cast by " + akCastingActor + " at " + akSpellTarget)
endif
endif
User avatar
Ron
 
Posts: 3408
Joined: Tue Jan 16, 2007 4:34 am


Return to V - Skyrim