Jump to content

Making NPCs equip items after gifting them


Srende

Recommended Posts

I'm trying to make a trade dialogue for certain NPCs similar to followers, where you could open their inventory from dialogue. This works fine, but I can't figure out why they don't equip the items or how to make them do that. As far as I can tell, vanilla followers use the same function: akActor.OpenInventory(), which is the extent of the topic info fragment script on the followers and on my own dialogue. I've also set the NPC outfit to an empty one prior to opening the inventory so their current outfit isn't even "blocking" it.

 

Sure, I could just go through their inventory afterwards and equip everything forcibly, but it's not exactly an ideal solution I think.

 

Any ideas?

Link to comment

Whee, I figured it out on a hunch a minute after posting this :D

 

Turns out they only automatically equip them if they are player teammates.

 

So now my script looks like this, incase someone is having the same issue:

bool team = akSpeaker.IsPlayerTeammate()
If !team
    akSpeaker.SetPlayerTeammate()
EndIf
akSpeaker.OpenInventory(true)
If !team
    Utility.Wait(2.0) ; Shouldnt advance while in the inventory menu
    akSpeaker.SetPlayerTeammate(false, false)
EndIf

So it checks if the NPC is already a teammate and adds it temporarily if not.

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