Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
07-15-2005 15:09
Yes...still digesting LSL and still learning and still very grateful for any help that comes my way... ...so far my project has been a resounding success (especially because of great help from the forums on a couple sticky points), but I have one last--and major--step: I have two separate objects. Both are "dynamic" (i.e., they move). At a certain point I want to trigger an event that makes one object move to the other object and then track with it for a time. I've already got a whisper and listen between the two objects, and a sensor on one that will trigger the whisper. The challenge is... ...I need to pass the vector location of one object to the other object so that the second object may adjust its position accordingly. It appears that llMoveToTarget doesn't necessarily work, nor do llGetPos or llSetPos work on any object but the script caller... ...so I'm lost  Help?
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
07-15-2005 15:26
listen(integer chan, string name, key id, string msg) { vector pos = (vector)msg; while(llGetPos() != pos) llSetPos(pos); } http://secondlife.com/badgeo/wakka.php?wakka=typecast
_____________________
---
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
07-15-2005 15:36
Thank you...that block of code seems to make sense...but let me ask a question about it...
1) vector pos = (vector)msg;
--Should my message therefore be a string of the vector location of my whispering object? And if so...would it be as simple as string x = (string)llGetPos();?
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
07-15-2005 15:44
Code to that effect, yes. 
_____________________
---
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
07-15-2005 16:45
Excellent...I've been wondering how to do conversion type commands in LSL for a while now...and now I know. Much easier than the StringToInt32(); I'm used to 
|
Johnny Noir
Registered User
Join date: 5 Jan 2004
Posts: 28
|
07-15-2005 18:40
You should look at the faq for more info, but you can cast between most any type. There are however functions to switch between strings/lists.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
07-16-2005 05:26
actually there are specific functions to call just about anything out of list in the right type, llList2String(), llList2Float() etc. etc. Not entirely relevant to what you want in this case, but still a useful thing to know. http://secondlife.com/badgeo/wakka.php?wakka=lists for more detail about things into and out of lists.
|