Meteor 2 Scripting Functions
Spatial
vector2 getPos(int objectID)
Get the position of a unit or player.

Example
// print player position
print("Player pos: " + getPos(PLAYER_OBJECT));

See also
setPos

void setPos(int objectID, vector2 pos)
Set the position of a unit or player.

Example
// move player to 100, 100
setPos(PLAYER_OBJECT, vector2(100, 100));

Comments
Server/single player can move any unit or player.
Multiplayer client can only move the local player.

See also
getPos

float getDir(int objectID)
Get the direction of a unit or player in the range 0-360.

Example
// print player direction
print("Player direction: " + getDir(PLAYER_OBJECT));

See also
setDir

void setDir(int objectID, float dir)
Set the direction of a unit or player in the range 0-360.

Example
// rotate player south (only works if mouse look is disabled)
setDir(PLAYER_OBJECT, 180);

Comments
Server/single player can set any unit or player direction.
Multiplayer client can only set the the local player direction.

See also
getDir

float getHeight(int objectID)
Get the height above the ground of an object.

Example
print(getHeight(PLAYER_OBJECT));

See also
getMaxHeight

float getMaxHeight(int objectID)
Get the maximum height above the ground of an object.

Example
print(maxHeight(PLAYER_OBJECT));

See also
getHeight


Index

Generated on the 23 November 2024 at 08:20:44 (UK Time)