Jump to content

Prim interacting with another prim as sort of a relay?


Blushberry
 Share

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

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

Recommended Posts

I'm trying to make a script that detects avatars within a designated range of a prim and then have that prim relay the information to another prim, listing who is within the range of said prim when clicking on the relayed object?

 

How do I make it so they interact in such a way?..

Also on top of that. How do I manipulate hovertext to display a number of how many people are within the range of the prim thats detecting the residents?..

Link to comment
Share on other sites

To detect avatars you can use llSensor basic examples in the wiki: http://wiki.secondlife.com/wiki/LlSensor

To relay information to another prim you could chat the information on a non public channel and have the other prim listen on that channel, That is using llSay e.g. llSay(-3948, "Message");

Look up listen in the wiki to see how to set that up.

For hover text you use  llSetText. Use \n to make new lines. There is a limit to the number of characters so you have to work out how to handle that if needed. For example just showing x number of people at a time and rotating through a list.

Go and have a try at it and then come back here with your script if you have more questions or run into trouble.

Link to comment
Share on other sites

You sure llsay is what I'm looking for?.. I need two prims to share variables or send variables to each other.. One prim will detect the avatars. and then relay who is within range... to another prim which will display the number of people that are within range... clicking it will display the names.

Link to comment
Share on other sites

If these 2 prims are in the same region, I would recommend llRegionSayTo. If those prims are on different regions, llEmail is your friend. But like Ohjiro mentioned, you will have to deal with string lenght limits. Sensor will return 16 results max. llGetAgentList would be another option. Looping through the results and measuring distance llVecDist, and converting keys to names with llGetObjectDetails.

Link to comment
Share on other sites

llGetAgentList is a better option than llSensor for this sort of operation.  Once you get the UUIDs from whatever method you use, you still need to extract usernames from them.  If you're on the same region, you can use llKey2Name.  Otherwise, you have to go the more complicated route of using llRequestAgentData and then using a dataserver event to get DATA_NAME, which is a pain.

Link to comment
Share on other sites

I'm a bit of a noob when it comes to scripting but im starting a bit high up there I'll try to explain again. From what it sounds like so far from what you're all saying this may be impossible to do.

 

One object relays all avatars within range of the relay prim, which is in another location on the same parcel. But up a bit higher. in a skybox. I have several skyboxes. I want a relay in each one.

 

When someone clicks the object (The one that displays information on who is where) it tells the resident which rooms other people are at. So they don't have to go all around the parcel through the teleporters... trying to find where everyone is.

 

I want it to detect as many residents as it needs to. Is this possible? 100% Fully working possible. That is what I'm trying to do. I'm not trying to get avatars in the entire region.. or parcel.. or w/e (Though thank you for that suggestion. I will put that to use for something else)

Link to comment
Share on other sites

It's possible to do what you describe, the way you describe doing it -- and indeed there was a time before llGetAgentList() when that approach was appropriate. The thing is, it's now sustantially more efficient for a single script to call llGetAgentList() and wade through the results to figure out which are in proximity to your known "room" locations (compared to running separate sensors in each of those rooms).

Once the central script determines who's in which rooms, it might use llRegionSay() to broadcast that information to other scripts that use llSetText() to display it when touched.

(In fact, it would be slightly better if, on touch, the display objects request that information of the central script instead of collecting it all the time, but it's also slightly more complex to script such two-way inter-object communications. It may be worth the effort, though, especially if those displays don't need to update automatically, in which case even the central script could run only on-demand.)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3378 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...