Background for Fallout 4
Member of the ObjectReference script
eventOnItemRemoved(FormakBaseItem, intaiItemCount, ObjectReferenceakItemReference, ObjectReferenceakDestContainer)

Description

Wiki Description

Event received when an item is removed from this object's container. Only arrives if it matches an inventory filter in place on the script receiving the event.

Documentation Comment

Event received when an item is removed from this object's inventory. If the item is a persistant reference, akItemReference
will point at it - otherwise the parameter will be None


Caveats

CK Wiki - Notes


Parameters

  1. FormakBaseItem

    CK Wiki Description

    The base object for the item that was removed from this container.

  2. intaiItemCount

    CK Wiki Description

    The number of items removed from this container.

  3. ObjectReferenceakItemReference

    CK Wiki Description

    The specific reference removed from the container, if any. Will be None if a non-persistant object is removed.

  4. ObjectReferenceakDestContainer

    CK Wiki Description

    The container that the object(s) went to. If None, then the object was dropped into the world.


Examples

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
  if !akDestContainer
    Debug.Trace("I dropped " + aiItemCount + "x " + akBaseItem + " into the world")
  elseif akDestContainer == Game.GetPlayer()
    Debug.Trace("I gave the player " + aiItemCount + "x " + akBaseItem)
  else
    Debug.Trace("I gave " + aiItemCount + "x " + akBaseItem + " to another container")
  endIf
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends ObjectReference

event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
    Debug.trace("Event received - OnItemRemoved: akBaseItem = " + akBaseItem + " aiItemCount = " + aiItemCount + " akItemReference = " + akItemReference + " akDestContainer = " + akDestContainer)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.