User:Ugleh Ulrik/Vector2List
< User:Ugleh Ulrik
Jump to navigation
Jump to search
Revision as of 23:26, 18 April 2010 by Ugleh Ulrik (talk | contribs)
This UD Function I made creates a list with 3 strings for the 3 cords of a vector.
For Example
list thislist = Vector2List(llGetPos());
As a list, would output
list thislist = [x,y,z];
Function
list Vector2List(vector v){ list alist = llParseString2List((string)v,[",", ">", "<"],[]); return alist; }
An Example
list Vector2List(vector v){ list alist = llParseString2List((string)v,[",", ">", "<"],[]); return alist; } default { touch_start(integer total_number) { list thislist = Vector2List(llGetPos()); string x = llList2String(thislist,0); string y = llList2String(thislist,1); string z = llList2String(thislist,2); llOwnerSay("X Axis: " + x); llOwnerSay("Y Axis: " + y); llOwnerSay("Z Axis: " + z); } }