Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Writing to a notecard

Mandi Adria
Registered User
Join date: 20 Aug 2006
Posts: 1
02-08-2007 20:45
I wanted to know if there was a way of writing to a notecard using lsl. If not then maybe someone here can recommend me doing this a different way. I'm having an object record the user as well as the amount of time spent by that user and want it saved to a notecard that way the data isn't lost when a server restart is made.
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
02-08-2007 20:58
Sorry, but no writing to a notecard. The best you can do is use the http functions to store on an external database
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-09-2007 03:47
Depending upon how much data you wish to store there are a couple of options.
For small amounts of data (100-200 characters max) you can use the description and name fields of the prim or another prim in a linkset. Using data compression can increase that, especially if the data is of an enumerated type, i.e has only a known fixed range of values.

You can use multiple prims to store larger amounts of data but its probably rather inefficient.

Another method is to store the data of world, use http/xml to talk to a database on aserver somewhere.

An inworld server is also possible using so called memory prims, a prim with scripts which are used just to store data for you. They communicate via email with your object.

One other point, 90% of sim restarts will not actually cause a huge amount of data loss, the server will be rolled back / restarted to last known good backup.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
02-09-2007 23:16
probally the closest thing to writing a notecard would be http + some sort of server scripting sytem (asp / php / ect)

the most basic implementation of this would be (whats called) a flat file, a simple example of this would be

object inworld request's a http page like whatever.com/storedata.php?data=Jane AV

php sees the varible data and assigns it the value of "Jane AV" and then writes that info to a text file on your webserver

now theres all kinds of issues with a system like this on a huge scale but it seems to do quite well for SL widgets, without getting into real databases
Frank Elderslie
Registered User
Join date: 26 Oct 2006
Posts: 8
02-12-2007 13:57
Good post. I'm looking for methods of saving data too and it looks there are lots of possible work-arounds.

If it's saved within a prim's fields, does it reset when the grid resets?

Does anyone know how Monry-Trees save their financial data?

-Frank
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-13-2007 02:17
From: Frank Elderslie
Good post. I'm looking for methods of saving data too and it looks there are lots of possible work-arounds.

If it's saved within a prim's fields, does it reset when the grid resets?

Does anyone know how Monry-Trees save their financial data?

-Frank


If a sim gets rolled back then all data gets rolled back with it. You could if you're paranoid use a duplex or triplex system, 2 identical servers and compare the results.

Depends upon the type of money tree you mean.
The ones I've noticed all seem to maintain a running donation total, a paid out total, top donators, last donators etc.. This could all just be stored internally in script variables since its non critical information. I mean who really cares if its rolled back 3 days ?

At thats assuming the information being displayed is real anyway....