Jump to content

Help/advise wanted for possible mod involving vanilla NPC inventories.


metanight78

Recommended Posts

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.

Link to comment

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

Link to comment

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.

Link to comment

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.

Link to comment

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.

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use