very bad GetEquippedItemType(0) issue ?

Post » Sat Mar 15, 2014 10:46 pm

This is really strange. I have been using attacker.GetEquippedItemType(0) for a very long time but just tonight I have seen a very bad issue.

WepUsedRight = ActorRef.GetEquippedItemType(1)
WepUsedLeft = ActorRef.GetEquippedItemType(0)
debug.messagebox(WepUsedRight) <-- this is reporting correctly.
debug.messagebox(WepUsedfLeft) <-- this is reporting ZERO (0) no mater what I equip in my left hand !!??
Would some other person PLEASE confirm this? I would really like confirmation by another modder before I ask the SKSE guys about this to see if it is a bug in SKSE's replaced scripts.
I am using SKSE REV 1.6.16
User avatar
Kathryn Medows
 
Posts: 3547
Joined: Sun Nov 19, 2006 12:10 pm

Post » Sat Mar 15, 2014 8:57 pm

Seems to work fine for me:

log output --

Spoiler
[03/15/2014 - 09:44:58AM] akBaseObject == Holy Stalhrim Greatsword[03/15/2014 - 09:44:58AM] GetEquippedItemType(1) [right] == 5[03/15/2014 - 09:44:58AM] GetEquippedItemType(0) [left]  == 5;I equipped this in the right hand ------------------------->[03/15/2014 - 09:45:01AM] akBaseObject == Iron Sword[03/15/2014 - 09:45:01AM] GetEquippedItemType(1) [right] == 1[03/15/2014 - 09:45:01AM] GetEquippedItemType(0) [left]  == 0[03/15/2014 - 09:45:01AM] ;I then equipped this in the left hand --------------------->[03/15/2014 - 09:45:02AM] akBaseObject == Iron War Axe[03/15/2014 - 09:45:03AM] GetEquippedItemType(1) [right] == 1[03/15/2014 - 09:45:03AM] GetEquippedItemType(0) [left]  == 3[03/15/2014 - 09:45:03AM] ;I then equipped the shield to the left hand --------------->[03/15/2014 - 09:45:08AM] akBaseObject == Iron Shield[03/15/2014 - 09:45:08AM] GetEquippedItemType(1) [right] == 1[03/15/2014 - 09:45:09AM] GetEquippedItemType(0) [left]  == 10[03/15/2014 - 09:45:09AM] 

from this test script:

Spoiler
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)	debug.trace("\n\n")	debug.trace("akBaseObject == " + akBaseObject.getName())	debug.trace("GetEquippedItemType(1) [right] == " + playerRef.GetEquippedItemType(1))	debug.trace("GetEquippedItemType(0) [left]  == " + playerRef.GetEquippedItemType(0))	debug.trace("\n\n")EndEvent

I don't think it would be an SKSE issue, because it's a vanilla function, and its not included in or modified by SKSE at all

User avatar
Soku Nyorah
 
Posts: 3413
Joined: Tue Oct 17, 2006 1:25 pm

Post » Sun Mar 16, 2014 3:30 am

Thank you very very much for taking the time to check this!

I am happy it is just me, I can fix that! I just have to find out what is going on now.

I have looked at this for an hour, maybe I am just too tired. I will look at it again after some sleep.

User avatar
D LOpez
 
Posts: 3434
Joined: Sat Aug 25, 2007 12:30 pm

Post » Sat Mar 15, 2014 9:39 pm

Always a good idea :thumbsup:

User avatar
Teghan Harris
 
Posts: 3370
Joined: Mon Mar 05, 2007 1:31 pm

Post » Sun Mar 16, 2014 4:00 am

I think it MIGHT still be a SKSE "issue

Event OnControlDown(string control)If doonce == 1If control == "Left Attack/Block" || control == "Right Attack/Block"Range =pell.Getdistance(Attacker) if Range <= 300.0 GoToState("BusyState")WepUsedRight = attacker.GetEquippedItemType(1)WepUsedLeft = attacker.GetEquippedItemType(0)debug.messagebox(WepUsedfLeft);<---   Reports 0 (zero)if WepUsedRight >= 7if !playerref.getAnimationVariableBool("IsBashing")GoToState("NormalState")ReturnendifendifContinue = trueFlankAngle = pell.GetHeadingAngle(attacker)StartAngle = attacker.GetAnglex();Curxpos = pell.GetPositionX();Curypos = pell.GetPositiony()WaitForSwingChange()endifendifendifGoToState("NormalState")EndEvent 

So DURING the on control down event (from SKSE ) this still reports ZERO, but in any other script (not using the on control down functions, say using a "on hit" event instead) it reports 10 as it should.

Could be that the "time" that the controller is down "magic" happens is sooner than the fact that the player has a shield in their left hand is "hooked in" ?

I have no idea. I will test more later after sleep. But now I have some kind of lead for me to start on after I do sleep.

User avatar
Trevi
 
Posts: 3404
Joined: Fri Apr 06, 2007 8:26 pm

Post » Sat Mar 15, 2014 7:10 pm

well in case you cant get it to work, maybe a combination of GetEquippedShield/GetEquippedWeapon and GetWeaponType could work too, though slightly less efficient :-/
User avatar
c.o.s.m.o
 
Posts: 3419
Joined: Sat Aug 12, 2006 9:21 am


Return to V - Skyrim