Hi,
What's the best way to persist data for an object? E.g. say an object recording various user's high scores, or preferences etc?
Ideally it should support moving the object, or upgrading the object with better functionality?
Thanks
These forums are CLOSED. Please visit the new forums HERE
Persisting Data? - How to store data? |
|
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
11-30-2005 03:31
Hi,
What's the best way to persist data for an object? E.g. say an object recording various user's high scores, or preferences etc? Ideally it should support moving the object, or upgrading the object with better functionality? Thanks |
|
Till Stirling
Crazy Inventor
Join date: 31 Jul 2004
Posts: 124
|
11-30-2005 08:04
Do a search here in this forum! The topic has been discussed several times!
Till Stirling _____________________
Our Shops:
SilverDay Castle in Degar (228, 10 ![]() SilverDay Shop in Atlas (75, 156) Cosy Market on Cosy Home (28, 137) SL Boutique: http://www.slboutique.com/Till_Stirling/ SLExchange: http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=113 |
|
Luc Aubret
Oreo-eater
Join date: 14 Sep 2005
Posts: 86
|
11-30-2005 20:20
I agree with Till, but I do want to point out something before you go mad looking for a solution.
I'm not sure what you mean by supporting upgrades, but keep in mind that the data you store in a script will find itself wiped if the script is reset. So if you're planning to do this, but still want to occasionally make changes to your functional script, keep a separate script just for holding that data, and pass information back and forth with link messages. Also keep in mind that there is a limit to how much data a script can hold. Take a look around the forums for creative ways to store information in a memory-thrifty way. If this data needs to be amassed in great quantities, however, you're probably going to want to look for a way to store this data off-world... such as by emailing it to an actual email address. |
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-01-2005 20:58
tks Luc
Yes I have been going a little crazy There doesn't seem an obvious library script with an API one can use for this easily, i.e. it does seem like I do need to jump into the deep end and understand the various tricks here as 2nd life doesn't offer persistance as a service well yet. Is this right? Also is it possible to ensure one's data script (i.e. script used for data only) doesn't get reset? Are then scenarios outside our own control whereby the script could be reset and data woudl be lost? Tks |
|
Jora Welesa
Dark Lady of the Sith
Join date: 11 Jul 2005
Posts: 153
|
12-01-2005 21:41
I don't know if this could be a solution for you as it's pretty limited. Storing the data within an object description. You're limited to only 127 characters, but if the data isn't long when converted to a string it might be useful. That way you can store your data, update your script, then call the data back from the object description. Here's a quick example I slapped together:
CODE
I'm pretty sure there's a much more efficient way of doing it, but I think you get the gist of it. Hope this helps some. ![]() |
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-01-2005 22:09
Tks - thats a cute approach - I think I'll need/want a little more storage space however (I'm assuming you're not suggesting to programmatically be creating mulitple invisible objects to store more info here)
The use of a "data only" script seems good - however I'm trying to understand more about whether there are scenarios outside our own control whereby the script could be reset and data woudl be lost. |
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
12-02-2005 13:03
I'm trying to understand more about whether there are scenarios outside our own control whereby the script could be reset and data woudl be lost. |
|
Greg Hauptmann
Registered User
Join date: 30 Oct 2005
Posts: 283
|
12-02-2005 16:18
sorry - I meant I'm interested in understanding when a script could RESET outside your own control - e.g. what if the server/sim gets reset? things like this?
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
12-03-2005 02:56
Sim resets DON'T reset scripts as far as we can tell - there's quite a lot of people that advertently or inadvertently can testify to that.
I don't know if Dark Life is still around. It used to use in world persistent data quite a lot, and as far as I know without mishap. It relied on scripts not resetting through crashes, world rebuilds etc. and seems to have managed just fine. |
|
Yellow Mountain
Registered User
Join date: 19 Jul 2006
Posts: 22
|
08-01-2006 23:46
I searched and this was about the only thread that came up on target so sorry if I'm
bumping something old. So just to confirm.... Data in a variable in a script does *not* get lost on server reboot? I can store stuff in a script variable and it will not be lost unless the script is reset either thru rezzing, error or the like? -Ben |
|
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
|
08-02-2006 00:34
So just to confirm.... Data in a variable in a script does *not* get lost on server reboot? I can store stuff in a script variable and it will not be lost unless the script is reset either thru rezzing, error or the like? That's right. |
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
08-02-2006 03:29
In /15/a8/124327/1.html I posted a script to store up to 25 numbers in a 127 character description field. That could be extended to store more numbers in the title field.
I did this script because I was using the builder's buddy to hold my house in place. Not sure how it got reset, it was not me, but someone somehow reset it and my house sank into the ground having lost its offsets from the base through a reset. Ed |