Difference between revisions of "Talk:IsEquipped - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>VampireMonkey
(Created page with "This doesn't seem to work if you're dual wielding and trying to get the weapon in the Left hand, works perfectly for the right hand. --~~~~")
 
imported>Dwj1pOvxv
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:


--[[User:VampireMonkey|VampireMonkey]] ([[User talk:VampireMonkey|talk]]) 2014-11-19T19:50:47 (EST)
--[[User:VampireMonkey|VampireMonkey]] ([[User talk:VampireMonkey|talk]]) 2014-11-19T19:50:47 (EST)
Try using [[GetEquippedItemType - Actor]] as a work around. Have it check for the left hand, and then have it check for the type of weapon equipped. Also try [[GetEquippedWeapon - Actor]] if you don't get your results from GetEquippedItembyType. --[[User:Terra Nova2|Terra Nova2]] ([[User talk:Terra Nova2|talk]]) 2014-11-20T10:36:36 (EST)
I ended up using
<source lang="papyrus">(PlayerRef.IsEquipped(akBaseObject) || PlayerRef.GetEquippedObject(0) == akBaseObject)</source>
having [[GetEquippedObject - Actor]] check the left hand, this worked without any issues.
--[[User:VampireMonkey|VampireMonkey]] ([[User talk:VampireMonkey|talk]]) 2014-11-20T21:28:48 (EST)
As mentioned already, [[GetEquippedWeapon - Actor]] is what you want. AND you want to call it twice. Once for left hand. Once for right hand. Calling one function twice beats forcing the compiler to load two functions on to the stack every time.

Latest revision as of 03:46, 3 July 2015

This doesn't seem to work if you're dual wielding and trying to get the weapon in the Left hand, works perfectly for the right hand.

--VampireMonkey (talk) 2014-11-19T19:50:47 (EST)

Try using GetEquippedItemType - Actor as a work around. Have it check for the left hand, and then have it check for the type of weapon equipped. Also try GetEquippedWeapon - Actor if you don't get your results from GetEquippedItembyType. --Terra Nova2 (talk) 2014-11-20T10:36:36 (EST)

I ended up using

(PlayerRef.IsEquipped(akBaseObject) || PlayerRef.GetEquippedObject(0) == akBaseObject)

having GetEquippedObject - Actor check the left hand, this worked without any issues. --VampireMonkey (talk) 2014-11-20T21:28:48 (EST)

As mentioned already, GetEquippedWeapon - Actor is what you want. AND you want to call it twice. Once for left hand. Once for right hand. Calling one function twice beats forcing the compiler to load two functions on to the stack every time.