Toneless Tomba
(Insert Witty Title Here)
Join date: 13 Oct 2004
Posts: 241
|
04-16-2005 11:27
Hiro posted this: /invalid_link.html Can anyone confirm what it does, I think I just ran into it today. I'm messing around with textures & vector colors in lists. If I call: list demolist; string teststring = "<0.30980, 0.30980, 0.30980>";
default { state_entry() { demolist = [teststring]; llSay(0, llList2String(demolist, 0)); llSay(0, (string) llList2Vector(demolist, 0)); } } output: <0.30980, 0.30980, 0.30980> <0.00000, 0.00000, 0.00000> May seem kinda minor but I was banging my head against the wall trying to figure out what was going on. But if you input it as a string in the list llList2Vector will make it ZERO_VECTOR. I ran into the problem when reading data from notecards (The data default vaule is a string). I found two work arounds either inputing it as a vector in the list or covert it to vector when getting the data using (vector)llList2String. ========================================================== Sorry about double posting seems like this discussion is somewhat being talked about: /54/10/29562/1.html
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
04-16-2005 12:31
Been there, done that.
Lists don't like converting from strings directly into vectors or rotations. This is easy to fix:
(vector)llList2String(demolist,0);
... will return a proper vector.
(rotation)llList2String(demolist,0);
... will return a rotation.
I'm not sure whether this is a bug, since you're requesting that a list pull out an erroneous data type. I guess it *should* convert automatically as an error filter, but most of my code is written to convert after it pulls the string out.
_____________________
---
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
04-16-2005 13:42
Its not so much a bug as it is an inconsistancy in the llList2* functions. llList2Float and llList2Integer both cast if the entry is a string before returning. llList2Vector and llList2Rotation both return their zero values when asked to extract a string. ==Chris
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
04-16-2005 13:54
Yes Chris, this is also a valid observation. One of the reasons I first cast using llList2String for all string entries is as a precaution. I'm not sure whether it should work one way or the other, but my guess is fixing it to cast properly is the right way to go. 
_____________________
---
|