Jump to content

Papyrus/Scripting - Equipped items getting unequipped on cell change


Recommended Posts

2 hours ago, Akor said:

Hi,

 

I have this problem that NPCs unequip items that have been equipped via script (EquipItem)

It always happens when the NPC is changing the cell (gets teleported)...

 

Anyone knows to to fix|prevent this?

 

 

 

The following applies to Skyrim, but Fallout scripting seems very similar, so may be relevant :

NPCs regularly check what to wear; eg when 3d is loaded they may equip their default outfit.

You could try setting the  abPreventRemoval = true when calling equipitem to so if that solves it.

If not you could try to put the items in an outfit and assign that to the NPC (https://www.creationkit.com/fallout4/index.php?title=SetOutfit_-_Actor)

or you could reequip them in an OnLoad method (https://www.creationkit.com/fallout4/index.php?title=OnLoad_-_ObjectReference).

 

Link to comment
9 hours ago, MTB said:

 

The following applies to Skyrim, but Fallout scripting seems very similar, so may be relevant :

NPCs regularly check what to wear; eg when 3d is loaded they may equip their default outfit.

You could try setting the  abPreventRemoval = true when calling equipitem to so if that solves it.

If not you could try to put the items in an outfit and assign that to the NPC (https://www.creationkit.com/fallout4/index.php?title=SetOutfit_-_Actor)

or you could reequip them in an OnLoad method (https://www.creationkit.com/fallout4/index.php?title=OnLoad_-_ObjectReference).

 

 

abPreventRemoval did not work :(

Manipulating the default outfit did work as long as the items didn't use ObjectMods, so couldn't use this option :(:(

 

So I took your advice and now use the OnLoad event and reequip the items when needed. The script doesn't look pretty, but it works somehow... :O

 

Thank you for your help @MTB :D:thumbsup:

 

 

 

Link to comment

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...

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