Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What is the maximum....

Spidey Cela
Registered User
Join date: 26 Oct 2005
Posts: 5
12-05-2005 05:41
What is the maximum number of inventory items an object can hold.
ie Maximum number of textures, Maximum number of sounds.

Would I encounter problems with having an object wih 200 sounds?

Is there a memory limitation. For example, if I store everyones name who enters my sim into an array, would I be able to record a few thousand names?
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
12-05-2005 06:09
I'm not sure about the inventory item question, however for storing nams in a script, you'd have to use a list which can be quite memory hungry.

A script which does nothing EXCEPT hold names (ie it can take data and nothing else) would be able to hold about 150 names without any problems. More than this and I'm not sure, as a script has a 16k memory limit (which includes the compiled code itself).

Something I'm working with which you could do is basically put a script in your object which has a global variable list to store names, and the only event you need to put in it for receiving link messages. Have it check the integer part like so:

CODE
list names; // Store names in here

default {
link_message (integer linkNum, integer x, string name, key id) {
if (x == MY_NUMBER) { names += [name]; }
}
}


(Be sure to replace "MY_NUMBER" with any integer of your choice)

You will have to add in extra methods if you need to check for a name already being there (you could send the object's key via 'id', if it is null it adds name, if it is set then it looks for name in its list and replies with yes or no as appropriate).

Place several copies of this script into your object, with each having a consecutive MY_NUMBER value (ie if the first is 100, then the second is 101 etc.) so that they can addressed by the parent script more easily.
Till Stirling
Crazy Inventor
Join date: 31 Jul 2004
Posts: 124
12-05-2005 08:26
I know of an avatar who has stored more than 689 Items in a vendor I created (yes the vendor can actually hold this many and more). So the limit is well above that.

Till Stirling
_____________________
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
12-05-2005 08:32
I'm not sure that there is a limit to the number of items in inventory (although it does become increasingly unwieldy to access them). I've used one of Till's texture displays with over 1,000 items in it's inventory without trouble. I've since bitten the bullet and split them into more manageable groups, but it worked just fine.

Scripting limits are by memory. As the earlier posters have said around 150 items is the most you can normally store in a script, that's with little else in there, and the 16k limit. There are all kinds of inventive ways around that with memory scripts and assigning things to sub-scripts for storage, or even off world storage and xmlrpc, but that's where your limit will come.

Till, I'm 99% sure, gets around it by smart use of pointers and not storing all the data in the object, rather reading the relevant bits of code off, which depending on your application may also be a viable approach.
Till Stirling
Crazy Inventor
Join date: 31 Jul 2004
Posts: 124
12-05-2005 10:05
You absolutely correct, Eloise! Only the data required are held inside the script.

Till Stirling
_____________________