Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Collecting and storing data

Klaatu Quintus
I Market, Build & Script
Join date: 1 Aug 2006
Posts: 23
11-10-2006 15:51
Is there a way to preserve the data gathered by a script by writing to a notecard or some other object at the end of a session? I want to track results from numerous sessions and compile histories for various individuals. Something like tracking player batting stats. Any ways to do this?

Klaatu
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
11-10-2006 16:04
No; you have to take your data out-world --which is very possible, and can be automated-- or trust the script to not reset.
_____________________
  1. ninjafoo Ng Says:
    November 4th, 2006 at 7:27 am
    We all love secondlife so much and were afraid that the magic will end, nothing this good can ever last…. can it?

Thanto Usitnov
Lord Byron wannabe
Join date: 4 Aug 2006
Posts: 68
11-10-2006 17:47
Depending on your needs, you may be able to store the data in a prim or series of prims. A cube prim has up to 9 faces (0 throug 8, if it's hollow and cut), each of which can store a color and an alpha channel, for a total of 36 floats. Additionally, each prim can store two 255 character strings via its name and description. All of these can be manipulated and accessed with zero script delay. If you need to store more floats, you can use a linkset, which allows you to store even more floats via scale, and relative position and rotation for each prim. There's no script delay to access that information, but there is a .2 second script delay to set it, though multiple fields can be set simultaneously via llSetPrimitiveParams.

If it's really batting averages and things of that sort, this sort of storage should be exactly what you're looking for.
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
11-11-2006 06:09
I have a script that has been continously running since march.

The one thing I have noticed is that when the sim is reset the script get's rolled back a tiny amount.
Chris Widget
Widget Isles @ the Edge!
Join date: 22 Jan 2006
Posts: 67
11-28-2006 05:34
From: Llauren Mandelbrot
No; you have to take your data out-world --which is very possible, and can be automated-- or trust the script to not reset.


Care to elaborate?
_____________________
---
Chris Widget
Non
Dimentox Travanti
DCS Coder
Join date: 10 Sep 2006
Posts: 228
11-28-2006 05:36
http requests... to a sql post & get
_____________________
LSL Scripting Database - http://lsl.dimentox.com
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-28-2006 07:02
From: Thanto Usitnov
Depending on your needs, you may be able to store the data in a prim or series of prims. A cube prim has up to 9 faces (0 throug 8, if it's hollow and cut), each of which can store a color and an alpha channel, for a total of 36 floats. Additionally, each prim can store two 255 character strings via its name and description. All of these can be manipulated and accessed with zero script delay. If you need to store more floats, you can use a linkset, which allows you to store even more floats via scale, and relative position and rotation for each prim. There's no script delay to access that information, but there is a .2 second script delay to set it, though multiple fields can be set simultaneously via llSetPrimitiveParams.

If it's really batting averages and things of that sort, this sort of storage should be exactly what you're looking for.



The limits are somewhat less than 255 characters. This was discussed previously but I seem to have lost the thread....

EDIT: Found it againits here
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
11-28-2006 15:08
I posted a compression algorithm in /54/99/124581/1.html

A prim's title and description can only store 63 and 127 characters respectively in the manual edit window. However, http://www.lslwiki.com/lslwiki/wakka.php?wakka=llSetObjectName says that the name can set/get 255 characters, but there is no mention of similar get/set for 255 chars for the description. I have not tested this.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-28-2006 15:11
From: ed44 Gupte
I posted a compression algorithm in /54/99/124581/1.html

A prim's title and description can only store 63 and 127 characters respectively in the manual edit window. However, http://www.lslwiki.com/lslwiki/wakka.php?wakka=llSetObjectName says that the name can set/get 255 characters, but there is no mention of similar get/set for 255 chars for the description. I have not tested this.



There was also a caveat that the manual limits can be reapplied by sim restarts and or so other interactions.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
11-28-2006 16:04
I store a "size" setting in the description in one of my scripts.. works like a CHARM. can even reset the script on rez, and it can pull-up the stored variable from last session.

For small data like this, description works.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
11-28-2006 17:33
Sorry, I meant to say that I am not sure the programmatic set/get of description works for the whole 255 characters even after a sim reset. It certainly works for me up to 127 characters.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
11-28-2006 18:42
I've written some "database" (key/value pairs, basically) storage scripts which can store and query about 12k of data per slave script, but you can only add to and query from them, not update/delete (well, you can flush them, but you can't surgically delete a record).

Problem is, if they get reset, the data goes byebye. Also, if the prim they are in disappears (which I've seen happen to prims which had been around a while), then you've lost the data.

It's kinda tricky, but it can be done.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
11-29-2006 01:42
From: Talarus Luan
I've written some "database" (key/value pairs, basically) storage scripts which can store and query about 12k of data per slave script, but you can only add to and query from them, not update/delete (well, you can flush them, but you can't surgically delete a record).

Problem is, if they get reset, the data goes byebye. Also, if the prim they are in disappears (which I've seen happen to prims which had been around a while), then you've lost the data.

It's kinda tricky, but it can be done.



You could try adding notecard support, i.e. have the ability to dump the data stored to chat which can then be cut n pasted back into notecard. It will reduce the storage capacity
a little but would allow a level of 'permement' storage.

I'm guessing that the update/delete problem is due to memory requirements to copy the lists?