Jump to content

[LE] toggle outfit on follower (need help)


Recommended Posts

I am currently making a mode with a follower who wears an outfit (custom assets) which you can toggle on and off by talking to them and telling them to take it off and wear what you give them or put it on, i am struggling to make the npc remove the outfit. if any help can be given, it would be helpful

Link to comment
Share on other sites

To trigger the NPC to re-evaluate what it is wearing you simply need to alter its inventory in some way. (I like to add and then remove a single gold piece or lockpick).

 

When you say "outfit" do you mean an outfit as defined in the CK? If so, the only way NPCs will wear the outfit is when they are not player teammates. When they are a teammate they will pick the "best" gear from their inventory based on their skills. So you simply switch the teammate status and trigger some change to their inventory. But even items from a default outfit will be chosen while a teammate unless other gear in inventory is better quality.

 

If your outfit is just a set of items you've given the NPC but you need them to be chosen or not chosen without changing the teammate status that will be harder and the solution depends on the exact properties of the items.

Link to comment
Share on other sites

NPCs will re-equip their assigned outfit (either the original editor one or one assigned via script) if their inventory is completely emptied or if certain other triggers (e.g. a cell refresh) occur. Unfortunately as far as I can tell there's no way to build a purely script-driven outfit and use that to swap an NPC's gear around.

Link to comment
Share on other sites

How about not assigning them in the editor and just script driving adding items and equiping then removing items once unequipped?

 

It's possible. You'll likely want to lock them on in the EquipItem call, or else they'll reset to nude on you. This would prevent equipping other items (outside of script-driven ones) but since you're making this a dialogue-driven swap it shouldn't be insurmountable.

Link to comment
Share on other sites

The force option of the EquipItem call will get reset whenever the NPC moves between cells and at various other times. The specifics of the items matter because there are various schemes that can be used but each has its own limitations and quirks.

Link to comment
Share on other sites

The force option of the EquipItem call will get reset whenever the NPC moves between cells and at various other times. The specifics of the items matter because there are various schemes that can be used but each has its own limitations and quirks.

 

Even with an unassigned outfit? My experience has primarily been with mannequins, who, obviously, don't move.

Link to comment
Share on other sites

The force option of the EquipItem call will get reset whenever the NPC moves between cells and at various other times. The specifics of the items matter because there are various schemes that can be used but each has its own limitations and quirks.

 

Could u not use a event oncellattach() and attach it to the npc so that when they do move locations it re equips what it had on. Maybe by using global variable check or something?

Link to comment
Share on other sites

I think that equip force option was designed for the mannequins because it certainly does work for them. But as you noticed they never change cells. The problem is that the game and completely re-evaluate NPCs when they switch cells (which also includes terminating and restarting all active magic effects). The forced flag gets reset too.

 

Yes, one solution to the problem is to use events that will also trigger on those NPC resets so you can force the items equipped or unequipped as needed. In some cases you can add scripts to the items and in others you might be able to configure properties of the items so the character chooses them (or avoids them) automatically.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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