Jump to content

ecartsiger

Members
  • Posts

    4
  • Joined

  • Last visited

Nexus Mods Profile

About ecartsiger

ecartsiger's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

0

Reputation

  1. armorChild = testArmor as TestArmorChild ;<--Problem is here, this cast returns None but why? string id = "TEST" armorChild.SetID(id) if armorChild.GetID() == id ; getter returns probably empty string but I would expect "TEST"... Debug.Notification(id) endif I have no idea why type cast from Armor (represented by testArmor) to TestArmorChild returns None. Anyone?
  2. Thank you, so I don't have to attach script to actor and OnObjectEquipped event will be still called and it actually works. GOOD. The remaining problem is that type casting does not work for me armorChild = testArmor as TestArmorChild string id = "TEST" armorChild.SetID(id) if armorChild.GetID() == id ; getter returns probably empty string but I would expect "TEST"... Debug.Notification(id) endif
  3. 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
×
×
  • Create New...