Jump to content

How to make NPC wear stuff given via OpenInventory() ?


Conquestus

Recommended Posts

So I recently made a topic about how to open the inventory of NPC's via dialogues.

 

It can be found here:

https://forums.nexusmods.com/index.php?/topic/6324446-dialogue-option-to-open-npc-inventory-scripting/

 

 

So the inventory opens with

akSpeaker.OpenInventory(true)

Now I try to figure out, how to make NPCs wear stuff, if they are given clothes/armor/weapons. At this state, given clothes/armor/weapons simply remain in their inventory unequipped.

 

I know there is this EquipItem() function, yet I don't know how to use it to make the NPC wear stuff from it's own inventory.

 

https://www.creationkit.com/index.php?title=EquipItem_-_Actor

 

 

I tried to achieve something by adding this additional script into the dialogue (Topic Info), yet I didn't achieve anything with this. Papyrus is so f*ckin hard.

ScriptName EEEInventoryScript extends ObjectReference

Function EquipItem(Form akItem, bool abPreventRemoval = false, bool abSilent = false) native

 
Event OnItemAdded(Form akItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    Self.EquipItem(akItem)
endEvent

Any help? Thanks in advance.

 

 

 

EDIT:

Found a solution, by adding NPCs as teammates with:

akSpeaker.SetPlayerTeammate()

Then NPCs will automatically wear given clothes/armor.

Edited by Conquestus
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
  • Recently Browsing   0 members

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