AddInventoryEventFilter - ObjectReference

From the CreationKit Wiki
Revision as of 12:00, 10 February 2014 by imported>Egocarib (adjustments for further clarity)
Jump to navigation Jump to search

Member of: ActiveMagicEffect Script, ReferenceAlias Script, ObjectReference Script

Adds a form as a "filter" for OnItemAdded and OnItemRemoved events sent to this object. The filter will be applied only to the specific Reference, Alias, or Active Magic Effect it is added to, so each will need to have filters applied to them independently.

Syntax

Function AddInventoryEventFilter(Form akFilter) native

Parameters

  • akFilter: The item to filter with. If a base object or reference, this object will only be notified of references or base objects matching exactly. If a form list, it will filter using all of the forms in the form list (only items in the form list will be allowed through).

Return Value

None.

Examples

; Make sure we only get events for gold and soul gems
AddInventoryEventFilter(Gold)
AddInventoryEventFilter(SoulGemList)

Notes

  • The filter will only check inventory objects directly against the objects in the form list, and will not dig inside nested lists to find them.
  • New filters that are added stack with any previous filters. If you intend to override previous filters you will need to remove them first.

See Also