Object Communication between Sims
|
|
Tarquin Quasimodo
Registered User
Join date: 8 Nov 2005
Posts: 38
|
03-28-2006 15:07
The application:
You touch an item in my shop for a free gift. I limit it to one gift per person by recording the name.
I added a second object on another floor. When someone touches it, it shouts over a high number channel "XXXX has had a gift". The other objects in the shop add this to their list, so I still only give out one free gift per person.
The problem.
I have another store in another sim, out of shouting range. How do I tell the object in the other sim who has touched in my current sim?
I thought if I knew the object key, I would be able to pass data, but I cannot see a way to do that.
|
|
Harris Hare
Second Life Resident
Join date: 5 Nov 2004
Posts: 301
|
03-28-2006 15:33
|
|
Exile Loudon
Aspiring Scripter
Join date: 10 Dec 2005
Posts: 122
|
03-29-2006 02:18
Simply said, Harris. Just get the key of the items that are touchable, and have them each email eachother the information; "OBJECTKEYHERE@lsl.secondlife" would be the address to email it to. Emails may take a few seconds of delay, as it is a pretty tedious process for the prims to write the email, send it and have the other respond. Good luck, and I hope I helped.
|
|
Nargus Asturias
Registered User
Join date: 16 Sep 2005
Posts: 499
|
03-29-2006 07:24
Umm...Exile. I think the email address should be : "OBJECTKEYHERE@lsl.secondlife.com"?
_____________________
Nargus Asturias, aka, StreamWarrior Blue Eastern Water Dragon Brown-skinned Utahraptor from an Old Time
|
|
Tarquin Quasimodo
Registered User
Join date: 8 Nov 2005
Posts: 38
|
03-29-2006 12:57
Thank you everyone, much appreciated.
|
|
Tarquin Quasimodo
Registered User
Join date: 8 Nov 2005
Posts: 38
|
04-15-2006 06:13
I believe the script pauses for 20secs after sending an Email, I assume to stop spamming. When the script pauses, does it still detect and listen.
If I am listening on a channel, are the messages queued waiting for the script to start executing again, or does the script go deaf, losing any messages sent in that 20 seconds?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
04-15-2006 08:30
It depends on how much happens in those 20s.
Events are queued into the list and sorted through in order after the 20s elapses, but the list has a limited length (I know it's 8 for collision events having tested it, I believe it's 16 for listens but I'm not sure why I think that now) - but basically what that means is if more than that number of events happen the rest are ignored.
The trick that most use is a farm of emailer scripts, so your main script doesn't sleep for 20s the comms script just sends a message and sleeps, then gets told about the next one and so on... There are variations around this theme of course, but the optimum mix depends on how busy you actually are.
|
|
Geepa Lazarno
Registered User
Join date: 7 Apr 2006
Posts: 61
|
04-15-2006 11:38
You might use a hub type object for the email, perhaps a decorative object like a column.
1) So you have Purr Son come in and he takes Gift A.
2) Gift A sends a message on channel 999 to add Purr Son to the name list.
3a) All the other local gifts add the name to their list.
3b) The "hub" object writes the email to send to the other hub(s).
4) The receiving hub then sends a message on channel 999 to all the objects at their sim to add Purr Son to their list.
5) Those objects then also add Purr Son on the list.
I'll remember how to email an object in the future I hope.
My only question is whether the hub could queue the names being added or would it be overwhlemed, and could you set up something to allow the hub to keep track of all the names on the list, and perhaps send multiple names at once if a lot of people take a gift.
|
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
04-15-2006 12:08
Or you could just go "the heck with it, I don't care that much about people getting two identical free gifts for the next week or three" and wait for llHTTPRequest in 1.9.1 so you can keep the whole database offsim.
|