Jump to content

storing vector data in a prim and retrieving it correctly


InternetHITS
 Share

You are about to reply to a thread that has been inactive for 2977 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi,

I have troubles to store or retrieving vector data of in prim description.

How can I resolve that?

I can read a string but retrieving vector data goes wrong

 

the prims object description contains this:

"<1,1,1>"

 

<start>

integer i=1;

string objectname        = llList2String(llGetLinkPrimitiveParams(i, [PRIM_NAME]), 0);
string objectdescription = llList2String(llGetLinkPrimitiveParams(i, [PRIM_DESC]), 0);

vector vdata = list2vector( lList2String(llGetLinkPrimitiveParams(i, [PRIM_DESC]), 0);)

llOwnerSay( "vector string : "+(string) vdata);

 <end>

 

Its driving me nuts

 

 

Link to comment
Share on other sites

It's perilous to use llList2Vector unless you know for sure that the list item you are unpacking was stored as a vector.  If there's any doubt, it is safer to use (vector)llList2String .  The implicit typecasting involved in llList2String always works, regardless of whether the list item is a string or not.  Once you know that you have safely typecast a value to a string, you can re-typecast it explicitly to a vector.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2977 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...