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.
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.
Seems to work fine for me:
log output --
[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:
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
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.
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.