Jump to content

question about object to object communiction


Lunar Tripsa
 Share

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

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

Recommended Posts

Hello!

I'm trying to either figure out how to go about doing this, or if it be better to go in a different direction.

I'd like to have an avatar click on an object which will then say something to anouther specific object. I could have the avatar sitting on the specific object if that helps. I was thinking if I passed the avatar key back and forth, The touched object would remeber the avatars key then say it back. If one of the other abjects nearby was being sat on by that avatar it would do whatever it's supposed to do. I was wondering if there was a better way though. Ideally I'd rather not have the avatar sitting on it.

Thanks for any possible help!

Link to comment
Share on other sites

Take a look at your script's listen event.  It starts with

listen (integer channel, string name, key id, string message)

The parameter id is the UUID of whoever(whatever) sent the message.  If you want to send a confirmation message back to that person or object, you just need to write

llRegionSayTo(id,whatever_channel_id_will_be_listening_on,"I got your message!);

If the sender is a scripted object, id is the UUID of that object.  If you want to send your reply instead to whoever touched that object to send its message, you'll have to capture that person's UUID and send it along with (or as part of) the initial message. One way, assuming that you are sending the signal from your touch_start event, is to send it as

llRegionSay(special_channel,(string)llDetectedKey(0) + "~" + "Here is my clever message.");

Then, when your other script hears the message, it can do this in its listen event:

list temp = llParseString2List(message,["~"],[]);

key senderUUID = llList2Key(temp,0);

string NewMessage = llList2String(temp,1);

Link to comment
Share on other sites

I'm making a table setting and want each avatar to be able to pick what they want on their plate from dishes on the table.  I don't know how many place settings there will be and don't want to link everything becuase of other scripting things happening as well as letting the next owner easily adjust things to fit their needs. 

Other scripting will clear the table when the meal is finished so all objects with Listen will be removed.

Link to comment
Share on other sites

That makes sense to me.  I have made table settings that use the same approach and have not linked them either. 

We have had this discussion about the effect of listens on server load many times in this forum.  The overwhelming opinion is that the effect is negligible provided that:

1. You remember to close a llListen before opening another identical one.

2. You filter listens judiciously, so that they hear only the messages that you want them to listen for.

3. You avoid overusing common channels, especially PUBLIC_CHANNEL.

It is definitely possible to create chat lag and annoy the heck out of everyone around if you ignore those three rules.  If you use your head, though, listens are fine.  There are WAY more nasty things you can do with a script to create lag problems.

Link to comment
Share on other sites

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