I meant using global on any variables that are intended to be. Like maybe '_LastDirection'.
There has been a long standing issue with arrays of UDTs.
Instead of directly using the array element (as in '_Equip[_LastDirection].playerFrame') make a local copy of the UDT at _Equip[_LastDirection] and then use that copy in the function call. This was one of the ways I fixed a lot of my UDT array issues.
Something like this for strictly reading the values:
locvar AS <udttype of _Equip>
...
locvar = _Equip[_LastDirection]
SetSpriteFrame(_Player.sprite,locvar.playerFrame)
And, to update a value
locvar AS <udttype of _Equip>
...
locvar = _Equip[_LastDirection]
// operations that update the values in locvar
// store back
_Equip[_LastDirection] = locvar
It's awkward and a pain, but it also might clear up the mystery error.
One of the reasons I finally went over to Tier 2 was because of all the problems that occurred around strings (in general) and UDTs.
Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master