Hi, lets just dive in: Following http://www.cipscis.com/skyrim/tutorials/externalaccess.aspx I'm trying to extend Armor object, by adding functions GetID, SetID and variable myId. I also assigned Actor script to the player Actor form. In this script when player equips armor there should be assigned some id to equipped armor and then this id should be displayed using Debug.Notification(id). Problem is, that when I equip some armor in game it seems to me that GetID doesn't return expected myId value. I even added Debug.Notification("someString") to GetID and SetID but these notifications were never displayed. - What can be wrong with this approach? - Do I have to attach Actor script to Player Actor? I would like to handle OnObjectEquipped or similar event for all equipable armors in game, is there other approach? this script isn't attached to anything:
Scriptname TestArmorChild extends Armor
string myId
Function SetID(string newId)
myId = newId
EndFunction
string Function GetID ()
return myId
EndFunction
this script is attached to player reference alias
Scriptname TestActorEquip extends ReferenceAlias
Armor testArmor
TestArmorChild armorChild
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
testArmor = akBaseObject as Armor
if testArmor
Debug.Notification("Armor equipped")
armorChild = testArmor as TestArmorChild
string id = "TEST"
armorChild.SetID(id)
if armorChild.GetID() == id
Debug.Notification(id)
endif
endIf
endEvent