Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Get Position of an Object

Persephone Milk
Very Persenickety!
Join date: 7 Oct 2004
Posts: 870
03-08-2006 14:00
I had inadvertantly posted this in the Scripting Library forum. Sorry about that :)

I have two cubic prims rezzed in word, named Thing1 and Thing2. Thing1 contains a script, and that script would like to determine the position (x, y, and z) and rotation of Thing2. What is the best way to accomplish this? Assume that Thing1 knows the name and key of Thing2. Thanks.
_____________________
~ Persephone Milk ~

Please visit my stores on Persenickety Isle
Musical Alchemy - Pianos, harps and other musical intruments.
Persenickety! - Ladies Eyewear, Jewelry and Clothing Fashions
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-08-2006 14:09
Yes, you'll have to use a sensor - but you can make a much more efficient sensor than usual if Thing1 has Thing2's key already, by filtering to only detect that key.

If you don't mind some communication you could have Thing2 whisper, say, shout or email its position to Thing1, as well. But to be honest, unless you're using a sensor already and thus it would be annoying to have a multipurpose sensor event, I'd use a sensor.
Persephone Milk
Very Persenickety!
Join date: 7 Oct 2004
Posts: 870
03-08-2006 14:11
So there is no function like llGetPos where you would pass a key as a parameter?
_____________________
~ Persephone Milk ~

Please visit my stores on Persenickety Isle
Musical Alchemy - Pianos, harps and other musical intruments.
Persenickety! - Ladies Eyewear, Jewelry and Clothing Fashions
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
03-08-2006 14:12
Nope.
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
03-08-2006 16:28
Also, keep in mind that Thing 1 and Thing 2 have to be within 96 meters of one another for the sensor to work. If they're not you'll have to use email to send a message from Thing 1 to Thing 2, requesting position/rotation/etc information, and Thing 2 will have to use email to respond to this.
==Chris
_____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
Persephone Milk
Very Persenickety!
Join date: 7 Oct 2004
Posts: 870
03-08-2006 20:03
Thank you Ordinal and Christopher. You know, with limitations like these, it's no wonder we see the kind of lag we often see.
_____________________
~ Persephone Milk ~

Please visit my stores on Persenickety Isle
Musical Alchemy - Pianos, harps and other musical intruments.
Persenickety! - Ladies Eyewear, Jewelry and Clothing Fashions
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
03-08-2006 22:40
amen