Vector

vector (datatype)
A structure of three floats, useful for defining positions and orientation vectors. To access the components of the vector, you can use the dot operator to get the x, y, and z components of the vector. The default value of a vector is { 0, 0, 0 } (or x = 0, y = 0, z = 0).

Example
vector v = GetPosition(OBJECT_SELF) - GetPosition(oidTargetObject); vector v2 = Vector(1.0f, 2.0f, 3.0f); PrintFloat(v2.x); float fDistanceToTarget = sqrt(v.x * v.x + v.y * v.y + v.z * v.z);

Vector(float, float, float)
The function Vector(float, float, float) Creates a vector (position) from three points.

vector Vector(    float fX = 0.0f,     float fY = 0.0f,     float fZ = 0.0f );

Parameters
float fX
 * x point of the triplet. (Default: 0.0f)

float fY
 * y point of the triplet. (Default: 0.0f)

float fZ
 * z point of the triplet. (Default: 0.0f)

Description
Returns a vector with the specified point values of fX, fY, and fZ.

Remarks
A common use for this command is when creating a new Location based on an objects location. Some knowledge of how vectors work is probably good for this purpose.

Version
1.61