Is there a way to extract an actor from this akAggressor &#3

Post » Tue Jun 19, 2012 3:33 pm

Trying to do this:


Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)ifif (akAggressor.GetEquippedItemType(1) == 0);do stuffendifendevent

I get this compile error:

c:\games\steamapps\common\skyrim\Data\Scripts\Source\temp\aadpActorCombatScript.psc(34,20): GetEquippedItemType is not a function or does not exist
c:\games\steamapps\common\skyrim\Data\Scripts\Source\temp\aadpActorCombatScript.psc(34,43): cannot compare a none to a int (cast missing or types unrelated)


is there a way to extract an actor from this akAggressor "object ref"?

I tried this and got another error:

actor attacker
attacker = akAggressor

I get this compile error:
c:\games\steamapps\common\skyrim\Data\Scripts\Source\temp\aadpActorCombatScript.psc(20,0): type mismatch while assigning to a actor (cast missing or types unrelated)
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Tue Jun 19, 2012 10:15 am

Yep, if an http://www.creationkit.com/ObjectReference_Script can also be an http://www.creationkit.com/Actor_Script, then you can cast it to an Actor:
(akAggressor as Actor).GetEquippedItemType(1)
If the ObjectReference can't be successfully cast to an Actor, then the result of the cast will be None.

Cipscis
User avatar
Cayal
 
Posts: 3398
Joined: Tue Jan 30, 2007 6:24 pm

Post » Tue Jun 19, 2012 9:15 am

Thanks again, with your help I was able to put out my latest rev before I had to go to bed! Wow, the entire week end moding. over 16 hours... I need some water.... :happy:
User avatar
carly mcdonough
 
Posts: 3402
Joined: Fri Jul 28, 2006 3:23 am


Return to V - Skyrim