angryglock Posted May 5, 2018 Share Posted May 5, 2018 To keep my question simple here is a very simple script to do something when I add an item to a container. It works as expected in Skyrim SE but not in Fallout 4. Am I missing something? I attached this script to a container in a cell. I filled out the properties. When I add any item to the container the OnItemAdded() block does not happen. When I remove the item the OnClose() block runs just fine and I see the trace. Scriptname testxxx extends ObjectReference Const Actor Property PlayerRef Auto ConstMiscObject Property caps001 Auto Const Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) PlayerREF.AddItem(caps001)Debug.Trace("XXX999 Item Added") EndEvent Event OnClose(ObjectReference akActionRef) PlayerREF.AddItem(caps001)Debug.Trace("XXX999 Item Removed") endEvent Link to comment Share on other sites More sharing options...
Reneer Posted May 5, 2018 Share Posted May 5, 2018 You need to add AddInventoryEventFilter to your script. Link to comment Share on other sites More sharing options...
angryglock Posted May 5, 2018 Author Share Posted May 5, 2018 On 5/5/2018 at 8:15 PM, Reneer said: You need to add AddInventoryEventFilter to your script. Thanks! I missed that link in the doc when I looked up OnItemAdded(). The purpose of the real script is to append the item placed in the container into an existing formlist. I won't know before hand what the item is so I can't apply a filter to it. For instance if another mod adds a new scrap item, I want the player to be able to add that scrap item to a formlist so I can then do something with the items in the form list. It's basically a scrap auto-sorter system that will accept mod added items. Is there way to allow any normally storeable item to be recognized by the OnItemAdded()? Maybe a way to tell the filter everything is allowed? Link to comment Share on other sites More sharing options...
Reneer Posted May 5, 2018 Share Posted May 5, 2018 You can just use AddInventoryEventFilter(none) to let everything through. :) Link to comment Share on other sites More sharing options...
Recommended Posts