Difference between revisions of "EVENT TYPE INVENTORY REMOVED"
From Dragon Age Toolset Wiki
BryanDerksen (Talk | contribs) m (|sourcefile=script.ldf) |
(→Remarks) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{needs review}} | ||
{{event | {{event | ||
|sourcefile=script.ldf | |sourcefile=script.ldf | ||
|when= An item is removed from the personal inventory of the object receiving the event or the party inventory. | |when= An item is removed from the personal inventory of the object receiving the event or the party inventory. | ||
|from= [[engine]] | |from= [[engine]] | ||
− | |to = [[creature]]s, [[placeable]]s, player/party | + | |to = [[creature]]s, [[placeable]]s, player/party| |
+ | |tocategory1=creature | ||
+ | |tocategory2=placeable | ||
+ | |sortkey=INVENTORY_REMOVED | ||
|creatorname= oNewOwner | |creatorname= oNewOwner | ||
|creatordesc= new owner of the item, OBJECT_INVALID if item is being destroyed on object | |creatordesc= new owner of the item, OBJECT_INVALID if item is being destroyed on object | ||
|object0name = oItem | |object0name = oItem | ||
|object0desc = item being added | |object0desc = item being added | ||
+ | |int0name=bImmediate | ||
+ | |int0desc= If 0, the event is queued. If 1, it is processed immediately. | ||
}} | }} | ||
+ | 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. | ||
+ | |||
+ | [[Category:Inventory]] | ||
[[Category:Event types|INVENTORY_REMOVED]] | [[Category:Event types|INVENTORY_REMOVED]] | ||
+ | [[Category:Placeable events|INVENTORY_REMOVED]] | ||
+ | [[Category:Creature events|INVENTORY_REMOVED]] |
Latest revision as of 11:42, 26 January 2011
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;
}
{
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.