These forums are CLOSED. Please visit the new forums HERE
Reading variable values from object description? |
|
|
Dylan Rickenbacker
Animator
Join date: 11 Oct 2006
Posts: 365
|
02-22-2008 06:00
I've seen gadgets that are set up that way ... several values are stored in the object description, separated by commas, and the script reads them out. I know I can read the description with llGetObjectDesc(), but how do I assign one of several comma-separated values to a variable?
|
|
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
|
02-22-2008 06:17
Hi Dylan! I usually convert them to a list, for example this object description contained a list of 3 comma-delimited numbers that are the x,y,z location coordinates to teleport to:
destination = llParseString2List(llGetObjectDesc(),[","],[]); targetPos.x = llList2Float(destination,0); targetPos.y = llList2Float(destination,1); targetPos.z = llList2Float(destination,2); If generic users are configuring the script using the description, you may want to clean it up a bit using llToUpper/Lower or llStringTrim before parsing. By the way, the other day you posted a prim question about an awesome circular building ... I'm building a similar one and would like to take a look at that one for proportions. Could you let me know where it is? TIA! . |
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
Beware
02-22-2008 07:39
I've seen gadgets that are set up that way ... several values are stored in the object description, separated by commas, and the script reads them out. I know I can read the description with llGetObjectDesc(), but how do I assign one of several comma-separated values to a variable? NOTE: as of Jan 31, 2008 all object names are truncated to 63 characters. (as per Jira SVC-674). It used to be 256 characters long The Object description is limited to 127 characters _____________________
From Studio Dora
|
|
Dylan Rickenbacker
Animator
Join date: 11 Oct 2006
Posts: 365
|
02-22-2008 15:46
Thanks Nika, that's exactly what I was looking for.
You'll find the building here: http://slurl.com/secondlife/Plush%20River%20VII/165/111/23 |