attacker.IsEquipped(aadpHammer) why not working?

Post » Wed Jan 01, 2014 4:18 pm

This worked:

WEAPON Property aadpHammer Auto

HasHammer = false
if (attacker.GetEquippedWeapon() == aadpHammer)
HasHammer = true
elseif (attacker.GetEquippedWeapon(true) == aadpHammer)
HasHammer = true
endif
Why was this not working :
WEAPON Property aadpHammer Auto
HasHammer = attacker.IsEquipped(aadpHammer)
The aadpHammer was in the left hand for testing. Will .IsEquipped() not work for left hand weapons?
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm

Post » Thu Jan 02, 2014 12:26 am

What is the complile error.

User avatar
Calum Campbell
 
Posts: 3574
Joined: Tue Jul 10, 2007 7:55 am

Post » Wed Jan 01, 2014 6:45 pm

Where did you define attacker?

Actor(Base) attacker = attacker.GetActorBase() as Actor(Base)

HasHammer = attacker.IsEquipped(aadpHammer)

or

Actor(Base) attacker = attacker.GetActorBase().IsEquipped(aadpHammer) as Actor(Base)

User avatar
Suzie Dalziel
 
Posts: 3443
Joined: Thu Jun 15, 2006 8:19 pm

Post » Wed Jan 01, 2014 1:37 pm

No compile error, it would just not detect the hammer in the game.

I defined attacker with the OnHit event.

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, Bool abPowerAttack, Bool abSneakAttack, Bool abBashAttack, Bool abHitBlocked)
Attacker = akAggressor As Actor
HasHammer = attacker.IsEquipped(aadpHammer)
endevent
The above was absolutely useless!
But the one below worked:
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, Bool abPowerAttack, Bool abSneakAttack, Bool abBashAttack, Bool abHitBlocked)
Attacker = akAggressor As Actor
HasHammer = false
if (attacker.GetEquippedWeapon() == aadpHammer)
HasHammer = true
elseif (attacker.GetEquippedWeapon(true) == aadpHammer)
HasHammer = true
endif
endevent
User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am


Return to V - Skyrim