Difference between revisions of "Osiris/API/ItemTemplateMoved"
From Divinity Engine Wiki
m |
m (Documented extra case in which this event does not get thrown.) |
||
Line 2: | Line 2: | ||
* event '''ItemTemplateMoved'''(''(STRING)'''''_ItemTemplate''', ''(ITEMGUID)'''''_Item''') | * event '''ItemTemplateMoved'''(''(STRING)'''''_ItemTemplate''', ''(ITEMGUID)'''''_Item''') | ||
===== Description ===== | ===== Description ===== | ||
− | Thrown under the same conditions as [[Osiris/API/ItemMoved|ItemMoved]], but additionally also provides the root template of the moved item. | + | Thrown under the same conditions as [[Osiris/API/ItemMoved|ItemMoved]] (with one caveat, see notes below), but additionally also provides the root template of the moved item. |
===== Parameters ===== | ===== Parameters ===== | ||
* '''_ItemTemplate''': The root template of the moved item in the format ''TemplateName_UUID''. | * '''_ItemTemplate''': The root template of the moved item in the format ''TemplateName_UUID''. | ||
Line 8: | Line 8: | ||
===== Notes ===== | ===== Notes ===== | ||
* See [[Osiris/API/ItemMoved|ItemMoved]]. | * See [[Osiris/API/ItemMoved|ItemMoved]]. | ||
− | * There | + | * This event does not get thrown if the item's ''CanBePickedUp'' and ''CanMove'' properties are both false. The [[Osiris/API/ItemMoved|ItemMoved]] will still be thrown in this case. |
+ | * There also a corner case in which the [[Osiris/API/ItemMoved|ItemMoved]] event gets thrown, but not this event: if code cannot find the root template of the moved item. This might happen if a root template was deleted of an item that already existed in a savegame. Doing so is [[Modding:_Versioning#First_golden_rule|not allowed]] though, so normally this should never happen. | ||
===== See Also ===== | ===== See Also ===== | ||
* [[Osiris/API/ItemMovedFromTo|ItemMovedFromTo]] | * [[Osiris/API/ItemMovedFromTo|ItemMovedFromTo]] |
Revision as of 15:59, 2 July 2018
Full Definition(s)
- event ItemTemplateMoved((STRING)_ItemTemplate, (ITEMGUID)_Item)
Description
Thrown under the same conditions as ItemMoved (with one caveat, see notes below), but additionally also provides the root template of the moved item.
Parameters
- _ItemTemplate: The root template of the moved item in the format TemplateName_UUID.
- _Item: The item that moved.
Notes
- See ItemMoved.
- This event does not get thrown if the item's CanBePickedUp and CanMove properties are both false. The ItemMoved will still be thrown in this case.
- There also a corner case in which the ItemMoved event gets thrown, but not this event: if code cannot find the root template of the moved item. This might happen if a root template was deleted of an item that already existed in a savegame. Doing so is not allowed though, so normally this should never happen.