EVENT TYPE INVENTORY REMOVED

From Dragon Age Toolset Wiki
Jump to: navigation, search

The documentation on this page is incomplete, obsolete, or otherwise in need of a thorough review. The current content may provide a good starting point for this, but do not rely on its accuracy when using it to design content.

Source:
script.ldf
Sent when:
An item is removed from the personal inventory of the object receiving the event or the party inventory.
Sent from:
engine
Sent to:
creatures, placeables, player/party
Parameters:
  • Creator: new owner of the item, OBJECT_INVALID if item is being destroyed on object
  • Integer 0: If 0, the event is queued. If 1, it is processed immediately.
  • Object 0: item being added

Usage

case EVENT_TYPE_INVENTORY_REMOVED:
{
object oNewOwner = GetEventCreator(ev); // new owner of the item, OBJECT_INVALID if item is being destroyed on object
int bImmediate = GetEventInteger(ev, 0); // If 0, the event is queued. If 1, it is processed immediately.
object oItem = GetEventObject(ev, 0); // item being added

// insert event-handling code here

break;
}

From ItemPossessor.cpp:

BOOL bWasLooted = ((ItemMoveOptions::cm_OptionFlags & ITEM_MOVE_LOOTED_BY_PLAYER) != 0 ? TRUE : FALSE);
pScriptEvent->SetBool(0, bWasLooted);

Remarks

This documentation seems to be wrong. When an item is removed from a placeable, both the event creator and target are the placeable, not the new owner.

One method of determining who has removed the object is to store the event creator in a local object variable when the placable is opened in EVENT_TYPE_USE.