LUADOC - Farming Simulator 17

Printable Version

Utils

Description
Utils
Functions

indexToObject

Description
Returns index of object
Definition
indexToObject(table components, string index)
Arguments
tablecomponentscomponents (also (integer) id of root node possible)
stringindexindex
Return Values
integeridid of object
integeridid of used root node

vector2Length

Description
Returns length of vector
Definition
vector2Length(float x, float y)
Arguments
floatxx
floatyy
Return Values
floatlengthlength

vector3Length

Description
Returns length of vector
Definition
vector3Length(float x, float y, float z)
Arguments
floatxx
floatyy
floatzz
Return Values
floatlengthlength

lerp

Description
Returns interpolated value between two given values
Definition
lerp(float value1, float value2, float alpha)
Arguments
floatvalue1start value
floatvalue2end value
floatalphaalpha
Return Values
floatvalueinterpolated value

clamp

Description
Returns value between given min and max
Definition
clamp(float value, float minVal, float maxVal)
Arguments
floatvalueto clamp
floatminValmin value
floatmaxValmax value
Return Values
floatvaluevalue

getNoNil

Description
Returns second parameter if the first is nil
Definition
getNoNil(any_type value, any_type setTo)
Arguments
any_typevaluevalue
any_typesetToset to value
Return Values
any_typevaluenot nil value

getVectorFromString

Description
Returns vector from string separated by a whitespace
Definition
getVectorFromString(string input)
Arguments
stringinputinput
Return Values
any_typeunpackedValuesreturns unpacked values found in string

getVectorNFromString

Description
Returns vector N from string separated by a whitespace
Definition
getVectorNFromString(string input, integer num)
Arguments
stringinputinput
integernumnumber of values
Return Values
tablevaluesvalues