fenrato Posted August 13, 2019 Share Posted August 13, 2019 Hi. Is it possible using a papyrus script to have an armor item change its ArmorAddon (the actual physical mesh reference) on certain conditions, like player.isWeaponDrawn or IsInCombat?Ideally I want a pair of gauntlets to 'transform' either when in weapon-drawn state, or when the player enters combat. The actual gauntlets themselves wouldn't change armor value or become a different item- just the AA would change. I don't know anything about scripting and what I've read of it is overwhelming for me.Thank you for your time and perhaps efforts. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 14, 2019 Share Posted August 14, 2019 SKSE has SetModelPath for armor addon NIF files. Please note that it will affect ALL instances of the armor as such it may not be of much use (unless there will be only one instance). May need to use QueueNiNodeUpdate after setting the new model path, especially if already equipped. Link to comment Share on other sites More sharing options...
Araanim Posted May 18, 2020 Share Posted May 18, 2020 Any luck figuring this out? I'm actually trying to do something very similar. Link to comment Share on other sites More sharing options...
dylbill Posted May 18, 2020 Share Posted May 18, 2020 (edited) Hey, so I tested and using SetModelPath for ArmorAddons while wearing the armor does not update the visual change, even with using QueueNiNodeUpdate() afterwords. So here is my advice. Make your actual armor so it doesn't use any slot dependencies and doesn't use an armor addon. Basically it's an invisible armor that will be used for the Armor Rating stats and any enchantments. Then make separate armors that will be equipped based on certain conditions that do use the slot dependencies they are supposed to. Also, make a new Spell Ability that has different magic effects with different conditions for when you want the visuals to change. As a test, I made a helmet, that when your weapon is drawn, it equips the Elven Helmet, and when weapon is sheathed, it equips the Leather Helmet. Put this script on your invisible armor that doesn't use slot dependencies. Scriptname TestArmorScript extends ObjectReference ;Put this script on your armor Spell Property TestArmorVisualChangeAbility Auto Armor Property ArmorLeatherHelmet Auto ;purely for visuals Armor Property ArmorElvenHelmet Auto ;purely for visuals Event OnEquipped(Actor akActor) Debug.Notification("Equipped") If akActor.IsWeaponDrawn() akActor.EquipItem(ArmorElvenHelmet) Else akActor.EquipItem(ArmorLeatherHelmet) Endif akActor.AddSpell(TestArmorVisualChangeAbility) EndEvent Event OnUnequipped(Actor akActor) Debug.Notification("UnEquipped") akActor.RemoveSpell(TestArmorVisualChangeAbility) akActor.RemoveItem(ArmorLeatherHelmet, 100) akActor.RemoveItem(ArmorElvenHelmet, 100) EndEvent Then put this script on the ability's magic effect: Scriptname TestArmorVisualChangeScript extends ActiveMagicEffect ; this magic effect has the condition IsWeaponOut > 0 Armor Property ArmorElvenHelmet Auto Armor Property ArmorLeatherHelmet Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ;Effect starts when weapon is drawn ;Debug.Notification("Weapon Drawn") akTarget.EquipItem(ArmorElvenHelmet) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) ;Effect ends when weapon is sheathed ;Debug.Notification("Weapon Sheathed") akTarget.EquipItem(ArmorLeatherHelmet) EndEvent Name the scripts something more unique. You can add more magic effects to the ability with different conditions to equip different armor visuals. You might need to get rid of or tweak OnEffectFinish if using more than one magic effect / visual change. This method also has the benefit that it doesn't require skse. Edited May 18, 2020 by dylbill Link to comment Share on other sites More sharing options...
fenrato Posted January 2, 2021 Author Share Posted January 2, 2021 Thank you dylbill. Your means do not work for me, but I appreciate your efforts in tackling the problem. I will tinker around with it and see if I cannot engineer a solution using your scripts as a framework. Link to comment Share on other sites More sharing options...
maxarturo Posted January 2, 2021 Share Posted January 2, 2021 All SKSE functions like "SetModelPath()" or "SetNthTexturePath()" will change the nif or the texture in real time, but in game the mesh retains the nif / texture that is in memory. Disable / Enable, Unequip / Equip, OnCellDetach / OnCellAttach, OnUnload / OnLoad will work / update the nif or the texture. If the function is running on an object or an actor, losing LOS in an exterior cell will also work. Happy new year everybody !. Link to comment Share on other sites More sharing options...
Recommended Posts