Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vector wont translate to a variable?

Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
04-21-2005 22:08
Ok this is either an odd one, I'm a script newb still, or it's just too damned late to think straight, but here's the deal.

Got a simple 5 item list, item #3 in the list is a vector.

I put it in a variable called location:
CODE

vector location = llList2Vector(data,3);
llSay(0,"location = " + (string)location);


Location comes up as a null vector, e.g. location = <0.00000, 0.00000, 0.00000>

But if I do the following:
CODE

llSay(0,"location = " + (string)llList2String(data,3));


It gives location = <151.67537, 194.50768, 21.30132>
Why?
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
04-21-2005 22:13
No idea why, but try (vector) llList2String and it will work.
It's been around forever, probably a bug, god knows why they haven't fixed it.
Maybe no one ever reported it?
Rotations need the same workaround.
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
04-21-2005 22:17
Thanks Eggy, that seems to work fine, although what a stupid bug! lol

Probably easy to fix too but what do I know :rolleyes:
Frans Charming
You only need one Frans
Join date: 28 Jan 2005
Posts: 1,847
04-22-2005 13:47
yea, that is a bug. If you look at some threads down you will see you aren't alone.