Arngrim11 Posted June 1, 2013 Posted June 1, 2013 I'm a total n00b at scripting. I have check the wiki and still haven't found a clear answer for myself so I'm asking here is there a way to have an item auto equip when nothing else is being worn in its slot?
anubis Posted June 1, 2013 Posted June 1, 2013 I'm not really good with scripts too, but i do really want to learn it and since i also wondering the same thing a few months back. My first option is to find similar mod or close to it. Perhaps auto equip ammo/auto equip helmet from mitchalek. Might be difficult because script need to detect for specific slot(s)/ first (the one that troubles me) to trigger an item to be equip/not. Maybe this discussion might help you.
anubis Posted June 1, 2013 Posted June 1, 2013 Haven't test it yet. Sure look so simple but still i dont really understand how it works. Thought SlotMask was only refering for headgear, fool me, turn out in can go from slot30-61, thanks to SKSE. And thank you for the example b3lisario, one more thing may i request small description for the important line in the script ( because i kind of twerp in scripting.
Arngrim11 Posted June 2, 2013 Author Posted June 2, 2013 This stuff is goes so far over my head. I spent a lot of time just trying different things with the example above and ended up with a enchantment that uses the change armors function but my question what do I need to change so it works for any npc wearing the piece of gear with the enchantment. Here is the current script. Scriptname CB01Equip extends activemagiceffect Event OnObjectUnEquippd(Form akBaseObject, ObjectReference akObjectReference) if akBaseObject as Armor CheckArmors() Debug.Notification("Checking Armor.") endif EndEvent Event OnObjectEquipped(Form akBaseObject, ObjectReference akObjectReference) if akBaseObject as Armor CheckArmors() Debug.Notification("Checking Armor.") endif EndEvent Function CheckArmors() Actor player = Game.GetPlayer() int i = armorToEquip.length While (i > 0) i -= 1 int slotMask = armorToEquip.GetSlotMask() Armor current = player.GetWornForm(slotMask) as Armor if current == None player.equipitem(armorToEquip, False, True) endif EndWhileEndFunction Armor[] Property ArmorToEquip Auto Thanks for any help you can give.
Arngrim11 Posted June 2, 2013 Author Posted June 2, 2013 So I take it its not an easy fix. That's the only scripting I added and its just a magic effect used by as an enchant on a piece of armor. I can share an esp later if needed. I will have to set one up. The one I was testing it with isn't really fit for uploading. I would have fixed one up before asking but I just assumed the actor player = Game.Getplayer() was all that would need to be changed.
b3lisario Posted June 2, 2013 Posted June 2, 2013 Scriptname EquipDaedricScript extends activemagiceffect Armor[] Property ArmorToEquip Auto Actor Property ActorRef Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ActorRef = akTarget CheckArmors() EndEvent Event OnObjectUnEquipped(Form akBaseObject, ObjectReference akObjectReference) if akBaseObject as Armor CheckArmors() endif EndEvent Event OnObjectEquipped(Form akBaseObject, ObjectReference akObjectReference) if akBaseObject as Armor CheckArmors() endif EndEvent Function CheckArmors() int i = armorToEquip.length While (i > 0) i -= 1 int slotMask = armorToEquip[i].GetSlotMask() Armor current = ActorRef.GetWornForm(slotMask) as Armor if current == None ActorRef.equipitem(armorToEquip[i], False, True) endif EndWhile EndFunction
Arngrim11 Posted June 3, 2013 Author Posted June 3, 2013 Thanks again b3lisario I actually fixed a plugin up but I was getting an SQL error until just now. So I couldn't post it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.