Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to store/retrieve data from multiple scripts

Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
08-11-2009 15:17
So i'm writing up a vendor script that reads data from multiple notecards, and it occurred to me that with enough data, i could hit a stack heap collision, how would i store and retreive the data from multiple scripts? i'm sure it has something to do with link messages communicating with other scripts in the same prim, but i dunno where to even start with that
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
08-11-2009 15:37
Well you can either go new age and put it on a server, which is what I would probably do OR..........

Read the notecards into different scripts. Control scripts gets a query and IM's all the other scripts. Those scripts look for the info and the one that finds it, answers. Say you have several scripts that are keeping track of sales data:

Location | UUID | Name | Product

Send a query for your "Super Dooper Pooper Scooper" and all the scripts will send back the vendor, the person who bought it and their key.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
08-11-2009 15:51
i have no idea how to work with servers, but i'm talking about item data, not buyer data, IE

Item Name, Item Texture, Price, Description.

can i set the pay price with one script and do the money event in another?

i guess when loading from the notecards i could send the data to the other scripts and then when scrolling thru the items it could send out a command with an index number?

i could have 1 script store the item names, one script store the textures, etc, and then the command would do something like:

llMessageLinked(LINK_THIS,(item index), "DISPLAY",NULL_KEY or other command);

and the other scripts would recognize the command and use the index to find the item name, texture, price etc. guess that would work ok for the display prim, but for texturing the "thumbnail" panels?

i've already written the script to sift out bad lines (lines with item names that aren't in the vendor, or lines with the wrong number of parameters for the item.)

if the price field is left blank or isn't a valid number, it automatically prices it as either 1 linden, or a configured default price that is set in a config card.

the texture field is only checked to see if it's blank, if it is, it replaces it with a default "blank" texture. i don't check for the texture in the contents cause this allows the user to use the uuid instead of having the texture in the contents referred to by it's name

the description field is parsed and recast to a string to have the ability to use line breaks: "\n"
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
08-12-2009 05:42
You may want to look at /54/99/311137/1.html and the VK-DBMS system by Very Keynes. Will allow you to use an Inworld server rather than offworld one and quite well suited to this.