I first tried to cast the reference as a form. That returns none. I then tried to use GetBaseObject (though I have a feeling that's not what it's for). That also returned none. I then tried to do the following...
Game.GetForm(GetFormID())
That returned none as well. So I did a little debugging, and found that "Self as String" gives "[ScriptName
So how the heck am I supposed to get the form of the armor the script is running on? The only way I've found to do it is the SKSE command "GetWornForm" which works fine for the "OnEquip" event, but the only way to get it to work for the "OnUnequip" event is to do this....
Event OnUnequipped(Actor akActor)Armor ArmorBak = (akActor.GetWornForm(0x00000004) as Armor)akActor.EquipItem(Self)Armor TheArmor = (akActor.GetWornForm(0x00000004) as Armor)akActor.UnEquipItem(Self)akActor.EquipItem(ArmorBak)
Needless to say, all the equipping and unequipping here wreaks havoc on my script, which I might be able to deal with, but I'd rather avoid it if possible.
It occurs to me that there's an SKSE function that gets the form of the nth object in a container. It also occurs to me that the script somehow knows what n is, because it told it to me in a string. Is there any way to get that number other than casting the object reference as a string?