Jump to content

Papyrus/Scripting - Equipped items getting unequipped on cell change


Akor

Recommended Posts

Posted

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?

 

 

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

 

Posted
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:

 

 

 

Archived

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

  • Recently Browsing   0 members

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