edhelsereg Posted July 10, 2013 Share Posted July 10, 2013 Hey guys, I have these gloves that must be equipped last to work as intended. I want to force this by adding a script whereby equipping or changing any weapon or armor on the player un-equips and re-equips the gloves right after. I have experimented with the OnObjectEquipped Event, but have had no luck Scriptname KA_GloveEquipSCRIPT extends ObjectReference Armor Property glove AutoEvent OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if akBaseObject as Weapon Debug.Trace("This actor just equipped a weapon!")game.getPlayer().RemoveItem(glove)game.getPlayer().EquipItem(glove) endIfendEvent Could an update/refresh script also do the trick? or maybe a keyword check? Thanks! Link to comment Share on other sites More sharing options...
Pevey Posted July 10, 2013 Share Posted July 10, 2013 You've attached this to the object itself, so it will only unequip and then re-equip every time you equip this particular item--which is circular, and I think not what you really want. You want to unequip and re-equip every time you equip any OTHER item. To capture those events, you could place a small script on the player using a quest alias that catches the OnObjectEquipped event. Link to comment Share on other sites More sharing options...
edhelsereg Posted July 10, 2013 Author Share Posted July 10, 2013 (edited) Thanks! Edit: cut post Edited July 11, 2013 by edhelsereg Link to comment Share on other sites More sharing options...
edhelsereg Posted July 11, 2013 Author Share Posted July 11, 2013 (edited) The script works :biggrin:Last thing, is there a way to hide the unequip and equip messages? Scriptname KA_KonahGloveQSTscript extends ReferenceAlias {This script triggers if you are wearing Konah Gloves and switch any equippable item} Keyword Property VendorItemWeapon Auto Keyword Property VendorItemJewelry Auto Keyword Property VendorItemClothing Auto Keyword Property ArmorHelmet Auto Keyword Property ArmorCuirass Auto Keyword Property ArmorBoots Auto Armor Property Gloves Auto {Konah Gloves} Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) if Game.GetPlayer().IsEquipped(Gloves) Debug.Trace("The player has the gloves equipped") if akBaseObject.HasKeyword(VendorItemWeapon) Debug.Trace("This actor just equipped a weapon!")game.getPlayer().UnequipItem(Gloves)game.getPlayer().EquipItem(Gloves) elseIf akBaseObject.HasKeyword(ArmorHelmet)Debug.Trace("This actor just equipped armor!")game.getPlayer().UnequipItem(Gloves)game.getPlayer().EquipItem(Gloves) elseIf akBaseObject.HasKeyword(ArmorCuirass)Debug.Trace("This actor just equipped armor!")game.getPlayer().UnequipItem(Gloves)game.getPlayer().EquipItem(Gloves) elseIf akBaseObject.HasKeyword(ArmorBoots)Debug.Trace("This actor just equipped armor!")game.getPlayer().UnequipItem(Gloves)game.getPlayer().EquipItem(Gloves) elseIf akBaseObject.HasKeyword(VendorItemJewelry)Debug.Trace("This actor just equipped jewelry!")game.getPlayer().UnequipItem(Gloves)game.getPlayer().EquipItem(Gloves) elseIf akBaseObject.HasKeyword(VendorItemClothing)Debug.Trace("This actor just equipped a clothing!")game.getPlayer().UnequipItem(Gloves)game.getPlayer().EquipItem(Gloves) endIfendIfendEvent Edited July 11, 2013 by edhelsereg Link to comment Share on other sites More sharing options...
IsharaMeradin Posted July 11, 2013 Share Posted July 11, 2013 1. Save yourself some processing time... One time is not a big deal, but multiple calls add up. UseActor Property PlayerRef Auto Then replace all the game.getPlayer() with PlayerRef 2. As for your question... UnEquipItem(Gloves, false, true)EquipItem(Gloves, false, true) http://www.creationkit.com/EquipItem_-_Actorhttp://www.creationkit.com/UnequipItem_-_Actor Link to comment Share on other sites More sharing options...
Recommended Posts