Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Previous Rez Key

Ina Centaur
IC
Join date: 31 Oct 2006
Posts: 202
01-05-2007 00:16
Is there a way to obtain the previous key of an re-rez'ed object?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-05-2007 00:33
From: Ina Centaur
Is there a way to obtain the previous key of an re-rez'ed object?


Only if you store it yourself.

CODE

key Mykey = NULL_KEY;

default
{
state_entry()
{
if(NULL_KEY == Mykey) Mykey = llGetKey();
}

on_rez(integer num)
{
key id = llGetKey();
if(Mykey != id)
{
llOwnerSay("I've been re rezzed with a different Key!");
Mykey = id;
}
}
}


obviously if the script is reset then the key will be lost unless you write it into the description or some other 'permanent' store.
Ina Centaur
IC
Join date: 31 Oct 2006
Posts: 202
01-05-2007 00:55
would an object on my own land be considered an efficient permanent inworld store? (what would other inworld-storage possibilities be?)

what is the maximum number of keys that such an object can store? is there a way to purge the object's store-database periodically, like "cron jobs" on the object?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-05-2007 01:04
From: Ina Centaur
would an object on my own land be considered an efficient permanent inworld store? (what would other inworld-storage possibilities be?)

what is the maximum number of keys that such an object can store? is there a way to purge the object's store-database periodically, like "cron jobs" on the object?



Any script based storage, i.e. 'memory prims', will suffer from the same limitations.
For individual keys storing in the object description is possible but I wonder why you want to remember your old key anyway?

Storage within a script is limited to the amount of free memory (obviously) and will be dependant upon what else the script is doing. 16K does go a reasonable way if your careful.

Purging wil be down to simply emptying the list or reseting the script.

Other inworld solutions are manually argumented, i.e. the storage system has the ability to dump its contents to chat which you then manually cut and paste into a notecard.
Ina Centaur
IC
Join date: 31 Oct 2006
Posts: 202
01-05-2007 01:34
amount of free memory of the user or of the linden server where the remote storage-object is served?

it's my understanding that the previous key can't be stored in the same de-rezzed object. though the re-rez of the de-rez'ed object returns to the same state it was before de-rez, all variables are lost?

From: Newgate Ludd
Any script based storage, i.e. 'memory prims', will suffer from the same limitations.
For individual keys storing in the object description is possible but I wonder why you want to remember your old key anyway?

Storage within a script is limited to the amount of free memory (obviously) and will be dependant upon what else the script is doing. 16K does go a reasonable way if your careful.

Purging wil be down to simply emptying the list or reseting the script.

Other inworld solutions are manually argumented, i.e. the storage system has the ability to dump its contents to chat which you then manually cut and paste into a notecard.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-05-2007 01:51
When an object is taken into inventory it is effectively frozen at the point it was taken.
All variables are retained.

Each script is limited to 16K of memory for both code and data.
Damanios Thetan
looking in
Join date: 6 Mar 2004
Posts: 992
01-05-2007 01:53
From: Ina Centaur
amount of free memory of the user or of the linden server where the remote storage-object is served?

it's my understanding that the previous key can't be stored in the same de-rezzed object. though the re-rez of the de-rez'ed object returns to the same state it was before de-rez, all variables are lost?


There is a 16k heap/storage space in each script. But you can use multiple scripts/prims and llMessageLinked to overcome this limit. (Also remember LSL uses by value assignments, so with list manipulations you usually have a lot less than 16k at your disposal)

The full state of a script is saved on derez/rez, including global variables.
_____________________