Hello. I have a simple script that equips a different armor when you unequip the first and removes the first armor.
I can get it to work by passing a reference to the armor into the script. But, it doesn't seem very elegant to have to do that. I tried using "Self". But, that seems to reference the script rather than the Armor that "RemoveItem" needs to work.
Is there a way to accomplish this without sending in a reference to itself?
Here is the script:
Scriptname ArmorSwitcherScript extends ObjectReference
Armor Property ArmorRef Auto
Armor Property nextState Auto
Event OnUnequipped(Actor akActor)
akActor.EquipItem(nextState)
akActor.RemoveItem(Self) ;Does not work like this. Does work if I change Self to ArmorRef and populate that with the Armor the script is attached to.
EndEvent
I have a feeling that there is some casting that needs to happen here. Tried several combinations but none of them worked.
Any help would be greatly appreciated!