Jump to content

Make trading with a companion impossible?


84Cronos

Recommended Posts

Is there a way to prohibit the items of my companion to be tradable or to avoid the trade option completely? I'm asking because I do have an NPC in one of my quests who becomes a companion temporarily while having pretty decent items and I want to prevent the player from getting them.

Link to comment
Share on other sites

27 minutes ago, PJMail said:

If the items are created by you then you could set their 'unplayable' flag - then they won't even appear in their inventory no matter how it is opened.

Thank you for the suggestion. I'll definitely try that. I already kind of played around with the idea because I set another armor for an important character to "unplayable", I just wasn't fully sure that it also extends to the trade inventory. Is there a way to dynamically flag items as "unplayable" at runtime or do I need to do this for each item individually?

Link to comment
Share on other sites

Another approach could be to attach a script to the objects which monitors for 

Event OnContainerChanged(ObjectReference aknewContainer, ObjectReference akoldContainer)

and returns it to akoldContainer if aknewContainer == PlayerRef if the conditions (quest stage, gobalvariable) are not right. 

 

 

Link to comment
Share on other sites

10 hours ago, PJMail said:

Unfortunately it is not scriptable - even via F4SE.

Actually, it is possible to achieve via F4SE plugin. Otherwise, Robco Patcher would not be able to work.

Maybe authors of SUP or Garden of Eden Papyrus Extender can add functionality to get/set bit 2 of a Form's flags.

 

UPD: Necessary functions just added to Garden of Eden Papyrus Extender. See SetFormFlag

 

Edited by DlinnyLag
Link to comment
Share on other sites

If you can get the item out of the inventory for a short time (with DropObject() perhaps) then you can probably use F4SE's GetName() or maybe the SetReferenceName() (or something like that) from the mod Rename Anything too, to change the name of the item to "" (empty string). Items with 0 length names simply don't show up in inventory lists. (I'm not sure about DisplayNames that Rename Anything handles now but I know it's true for Form names).

(The other known engine filters by the way: the item is an Armor or Weapon and its InstanceData has the Non-Playable flag set; the item is an equippable object and is currently equipped on an NPC who does not have the Keyword "ShowWornItemsKeyword" (which is referenced by a Default Object)).

I remember the Non-Playable flag is 13 (decimal) in Starfield but unfortunately I have no idea which one is it in Fallout 4.

All things considered, if possible, I'd choose CompanionActor.OnItemRemoved(akForm = TheItem), then Game.GetPlayer().RemoveItem(TheItem, akOtherContainer = CompanionActor) to give it back the companion). Or OnItemAdded(), OnContainerChanged() depending on the design.

Edited by LarannKiar
Link to comment
Share on other sites

  • 2 weeks later...

There is a set of hardcoded Keywords CompanionDisableMenuXXX, Trade in particular. Although when i needed to disable interaction entirely,  All or Command didn't work as expected by me, don't remember now if Trade worked or not, should try.

Edited by hereami
Link to comment
Share on other sites

  • Recently Browsing   0 members

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