Hawk Mendicant
www.hawkuk.com
Join date: 6 Jun 2005
Posts: 30
|
06-21-2005 04:28
Hi, I'm just getting to grips with LSL and since I couldn't find what I was looking for in the Wiki I thought i'd see if any of the people here could help.
I'm working on a script for an object which will detect other objects in the area with the same name. I think that should be easy enough using llSensor and llDetected*. However, I wanted to be able to pick up the Description of the detected object and there doesnt seem to be an llDetectedDesc function to help me.
Does anyone have a suggestion for the best way to do this? The only way I can think of is to have the script llShout to the object and have it llShout back it's description but that seems like a lot of efford just for a description and i'd rather not have things listening all the time.
Any advice gratefully recieved. Thanks, Hawk
|
Ace Cassidy
Resident Bohemian
Join date: 5 Apr 2004
Posts: 1,228
|
06-21-2005 04:56
The only LSL function to get an object's description can only get the description of the cocntaining object. So you're left with 2 choices :
Do the shout/listen approach you mentioned in your post
-or-
Use the object name to contain the distinguishing dtata
- Ace
_____________________
"Free your mind, and your ass will follow" - George Clinton
|
Hawk Mendicant
www.hawkuk.com
Join date: 6 Jun 2005
Posts: 30
|
06-21-2005 06:41
Thanks for your reply Ace. I'll probably put the details in the object name. I was going to pick up the specific name in the llSensor but i'll just have to get all of them and filter out based on part of the name (unless llSensor accepts wildcards?!)
Cheers, Hawk
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
06-21-2005 14:40
From: Hawk Mendicant Thanks for your reply Ace. I'll probably put the details in the object name. I was going to pick up the specific name in the llSensor but i'll just have to get all of them and filter out based on part of the name (unless llSensor accepts wildcards?! It doesn't accept wildcards, unfortunately. As you're limited to 16 objects with sensors, you might want to reconsider. How much data are we talking about? Is there another way you could encode it?
|
Rhysling Greenacre
Registered User
Join date: 15 Nov 2003
Posts: 132
|
06-21-2005 16:49
Just throwing this out there...
Periodically have your objects broadcast out the information your looking for on some secret channel in the format "key//information". Use llParseString2List to break apart the string into tokens.
When your scanning object hears this, put it into a strided list [key1, value1, key2, value2, ...]. When you scan you'll get the key of the detected object, and you can look up its information in the list.
When the list grows beyond a certain size, delete some elements at the front of the list.
|
Hawk Mendicant
www.hawkuk.com
Join date: 6 Jun 2005
Posts: 30
|
06-22-2005 03:40
Thanks Catherine and Rhysling. I'd missed the part about llSensor only handling 16 objects, that's a bit annoying. Looks like i'll have to go down the route of having my objects shout to each other instead. At least this way I can send other data between them if necessary.
|