Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Object key changes when attached?

Turokhan Legion
Vortech Enterprises CEO
Join date: 22 Jul 2007
Posts: 32
07-24-2008 05:40
Hey people :)

I have this script that emails an attached object a whole bunch of stuff...

Problem i just noticed is when i re-attach it, it has has a different key each time??

Any ideas why this happens, this doesn't happen if you resetscript or rez in world so why a new key when re-attached?

Thanks,
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
07-24-2008 07:43
Objects get new keys every time they are rezzed and every time they are attached:) Thats the way it is
_____________________
From Studio Dora
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
07-24-2008 12:12
From: Turokhan Legion
Hey people :)

I have this script that emails an attached object a whole bunch of stuff...

Problem i just noticed is when i re-attach it, it has has a different key each time??

Any ideas why this happens, this doesn't happen if you resetscript or rez in world so why a new key when re-attached?

Thanks,


it's because objects don't exist until you rez them. the key you can get while it's in inventory is the asset key, not the object key. If you have an object you need to keep the same key, you must never take it back to inventory, and certainly an attachment is pretty much out of the question. Better to use XMLRPC or HTTP which doesn't require a non-changing object key.
_____________________
Turokhan Legion
Vortech Enterprises CEO
Join date: 22 Jul 2007
Posts: 32
07-24-2008 13:44
oh...

Then how do i do object to object comms if it generates a new key eveytime? Kind of defeating the point it seems.

Cheers
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-24-2008 16:26
From: Turokhan Legion
Then how do i do object to object comms if it generates a new key eveytime? Kind of defeating the point it seems.

Yes. Exactly. But there is a middle ground, where you post a UUID someplace for the sending object to retrieve (e.g. via HTTP) and THEN use e-mail and simply refresh the destination UUID every once in a while. Of course, if you have the bandwidth/hosting you'll pretty quickly get hooked on the performance and versatility of HTTP anyway, and you won't be likely to ever want to mess with LSL e-mail again in your life. Heh.
Turokhan Legion
Vortech Enterprises CEO
Join date: 22 Jul 2007
Posts: 32
08-11-2008 00:48
I've seen a number of products that use llEmail.

Stargate
TARDIS

And more.

They talk to each other via llEmail. Maybe I have to relay the emails from my key as that never changes??

Any ideas would be greatly appreciated.

I understand HTTP could be better but I know llEmail works I've seen it and I wish to use it.

Heres my project..

Object A = Sender (an attachment so new key generated)
Sends a whole bunch of stuff to Object B..

Object B = Receiver (changes on rez but handles a new key in its dataserver. How to communicate with object A and say 'hello heres the new key'
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
08-11-2008 02:56
From: Turokhan Legion
I've seen a number of products that use llEmail.

Stargate
TARDIS

And more.
These are static objects that sit in a particular spot on the grid, are they not? That's how they are able to use e-mail for communication.


From: someone
Maybe I have to relay the emails from my key as that never changes??
Agents can't receive e-mail.


From: someone
Object A = Sender (an attachment so new key generated)
Sends a whole bunch of stuff to Object B..

Object B = Receiver (changes on rez but handles a new key in its dataserver. How to communicate with object A and say 'hello heres the new key'
As an attachment, Object A will be changing keys all the time. But under what circumstances does object B need to be re-rezzed? Is it something that will regularly be taken into/out of inventory? Or, once placed, is it expected to remain in-world indefinitely?

I once coded a remotely-controlled online status indicator, which would tell if a given agent was offline or online (via llRequestAgentData, as usual), and if the latter, on- or off-duty as the user wished, controlled by a HUD attachment, from anywhere on the grid. IIRC, when one of the indicators was assigned to an agent, they would be instructed to wear the HUD, and when they clicked on the status indicator to give it their agent key, it would whisper a message that the HUD would listen for, and thus get the status indicator's instance key.

The status indicator remained in-world all the time, hence it's instance key never changed, and the HUD just held it in memory. The status indicator never had to communicate with the HUD, so it didn't matter that the HUD's instance key changed all the time.