Osiris/API/ItemToTransform

From Divinity Engine Wiki
Revision as of 08:22, 11 March 2019 by Tinkerer (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Full Definition(s)
  • call ItemToTransform((GUIDSTRING)_UUID, (REAL)_X, (REAL)_Y, (REAL)_Z, (REAL)_Pitch, (REAL)_Yaw, (REAL)_Roll, (INTEGER)_Amount, (CHARACTERGUID)_Owner)
Description

Moves, rotates and changes the amount and ownership of the item with the _UUID. The position and rotation are updated instantly and without animation.

Notes
  • This call requires _Pitch, _Yaw and _Roll to be given in radians while all other calls and queries use degrees to measure angles. Degrees can be converted to radians by multiplying them by 0.0174533.
  • This is the only call that can change the amount of an existing item in the world (e.g. a gold pile).
  • To clear the ownership of an item, NULL_00000000-0000-0000-0000-000000000000 may be passed as _Owner.
Example

This example creates an overload that only requires _X, _Y and _Z to be set.

PROC
ItemToTransform((ITEMGUID)_Item, (REAL)_X, (REAL)_Y, (REAL)_Z)
AND
GetRotation(_Item, (REAL)_PitchDegree, (REAL)_YawDegree, (REAL)_RollDegree)
AND
RealProduct(_PitchDegree, 0.0174533, (REAL)_Pitch)
AND
RealProduct(_YawDegree, 0.0174533, (REAL)_Yaw)
AND
RealProduct(_RollDegree, 0.0174533, (REAL)_Roll)
AND
ItemGetAmount(_Item, (INTEGER)_Amount)
AND
ItemGetOwner(_Item, (CHARACTERGUID)_Owner)
THEN
ItemToTransform(_Item, _X, _Y, _Z, _Pitch, _Yaw, _Roll, _Amount, _Owner);
See Also