Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pulling My Hair Out

Denrael Leandros
90 Degrees From Everythin
Join date: 21 May 2005
Posts: 103
11-12-2005 16:54
Never mind on this...it was a stupid mistake...argh!

I have the following code in a single prim:

initialize() {
integer i = 0; // Local Counter
integer textureCount = llGetInventoryNumber(INVENTORY_TEXTURE);
llSay(0, "I contain " + (string)textureCount + " textures.";);
llSay(0, "I contain " + (string)llGetInventoryNumber(INVENTORY_OBJECT) + " objects.";);
for (i = 0; i < textureCount; i++) {
string textureName = llGetInventoryName(INVENTORY_TEXTURE, i);
key textureKey = llGetInventoryKey(textureName);
list itemInfo = llCSV2List(textureName);
string currentItemName = llList2String(itemInfo,0);
string currentItemPrice = llList2String(itemInfo,1);
integer inventoryType = llGetInventoryType(currentItemName);
llSay(0, (string)i + " Texture " + textureName + " Key " + (string)textureKey + " Item " + currentItemName + " " + currentItemPrice + " Type " + (string)inventoryType);
}
}



default
{
state_entry() {
initialize();
}

touch_start(integer foo)
{
initialize();
}
}



I have three items in the prim:

Prim1
Prim2
Prim3

and three textures,

Prim1,50
Prim2.50
Prim3,50

Yet, when I execute the script, I get back an inventoryType of -1 indicating the Prim object doesn't exist. Any and all ideas welcome.
Spuds Milk
Registered User
Join date: 28 Sep 2004
Posts: 94
11-14-2005 14:03
could you give the complete output of the program, it's unclear where/when it's dieing from your description.


You also don't need the
integer inventoryType = llGetInventoryType(currentItemName);

line, since you're ONLY getting textures in that loop