Script Function?

Post » Fri Jan 18, 2013 1:30 pm

I'm wondering if there's a way to find and replace an object from a formlist? I know there's a GetFormFromFile() and GetFormID() but I'm not sure how to use them to do what I want. Basically the goal is to do something like this:
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)If (akBaseObject as Armor)&&(Game.GetFormFromFile(akBaseObject.GetFormID(),"Skyrim.esm") != none) ; Check if the item is a piece of armor and is located in the Skyrim.esm fileArmor OldCuirass = akBaseObject as ArmorReplaceArmor(ArmorList, OldCuirass)EndIfFunction ReplaceArmor(Formlist List, Armor Cuirass);What do I put here?FindClosestReferenceOfAnyTypeInList() ; Maybe?EndFunction

When you equip an armor, I want it to replace the one that's from the vanilla skyrim file with the one that I've duplicated in my mod file. So if you equip an iron cuirass, it will check if it's from the skyrim.esm and if it is than it will replace it with the one I've duplicated, and it should work with every other vanilla armor. Any ideas?
User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Return to V - Skyrim