84Cronos Posted November 30, 2023 Share Posted November 30, 2023 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 More sharing options...
PJMail Posted November 30, 2023 Share Posted November 30, 2023 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. Link to comment Share on other sites More sharing options...
84Cronos Posted November 30, 2023 Author Share Posted November 30, 2023 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 More sharing options...
PJMail Posted December 1, 2023 Share Posted December 1, 2023 Unfortunately it is not scriptable - even via F4SE. I had to have 2 versions in a mod I used and equip them via script. Link to comment Share on other sites More sharing options...
SKKmods Posted December 1, 2023 Share Posted December 1, 2023 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 More sharing options...
DlinnyLag Posted December 1, 2023 Share Posted December 1, 2023 (edited) 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 December 1, 2023 by DlinnyLag Link to comment Share on other sites More sharing options...
LarannKiar Posted December 1, 2023 Share Posted December 1, 2023 (edited) 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 December 1, 2023 by LarannKiar Link to comment Share on other sites More sharing options...
DlinnyLag Posted December 1, 2023 Share Posted December 1, 2023 21 minutes ago, LarannKiar said: I have no idea which one is it in Fallout 4. See implementation for a reference. Link to comment Share on other sites More sharing options...
hereami Posted December 12, 2023 Share Posted December 12, 2023 (edited) 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 December 12, 2023 by hereami Link to comment Share on other sites More sharing options...
Recommended Posts