metanight78 Posted February 27, 2016 Posted February 27, 2016 Hello. I'm relativly new to Skyrim moding and could use some help. Currently I'm working on a mod that will remain nameless until I've finished it, and would like to know what would be the best way to permenantly add/remove vanilla NPC inventory items. (worn outfits included). As large as the modding community is, finding the right tools is daunting task. Thanks in advance.
Guest Posted February 27, 2016 Posted February 27, 2016 Hi, what do you mean for "permanently remove"? Completely disable the Armor Base Object? Or just remove an item from the NPC inventory (and making impossible for the NPC to get it again) (including outfits)? Thanks
metanight78 Posted February 27, 2016 Author Posted February 27, 2016 Hi, what do you mean for "permanently remove"? Completely disable the Armor Base Object? Or just remove an item from the NPC inventory (and making impossible for the NPC to get it again) (including outfits)? Thanks I want to remove items from the NPC inventory and keep it that way. Thanks for the quick responce.
Guest Posted February 27, 2016 Posted February 27, 2016 Removing items is really easy. Consider an Actor "theNPC", and an item (a Form) called "anArmor" you want to remove, it is enough to call: theNPC.RemoveItem(anArmor, 1, true) The first parameter specifies the object you want to remove, the second parameter the amount of objects to remove, the last parameter can be "true" if the removal will not produce sounds, or "false" if the removal will produce souns (and notifications in case it is the player.) Now, avoiding that the NPC will add it again it is more complex. The only safe way is to add the NPC in a ReferenceAlias, and attach to it a script with the events: Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) (Self as Actor).RemoveItem(akBaseItem, aiItemCount, true) EndEvent Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) (Self as Actor).UnequipItem(akBaseObject, abPreventEquip = true, abSilent = true) (Self as Actor).RemoveItem(akBaseObject, 1, true) EndEvent Now, removing armors added by an Outfit is more complex.You need SKSE 1.7.3 and you may want to call to the actor: theNPC.SetOutfit(anEmptyoutfit, false) Where "anEmptyoutfit" is an Outfit that has nothing inside.
metanight78 Posted February 27, 2016 Author Posted February 27, 2016 Removing items is really easy. Consider an Actor "theNPC", and an item (a Form) called "anArmor" you want to remove, it is enough to call: theNPC.RemoveItem(anArmor, 1, true) The first parameter specifies the object you want to remove, the second parameter the amount of objects to remove, the last parameter can be "true" if the removal will not produce sounds, or "false" if the removal will produce souns (and notifications in case it is the player.) Now, avoiding that the NPC will add it again it is more complex. The only safe way is to add the NPC in a ReferenceAlias, and attach to it a script with the events: Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) (Self as Actor).RemoveItem(akBaseItem, aiItemCount, true) EndEvent Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) (Self as Actor).UnequipItem(akBaseObject, abPreventEquip = true, abSilent = true) (Self as Actor).RemoveItem(akBaseObject, 1, true) EndEvent Now, removing armors added by an Outfit is more complex.You need SKSE 1.7.3 and you may want to call to the actor: theNPC.SetOutfit(anEmptyoutfit, false) Where "anEmptyoutfit" is an Outfit that has nothing inside. Thanks, I have one other question. Would CK work for this converstion, or is there another modding tool that would be better/more user friendly.
metanight78 Posted February 27, 2016 Author Posted February 27, 2016 There is only CK. Nothing else. Thanks. I think that's all I need for now. I'll mark this as resolved.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.