tovector (str: string) -> vector|nilCreates a vector from a string argument in format <1,1,1>
Invalid strings will return nil
Due to an old error from lsl strings that match upto the closing > are interpreted as valid
So <1,1,1, <1,1,1,1 and <1,1,1spoon are all cast to <1,1,1>
When testing if a string is a quaternion or a vector, you should test with toquaternion first.
.tovector('test')
{
"def": "func",
"name": "tovector",
"energy": 0,
"must_use": true,
"sleep": 0,
"signatures": [
{
"def": "signature",
"result": [
{
"name": "",
"def": "result",
"desc": "",
"variadic": false,
"type": [
{
"def": "simple",
"value": "vector"
},
{
"def": "simple",
"value": "nil"
}
],
"optional": false
}
],
"args": [
{
"def": "arg",
"name": "str",
"desc": "string to create vector from",
"type": [
{
"def": "simple",
"value": "string"
}
],
"variadic": false,
"optional": false
}
]
}
],
"desc": "Creates a vector from a string argument in format `<1,1,1>`\n\nInvalid strings will return `nil`\n\n#### Caveat\n\nDue to an old error from lsl strings that match upto the closing `>` are interpreted as valid\n\nSo `<1,1,1`, `<1,1,1,1` and `<1,1,1spoon` are all cast to `<1,1,1>`\n\nWhen testing if a string is a quaternion or a vector, you should test with `toquaternion` first.",
"link": "",
"takesSelf": false,
"private": false
}