Jump to content

Any way to prevent NPCs from equipping their default items when items are removed from their inventory?


Recommended Posts

Posted

I've been fighting with Skyrim to get NPC inventories the way I want, but it seems to be far more complicated than I hoped. I'm getting NPCs to equip an item, and then change to another item and remove the first one. When I remove the item from the NPC, they seem to put on their default item again. For now I can just not remove the old items, but I'd like to not have all the duplicate items in their inventories for immersion purposes.

 

Player inventories are behaving as I want them to, so I'm wondering if there's any way to get NPCs to temporarily stop this behavior. I've tried using the ObjectReference AddInventoryEventFilter, but that didn't seem to stop the behavior, so I'm thinking it might not even be a Papyrus event like OnItemRemoved. Would it be possible to modify this behavior with an SKSE plugin? I'm trying to do it with Papyrus, but I'd learn plugin development if it could be done that way. Any ideas would be really appreciated.

 

Thanks,

v

Posted
26 minutes ago, NoGreenCloud said:

I'm not sure EFF would be the solution. Migal also has a good outfit management system in BBLS, but I'm trying to do this differently.

 

I'd like to not change the NPC's outfit itself, which seems to be how all of those mods handle this type of stuff. I don't want my mod to be limited by a number of Outfit forms that I'd have to create. I don't need these outfits to persist forever, so if they eventually change back to their default outfit that's ok. I just want to override their behavior around instantly re-equipping items when an item is removed from their inventory.

 

That might not be possible (and if so I will re-evaluate if I want to try some shenanigans with swapping the Outfit form), but I'm still hoping there's a way to coerce the engine to cooperate.

Posted (edited)
7 hours ago, v2099 said:

I just want to override their behavior around instantly re-equipping items when an item is removed from their inventory.

 

That might not be possible (and if so I will re-evaluate if I want to try some shenanigans with swapping the Outfit form), but I'm still hoping there's a way to coerce the engine to cooperate.


That auto-equipment is fired by the vanilla base game each time the inventary of the NPC's change. No mater if you add or remove items. Any change in the inventory, like add or remove a simple coin of gold, fire the auto-equipment. If nobody have disabled the auto-equipment in 10 years is because, probably, can't be made. So, all the mods that manage the equipment of the NPC's use the outfit system.

 

Edited by alex77r4
Posted
13 minutes ago, alex77r4 said:


That auto-equipment is fired by the vanilla base game each time the inventary of the NPC's change. No mater if you add or remove items. Any change in the inventory, like add or remove a simple coin of gold, fire the auto-equipment. If nobody have disabled the auto-equipment in 10 years is because, probably, can't be made. So, all the mods that manage the equipment of the NPC's use the outfit system.

 

Write a mod that sets the NPC to a null outfit, eg Actor.SetOutfit(Outfit akOutfit, Bool abSleepOutfit)

 

Posted
14 hours ago, alex77r4 said:

That auto-equipment is fired by the vanilla base game each time the inventary of the NPC's change.

Could an SKSE plugin patch this? I'm not too familiar with how they work, but is it possible to modify base game behaviour, or just add new stuff? Some recent mods have done tons of crazy stuff at the engine level (like directional movement), so I'm hoping this isn't too far-fetched, but who knows.

 

14 hours ago, fishburger67 said:

Write a mod that sets the NPC to a null outfit, eg Actor.SetOutfit(Outfit akOutfit, Bool abSleepOutfit)

I'll need to do some testing around that, like if they have a null outfit and an item is removed, do they unequip everything? For now my mod *works with just equipping items and letting the NPCs keep the old items in inventory, so I might just leave it like that.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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