Skip to content

VOB – functions for object manipulation

zDExt_Vob_RotateLocal

Rotates a specified vob by given angles in local scope.

func void zDExt_Vob_RotateLocal(var string vobName, var float rotX, var float rotY, var float rotZ) {};
  • vobName – name of vob in the game world
  • rotX – rotation angle around X axis (degrees)
  • rotY – rotation angle around Y axis (degrees)
  • rotZ – rotation angle around Z axis (degrees)
Example usage
zDExt_Vob_RotateLocal("CHEST_LOBART", 0.0, 180.0, 90.0);

zDExt_Vob_RotateWorld

Rotates a specified vob by given angles in global scope.

func void zDExt_Vob_RotateWorld(var string vobName, var float rotX, var float rotY, var float rotZ) {};
  • vobName – name of vob in the game world
  • rotX – rotation angle around X axis (degrees)
  • rotY – rotation angle around Y axis (degrees)
  • rotZ – rotation angle around Z axis (degrees)
Example usage
zDExt_Vob_RotateWorld("CHEST_LOBART", 0.0, 180.0, 90.0);

zDExt_Vob_MoveTo

Moves a specified vob to the position of a given waypoint, freepoint, or another vob.

func void zDExt_Vob_MoveTo(var string vobName, var string pointName) {};
  • vobName – name of vob in game world
  • pointName – name of an existing waypoint, freepoint or vob in game world
Example usage
zDExt_Vob_MoveTo("CHEST_LOBART", "START");

zDExt_Vob_MoveToPos

Moves a specified vob to the exact coordinates (X, Y, Z) in the game world.

func void zDExt_Vob_MoveToPos(var string vobName, var float posX, var float posY, var float posZ) {};
  • vobName – name of vob in game world
  • posX – X coordinate in the game world
  • posY – Y coordinate in the game world
  • posZ – Z coordinate in the game world
Example usage
zDExt_Vob_MoveToPos("CHEST_LOBART", 16795.0, 23120.0, 1400.0);

zDExt_Vob_SetToFloor

Sticks a vob with a specified name to the ground.

func void zDExt_Vob_SetToFloor(var string vobName) {};
  • vobName – name of vob in game world
Example usage
zDExt_Vob_SetToFloor("CHEST_LOBART");

zDExt_Vob_SetVisual

Sets the visual of a specified vob in the game world.

func void zDExt_Vob_SetVisual(var string vobName, var string visualName) {};
  • vobName – name of vob in game world
  • visualName – name of assets (e.g. 3DS, ASC or MDS)
Example usage
zDExt_Vob_SetVisual("CHEST_LOBART", "CHESTBIG_OCCHESTLARGELOCKED.MDS");

zDExt_Vob_SetCollisionDetection

Enables or disables dynamic and static collision detection for a specified vob.

func void zDExt_Vob_SetCollisionDetection(var string vobName, var int dynamicCollDet, var int staticCollDet) {};
  • vobName – name of vob in game world
  • dynamicCollDet – dynamic collision detection
  • staticCollDet – static collision detection
Example usage
zDExt_Vob_SetCollisionDetection("CHEST_LOBART", FALSE, TRUE);

zDExt_Vob_GetDistToPos

Gets the squared horizontal distance between a vob and a world position. The Y coordinate is ignored. For a 500 cm radius, compare against 500 * 500.

func int zDExt_Vob_GetDistToPos(var string vobName, var float posX, var float posY, var float posZ) {};
  • vobName – name of vob in game world
  • posX – X coordinate of target position
  • posY – Y coordinate of target position
  • posZ – Z coordinate of target position
  • return – squared horizontal distance in cm², truncated to an integer; 2147483647 if the vob is missing
Example usage
1
2
3
4
if (zDExt_Vob_GetDistToPos("CHEST_LOBART", 16795.0, 23120.0, 1400.0) <= 250000)
{
    //...
};

zDExt_Vob_GetDistToNpc

Gets the distance between the vob and an NPC (in cm).

func int zDExt_Vob_GetDistToNpc(var string vobName, var C_NPC npc) {};
  • vobName – name of vob in game world
  • npc – instance of the NPC
  • return – distance between vob and NPC in cm, truncated to an integer; 2147483647 if either object is invalid
Example usage
1
2
3
4
if (zDExt_Vob_GetDistToNpc("CHEST_LOBART", hero) <= 500)
{
    //...
};

zDExt_Vob_GetPortalRoom

Gets the name of the portal room in which the specified vob is currently located.

func string zDExt_Vob_GetPortalRoom(var string vobName) {};
  • vobName – name of vob in game world
  • return – name of portal room, or an empty string when the vob is missing or outside a portal room
Example usage
1
2
3
4
5
6
var string room; room = zDExt_Vob_GetPortalRoom("CHEST_LOBART");

if (Hlp_StrCmp(room, ""))
{
    //...
};