Difference between revisions of "Osiris/API/ItemMoveToPosition"

From Divinity Engine Wiki
Jump to: navigation, search
m
m
Line 7: Line 7:
 
* If the item is in the current level, the arrival event will not be thrown due to a bug. This will be fixed in a future version. Until then you can use a combination of databases and the [[Osiris/API/ItemMoved|ItemMoved]] event to detect when an item has finished moving.
 
* If the item is in the current level, the arrival event will not be thrown due to a bug. This will be fixed in a future version. Until then you can use a combination of databases and the [[Osiris/API/ItemMoved|ItemMoved]] event to detect when an item has finished moving.
 
* Movements for items cannot be queued. Starting a new movement for an item that was moving, will replace the previous movement (and arrival event) with the new one.
 
* Movements for items cannot be queued. Starting a new movement for an item that was moving, will replace the previous movement (and arrival event) with the new one.
 +
* Triggers left/entered during the move will result in [[Osiris/API/ItemEnteredTrigger|ItemEnteredTrigger]] and [[Osiris/API/ItemLeftTrigger|ItemLeftTrigger]] events as appropriate.
 
===== See Also =====
 
===== See Also =====
 
* [[Osiris/API/StoryEvent|StoryEvent]]
 
* [[Osiris/API/StoryEvent|StoryEvent]]
Line 13: Line 14:
 
* [[Osiris/API/ItemDragToPosition|ItemDragToPosition]]
 
* [[Osiris/API/ItemDragToPosition|ItemDragToPosition]]
 
* [[Osiris/API/ItemDragToTrigger|ItemDragToTrigger]]
 
* [[Osiris/API/ItemDragToTrigger|ItemDragToTrigger]]
 +
* [[Osiris/API/ItemEnteredTrigger|ItemEnteredTrigger]]
 +
* [[Osiris/API/ItemLeftTrigger|ItemLeftTrigger]]
 
* [[Osiris/API/ItemMoved|ItemMoved]]
 
* [[Osiris/API/ItemMoved|ItemMoved]]
 
* [[Osiris/API/ItemMoveToTrigger|ItemMoveToTrigger]]
 
* [[Osiris/API/ItemMoveToTrigger|ItemMoveToTrigger]]

Revision as of 11:30, 11 July 2018

Full Definition(s)
  • call ItemMoveToPosition((ITEMGUID)_Item, (REAL)_X, (REAL)_Y, (REAL)_Z, (REAL)_Speed, (REAL)_Acceleration, (STRING)_Event, (INTEGER)_DoHits)
Description

Makes _Item move to the position (_X, _Y, _Z) in a straight line with initial speed _Speed m/s and with acceleration _Acceleration m/s2. If _DoHits is 1, the movement will stop if the item's movement is blocked by another item or character. If it is 0, the item will ignore other items and characters and just move through them. When the item stops moving, the event _Event should be raised for the item, but see the notes for details about this.

Notes
  • If the item is in a different level than the current one, this call behaves like a teleport inside that other level: the coordinates of the item are adjusted and the event is thrown immediately.
  • If the item is in the current level, the arrival event will not be thrown due to a bug. This will be fixed in a future version. Until then you can use a combination of databases and the ItemMoved event to detect when an item has finished moving.
  • Movements for items cannot be queued. Starting a new movement for an item that was moving, will replace the previous movement (and arrival event) with the new one.
  • Triggers left/entered during the move will result in ItemEnteredTrigger and ItemLeftTrigger events as appropriate.
See Also