These forums are CLOSED. Please visit the new forums HERE
Object to object communication across sims? |
|
|
Chris Widget
Widget Isles @ the Edge!
Join date: 22 Jan 2006
Posts: 67
|
11-27-2006 13:58
I am sure there is a way to do this but so far I have hit a brick wall. Here is the idea. I need Object A in Sim Z to be able to communicate with Object B in Sim X. The communication is as simple as "Online" "Yes" "No" etc. Nothing too complicated. Email is out of the question since it is too slow and too laggy. So suggestions ? Help ? Please?
_____________________
---
Chris Widget Non |
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-27-2006 14:09
Unless you have the ability to relay via other prims Email is the only way.
How quick are you requiring? I have an email driven lift which works fine. |
|
Chris Widget
Widget Isles @ the Edge!
Join date: 22 Jan 2006
Posts: 67
|
11-27-2006 14:17
Unless you have the ability to relay via other prims Email is the only way. How quick are you requiring? I have an email driven lift which works fine. There has to be another method. Certainly systems like JEVN and LandMarker don't use emails to accomplish what they do? Per the wiki: "After sending the email, this function delays the script for 20 seconds." If you have to communicate with 6 different objects then you are delaying your script for 2 minutes or more.. <EDIT> Wait it delays the script not the object. So if you used linked messages and put the email script separate from the main script the delay wouldn't be noticed... still I would think there is something else that systems like the ones above use... _____________________
---
Chris Widget Non |
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
11-27-2006 14:21
There has to be another method. Certainly systems like JEVN and LandMarker don't use emails to accomplish what they do? Per the wiki: "After sending the email, this function delays the script for 20 seconds." If you have to communicate with 6 different objects then you are delaying your script for 2 minutes or more.. <EDIT> Wait it delays the script not the object. So if you used linked messages and put the email script separate from the main script the delay wouldn't be noticed... still I would think there is something else that systems like the ones above use... Well I've not had any problems but then I'm not worried about a few seconds here or there |
|
Damien Took
Meat Popsicle
Join date: 3 Dec 2004
Posts: 151
|
11-27-2006 14:54
I use email for long distance comms and it works just as fast as you have it checking for emails on the receiving script. Like you said, it only delays the sending script...not the object.
An alternative would be an object that moves in between sims from point A to point B carrying the message and shouting it on a specific channel to each object. That delay could potentially be significant depending on distance but it does work. |
|
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
|
11-27-2006 15:20
Huh.
doesnt the 20 second delay work like this: Sender sends. (goes instantly) Receiver can receive (Also right away) ...but meantime, Sender pauses for 20 seconds...then can send a second email to whomever... I thought this was to prevent email from flooding out of a script. The alternative, (to wait 20 seconds before the first email) would mean that elevators and vendors would exhibit a built-in long delay, while the original email is caught up in the 20 second delay. |
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
11-27-2006 15:25
Wait it delays the script not the object. So if you used linked messages and put the email script separate from the main script the delay wouldn't be noticed... still I would think there is something else that systems like the ones above use... Yes. This is how you can send multiple emails in a short space of time (or, for that matter, avoid any mandatory sleep from a function... making mandatory sleeps useless except for restricting beginning scripters... well, maybe that has some value). Another method of object-to-object communication is via llHTTPRequest and an off-world script somewhere. One object can make a request, a PHP script can receive that and store the information, then another one can ask for an update, and the PHP script delivers the message to it. You do need to be careful with security there if it's sensitive information. _____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names |
|
Andy Enfield
Hippo Technologies CEO
Join date: 22 Nov 2005
Posts: 79
|
11-27-2006 15:39
There has to be another method. Certainly systems like JEVN and LandMarker don't use emails to accomplish what they do? Per the wiki: |
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
11-27-2006 15:39
JEVN almost certainly uses emails.
You can do it differently with a server and a database and things. You llHTTPRequest out to a database, that XML-RPCs a message in, using a channel it looks up on the database. It can certainly be faster than email, but it's more RL expensive. If security is important, both are hackable in different ways, sending the spoof email or llHTTPRequest, xml-rpc is relatively secure, finding the key for the rpc-channel is almost certainly harder than the other methods. _____________________
|
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
11-27-2006 22:40
If its within the same sim, for communication as simple as you describe, I've found notecards to be the ideal solution. Just have one for every message - named "Online", "Yes" and "No" and send them using llGiveInventory. The receiver would then use its changed event and a conditional check (llGetInventoryType("Yes"
!= INVENTORY_NONE) to determine whether it receives "Yes" for example.Hope this helps ==Chris _____________________
October 3rd is the Day Against DRM (Digital Restrictions Management), learn more at http://www.defectivebydesign.org/what_is_drm
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
11-28-2006 00:19
course with http you could send out a request to a webserver and php mail (or whatever) the other object back with little to no delay, just a limitation on how many you can send over x time
ive done this with a vendor, when the parent gets new inventory the data is sent to a webserver, which inturn spams the message back out to 20 or so child vendors mostly @ once, all over the place |
|
Chris Widget
Widget Isles @ the Edge!
Join date: 22 Jan 2006
Posts: 67
|
11-28-2006 05:18
Thanks to everyone who responded, you have certainly given me plenty of food for thought on exactly how I want to handle this project.
Thanks again! _____________________
---
Chris Widget Non |
|
Champie Jack
Registered User
Join date: 6 Dec 2003
Posts: 1,156
|
11-28-2006 05:35
Thanks to everyone who responded, you have certainly given me plenty of food for thought on exactly how I want to handle this project. Thanks again! just remember that a script does not automatically trigger the email event when an email is sent to it. You must POLL the email event to get any emails. You can use a number of methods, but the most common for automated systems is to use a timer - llSetTimerEvent(float sec) see the wiki |
|
Nynthan Folsom
Registered User
Join date: 29 Aug 2006
Posts: 70
|
12-01-2006 18:48
I've done extensive development using emails and the solution to the delay is to maintain a pool of cascading email scripts. Before sending the current mail message, the currently active script starts the next, etc. One nice way to do this is to name the mailer scripts a single number. So in pseudocode:
integer nextscript; integer thisscript; ... link_message { thisscript = (integer) llGetScriptName(); if((nextscript = thisscript+1) > MAXNUM) nextscript = 0; llSetScriptState((string) nextscript, TRUE); llEmail( blah, blah, blah ); llSetScriptState((string) thisscript, FALSE); } I use 20 such mailerscripts (one for each second that llEmail is delayed) and jump thru some hoops to make sure that only one is active on a rez or reset. This works MUCH faster than HTTP calls, and does not suffer from the HTTP request throttle. It DOES, however, require a sizeable number of scripts in your prim, but since only one (or 2) mailerscript is active at a time ... |
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
12-01-2006 19:05
Some pretty clever ideas here
![]() Question for Nynthan: Does the driver script number the link messages in any way? If not, have you experienced race conditions where a link message will arrive in an email script's queue, but it goes to sleep inside the link message handler, and when it wakes up, it picks up a stale / old link message? |