Jump to content

Inventory filter help please


Recommended Posts

I want edit/create a script so that when a container is activated and the player and container's inventories are listed, the player's inventory will only show certain items, I've read the wiki page for addinventoryeventfilter but I don't find it very clear.  I would like to identify the items to show by keywords attached to those items.

Is this a thing and if so would some kind soul give me some pointers?

 

diziet

edit: I've got this far:

Scriptname dz_fate_card_store_script extends ObjectReference  

FormList	Property	DBM_AllFateCards	Auto
Actor		Property	PlayerRef			Auto

Event OnActivate(ObjectReference akActionRef)
	self.BlockActivation(True)
	debug.trace("DBM_fatecardstore activated")
	AddInventoryEventFilter(DBM_AllFateCards)
	self.Activate(PlayerRef,True)
EndEvent

the block activation seems to work if I comment out the self.Activate(PlayerRef,True) line but the container menu is not filtered, the property is set

edit2: after further reading it seems that the filter doesn't do what I thought it does, it doesn't affect what is shown in an inventory at all. neither can it prevent certain items from being added or removed; it only filters out items that _have_ been added or removed and blocks the  OnItemAdded and OnItemRemoved events if the filter doesn't apply. ah well:)

Link to comment
Share on other sites

The inventory event filter is to prevent OnItemAdded and OnItemRemoved from processing when items not on the list are added or removed.  It does not prevent the adding or removing of those items.

The gift menu will do what you want, except it only works with the actor subset of object references.  While it could be faked into looking like the player is interacting with a container, it may not be a viable solution in all situations.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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