Anton0028 Posted January 26, 2017 Share Posted January 26, 2017 Help me please to determine current armor pieces on NPC (and current clothes too). I found for weapon: "GetEquippedItemType()" and "GetEquippedWeapon()". But found nothing similar for armor or cloth. My goal is to get "ObjectReference" for every piece of armor and clothes,then take them away from NPC (to a container) and after that give new ones for him. Link to comment Share on other sites More sharing options...
Zzyxzz Posted January 26, 2017 Share Posted January 26, 2017 (edited) I looked into it already, i haven't found a good solution for that. Its probably possible with F4SE. One thing, that could maybe work, but i havent used it, as it was too cost intensive: Create Formlists for equipment Headwear, Armor, Gloves etc...You can also use arraylists, which are faster. Then you use:int Function GetItemCount(Form akItem)Returns how many of the specified item is in this object's inventory. Interate the array or formlist with this function, if it returns >0, the actor is wearing an item. I don't know if that works, i haven't tested it, but it should work. (This also counts item in the inventory that the actor is not wearing.) Edited January 26, 2017 by Zzyxzz Link to comment Share on other sites More sharing options...
ablindm4n Posted January 26, 2017 Share Posted January 26, 2017 Should be possible with F4SE. Extension to the Actors script from F4SE: ; F4SE additions built 2016-08-06 00:10:48.819000 UTC struct WornItem Form item ; Can be ARMO or WEAP Form model ; Can be ARMA or WEAP depending on item string modelName ; Model override name Form materialSwap ; Material swap form TextureSet texture ; TextureSet override EndStruct ; Slot index is valid from 0-43 ; Item can be none and still contain other information at a particular slot WornItem Function GetWornItem(int slotIndex, bool firstPerson = false) native ; Returns all the mods for the item at the particular index ; returns None if there is no item at this index ObjectMod[] Function GetWornItemMods(int slotIndex) native So I would imagine you can loop through the slots you want to check and call `GetWornItem(slotIndex).item` for each to find the Armor Form in that slot. Link to comment Share on other sites More sharing options...
Anton0028 Posted January 27, 2017 Author Share Posted January 27, 2017 Thanks, It seems F4SE is my way. Link to comment Share on other sites More sharing options...
Reginald001 Posted March 12, 2018 Share Posted March 12, 2018 (edited) I know this is a necro, but I think I found a workaround for this when I ran into this issue: - Add a custom keyword to any armor you want to check, check it against the QUEST ALIAS (not on the Subject, apparently but I'm not sure why of this is really the case) for the current NPC/Companion.- Then use the condition (WornHasKeyword == 1) for the custom keyword you added to the armor.- Or check for existing keywords that are unique to the armor/clothing. In my case, my NPC Companion now asks: "Are you my mommy?" when she's wearing a gas mask... :smile: (Just for laughs) Edited March 12, 2018 by Reginald001 Link to comment Share on other sites More sharing options...
Recommended Posts