Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Objects Speaking!

Abdullah Lemon
Lemons Estates
Join date: 2 Oct 2008
Posts: 56
01-04-2009 03:47
Good day SLers,

i was wondering if it was possible for two [UNLINKED] objects to issue commands to each other after an event occurs.

for example,

From: someone

// ~~~~ OBJECT 1 ~~~~
llSetTimerEvent(10.0);

timer()
{
// Talk to object No. 2 and tell it to change color to green!
}


From: someone

// ~~~~ OBJECT 2 ~~~~
//receives the command thru the listen event or something, and changes color to green


I appreciate any help :)
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
01-04-2009 04:21
It sure is possible, you even have more possibilities to choose from:) See:
http://www.lslwiki.net/lslwiki/wakka.php?wakka=communications
_____________________
From Studio Dora
Abdullah Lemon
Lemons Estates
Join date: 2 Oct 2008
Posts: 56
01-04-2009 22:22
From: Dora Gustafson
It sure is possible, you even have more possibilities to choose from:) See:
http://www.lslwiki.net/lslwiki/wakka.php?wakka=communications


i've been looking there since last night.. i found the LlRemoteLoadScriptPin,, but i still dont know how to use it.. not much data is provided.. and i'm not an expert.. if anyone would please post an example.. i can learn from.. thank you so much
Hooten Haller
Wonder and Joy
Join date: 5 Feb 2007
Posts: 45
Example
01-05-2009 04:58
Assuming the two objects are within 20 meters of each other:

// 1
llSay(8888, "color green";);


// 2
state_entry(){ llListen(8888, "", NULL_KEY, "";);}
listen(integer channel, string name, key id, string message) {
// examine "message" here
}

So you see chat/IM is not only for avatars.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-05-2009 05:20
Isn't llRegionSay more efficient than llSay?
_____________________
http://slurl.com/secondlife/Together
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
01-05-2009 05:40
From: Escort DeFarge
Isn't llRegionSay more efficient than llSay?

Yes, but the risk of reaching objects belonging to someone else is bigger:)
_____________________
From Studio Dora
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-05-2009 06:00
From: Dora Gustafson
Yes, but the risk of reaching objects belonging to someone else is bigger:)

True but if you are worried about that then you should filter in the listen...
if (llGetOwnerKey(id) == llGetOwner()) {}
_____________________
http://slurl.com/secondlife/Together
Abdullah Lemon
Lemons Estates
Join date: 2 Oct 2008
Posts: 56
01-05-2009 22:01
Thank you guys.. that would work in the same region.. and it helped me with my issue.. but,, since we are talking about it.. what about different regions? i want to send a message across SL.. how can i do that?

can i use

From: someone

llInstantMessage( key OBJECT, string message );
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
01-05-2009 22:08
Yes
Abdullah Lemon
Lemons Estates
Join date: 2 Oct 2008
Posts: 56
01-05-2009 22:09
From: Rolig Loon
Yes


oK... then i will be able to send commands to the object thro IMs.. right?
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-05-2009 23:18
From: Rolig Loon
Yes
It would be wonderful if you could use llInstantMessage with object keys but NO you can't!

You must use llEMail for full gridwide comms (unless you have the capability to write and run an external web application server).
_____________________
http://slurl.com/secondlife/Together
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
01-05-2009 23:19
I was too slow. oh well.

I think objects can't receive instant messages, and that llInstantMessage is only for sending messages to avatars.

I believe it's llEmail that can be used for object to object communication.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Abdullah Lemon
Lemons Estates
Join date: 2 Oct 2008
Posts: 56
01-05-2009 23:25
Yes.. i have access to a webserver.. and that's how i was using it.. but i dont want to use web... i want something within SL

just like "Name2Key".. i have to use a llHttpRequest.. that sux :/
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-05-2009 23:53
I'm not sure that having to poll llGetEmail really sux any less... ;)

edit: Might as well plug the now-venerable request for Object to Object instant messaging...
http://jira.secondlife.com/browse/SVC-310
Consider voting for it.
_____________________
http://slurl.com/secondlife/Together
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-06-2009 02:52
Well, "soon" you might have another option (though with its own set of issues). No idea when it'll be out of beta though. http://wiki.secondlife.com/wiki/LSL_http_server
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
01-06-2009 04:59
Escort: thanks for reminding me of that JIRA. What do you think of my suggestion of a "UDP-like" protocol? I was thinking of something that could be implemented efficiently on the sim, mapped directly to a single UDP message containing the UUID of the receiving prim and the string.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-06-2009 06:43
Cool. I've added my comments in the ticket :)
_____________________
http://slurl.com/secondlife/Together
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-06-2009 06:52
From: Hewee Zetkin
Well, "soon" you might have another option (though with its own set of issues). No idea when it'll be out of beta though. http://wiki.secondlife.com/wiki/LSL_http_server

Yep finally it seems we have a "fixed xml-rpc" by LL turning it into http-server. I still would like a good internal way to message between objects tho. However, considering the length of time llHttpServer and (even more amazingly) llTextBox have taken, I'm not gonna hold my breath.
_____________________
http://slurl.com/secondlife/Together
Abdullah Lemon
Lemons Estates
Join date: 2 Oct 2008
Posts: 56
01-06-2009 23:47
From: Escort DeFarge
Yep finally it seems we have a "fixed xml-rpc" by LL turning it into http-server. I still would like a good internal way to message between objects tho. However, considering the length of time llHttpServer and (even more amazingly) llTextBox have taken, I'm not gonna hold my breath.


True