Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Lightweight interobject communication

Renault Clio
Registered User
Join date: 26 Aug 2004
Posts: 130
12-28-2004 05:26
While trying to build an item update system, I've noticed that there's no really usable way to communicate between two objects, especially if one of them resides in the inventory of the other.

I'd like to suggest these patterns:

llSendMessage(key destobject, int p1, string p2); // Send message to object

receive_msg(key srcobject, int p1, string p2) // Receiving event
{ ... }

Ideally, there should also be a function a la:

string llHandshake(key destobject, int p1, string p2);

This would however be a synchronous method and rely on receive_msg returning a value. To prevent a script lock, the sim would check whether receive_msg issued a return statement or not, and based on that return an empty string.

Thanks for considering.
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
12-28-2004 05:59
Perceptive, aren't you :)
We've been screaming about better comms since beta... so far we got an email kludge and a crippled xml-rpc implementation, but no speedy, usable comms.
Renault Clio
Registered User
Join date: 26 Aug 2004
Posts: 130
12-28-2004 06:03
I gave XMLRPC an attempt, but if I can't tell the other object the channel key in an usable way, it's useless.

For what I want to do, I need a way to ask an inventory object a few questions (hoping that scripts do work on inventory objects).
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
12-28-2004 06:28
From: Renault Clio

llSendMessage(key destobject, int p1, string p2); // Send message to object
receive_msg(key srcobject, int p1, string p2) // Receiving event
{ ... }
string llHandshake(key destobject, int p1, string p2);


good but not good enough. It should send a list instead of a string. I figure for large script systems the most data is lost translating data back and forth between string and lists.

CODE

llSendMessage(key destobject, integer p1, list p2); // Send message to object
receive_msg(key srcobject, integer p1, list p2) // Receiving event
{ ... }
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey