VectorToString(vector)

From NWN Lexicon
Jump to navigationJump to search
Information icon.png Note: This function page documents something only available in the x0_i0_position include file. The function may not be accurately documented here but you can read the nwscript code for the function in the game files.

Turn a vector into a string. Useful for debugging.

string VectorToString(
    vector vec
);

Parameters

vec
The vector to be converted.


Description

A debug function that returns a string representation of the vector parameter formatted as follows: (xAxis, yAxis, zAxis) where: xAxis, yAxis, and zAxis are floats.


Requirements

#include "x0_i0_position"


Function Code

// Turn a vector into a string. Useful for debugging.
string VectorToString(vector vec)
{
    return "(" + FloatToString(vec.x)
        + ", " + FloatToString(vec.y)
        + ", " + FloatToString(vec.z) + ")";
}

See Also

functions: 

LocationToString



 author: Grimlar, editor: Michael Nork