Skip to content

$convert

Turn values of one type into another.

5 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

to_bool

read-only
$convert.to_bool(value: var) -> bool

Convert a value of any type to a value that holds a bool.

ParameterTypeMeaning
valuevarThe value to convert.

Returns bool: The bool value

to_float

read-only
$convert.to_float(value: var) -> float

Convert a value of any type to a value that holds a float.

ParameterTypeMeaning
valuevarThe value to convert.

Returns float: The float value

to_int

read-only
$convert.to_int(value: var) -> int

Convert a value of any type to a value that holds an int.

ParameterTypeMeaning
valuevarThe value to convert.

Returns int: The int value

to_ref

read-only
$convert.to_ref(value: var) -> Reference

Convert a value of any type to a value that holds a ref.

ParameterTypeMeaning
valuevarThe value to convert.

Returns Reference: The ref value

to_vec3

read-only
$convert.to_vec3(value: var) -> vec3

Convert a value of any type to a value that holds a vec3.

ParameterTypeMeaning
valuevarThe value to convert.

Returns vec3: The vec3 value