shadow501 Posted November 11, 2012 Share Posted November 11, 2012 Hi everyone, I'm new to scripting in skyrim and I'm a little bit stuck at the moment: I'm trying to change armor dynamically. Let me show you what I'm doing: Event OnEquipped(Actor akActor) ;irrelevant Code if armorStage < 0.0 akActor.UnequipItem(ArmorStageCurrent, false, true) akActor.RemoveItem(ArmorStageCurrent, 1, true) akActor.AddItem(ArmorStageDown, 1, true) akActor.EquipItem(ArmorStageDown, false, true) endif ;irrelevant Code endEvent The rest of this method is just checking it I should do the reequipping and this script does nothing else. It is attached to every piece of armor involved.So I unequip and remove the current armor and add and equip the next one.Problem is: The OnEquipped event is not called on the next armor.I can fix this by manually unequipping and reequipping the armor in the inventory (then OnEquipped is called again) but that's exactly what I don't want to do. Has anybody had a similar problem? Does anyone know how to fix this? Thanks in advance! Link to comment Share on other sites More sharing options...
KingsGambit Posted November 12, 2012 Share Posted November 12, 2012 Try moving all but the first line unequipping the currrent armor to an OnUnequipped event. You'll need to add a check of some sort to ensure it doesn't fire off every time the armour is unequipped manually, for example: bool ConditionMet = False Event OnEquipped(Actor akActor) if armorStage < 0.0 akActor.UnequipItem(ArmorStageCurrent, false, true) ConditionMet = True endif endEvent Event OnUnequipped(Actor akActor) if (ConditionMet) akActor.RemoveItem(ArmorStageCurrent, 1, true) akActor.AddItem(ArmorStageDown, 1, true) akActor.EquipItem(ArmorStageDown, false, true) endif endEvent It may be that the game doesn't like processing two OnEquipped events at once, so it's worth a try. Functionally the same, just that the part equipping the second armour piece is not itself happening in an OnEquipped event. It may also need declaring more armor properties outside the first event depending on where you set their values originally. Link to comment Share on other sites More sharing options...
Recommended Posts