sophy7777 Posted November 27, 2020 Share Posted November 27, 2020 im trying to make a menu for name tags, i have the alphabet in textures so 29 textures in all. this ornignaly was a 22 holding script that i tried to add a menu too, but hasnt really gone to plan. could anyone asist me in where im going wrong here? i thought adding another list and following the flow of the script would result in another menu added. i may be missing something ovious here so please excuse me if i have! when i try to click my modded script it tells me this; [18:51] Object [script:menu_textute_change] Script run-time error [18:51] Stack-Heap Collision heres my modded script list MENU1 = []; list MENU2 = []; list MENU3 = []; integer lisn; integer MENU_CHANNEL = 1230; // opens menu channel and displays dialog Dialog(key id, list menu) { llListenRemove(lisn); lisn = llListen(MENU_CHANNEL, "", NULL_KEY, ""); llDialog(id, "Select one object below: ", menu, MENU_CHANNEL); } default { on_rez(integer num) { llResetScript(); } listen(integer channel, string name, key id, string message) { if (channel == MENU_CHANNEL) { llListenRemove(lisn); if (message == ">>") { Dialog(id, MENU1); } else if (message == ">>") { Dialog(id, MENU2); } else if (message == "<<") { Dialog(id, MENU3); } else if (message == "<<") { llSetTexture(message, ALL_SIDES); // display the texture from menu selection } } } touch_start(integer total_number) { integer i = 0; MENU1 = []; MENU2 = []; MENU3 = []; // count the textures in the prim to see if we need pages integer c = llGetInventoryNumber(INVENTORY_TEXTURE); if (c <= 12) { for (; i < c; ++i) MENU1 += llGetInventoryName(INVENTORY_TEXTURE, i); } else { for (; i < 11; ++i) MENU1 += llGetInventoryName(INVENTORY_TEXTURE, i); for (; 12 <22; ++i) MENU2 += llGetInventoryName(INVENTORY_TEXTURE, i); MENU2 += ">>"; MENU3 += "<<"; if(c > 34) c = 34; for (; i < c; ++i) MENU3 += llGetInventoryName(INVENTORY_TEXTURE, i); MENU2 += ">>"; MENU3 += "<<"; } // display the dialog Dialog(llDetectedKey(0), MENU1); } } heres the oringinal list MENU1 = []; list MENU2 = []; list MENU3 = []; integer lisn; integer MENU_CHANNEL = 1230; // opens menu channel and displays dialog Dialog(key id, list menu) { llListenRemove(lisn); lisn = llListen(MENU_CHANNEL, "", NULL_KEY, ""); llDialog(id, "Select one object below: ", menu, MENU_CHANNEL); } default { on_rez(integer num) { llResetScript(); } listen(integer channel, string name, key id, string message) { if (channel == MENU_CHANNEL) { llListenRemove(lisn); if (message == ">>") { Dialog(id, MENU2); } else if (message == ">>") { Dialog(id, MENU1); } else if (message == "<<") { Dialog(id, MENU1); } else { llSetTexture(message, ALL_SIDES); // display the texture from menu selection } } } touch_start(integer total_number) { integer i = 0; MENU1 = []; MENU2 = []; MENU3 = []; // count the textures in the prim to see if we need pages integer c = llGetInventoryNumber(INVENTORY_TEXTURE); if (c <= 12) { for (; i < c; ++i) MENU1 += llGetInventoryName(INVENTORY_TEXTURE, i); } else { for (; i < 11; ++i) MENU1 += llGetInventoryName(INVENTORY_TEXTURE, i); if(c > 22) c = 22; for (; i < c; ++i) MENU2 += llGetInventoryName(INVENTORY_TEXTURE, i); MENU1 += ">>"; MENU2 += ">>"; for (; i < c; ++i) MENU2 += llGetInventoryName(INVENTORY_TEXTURE, i); MENU1 += ">>"; MENU2 += ">>"; } // display the dialog Dialog(llDetectedKey(0), MENU1); } } thanks in advance anyone who helps! Link to comment Share on other sites More sharing options...
Mollymews Posted November 27, 2020 Share Posted November 27, 2020 seems is a typo in this line: for (; 12 <22; ++i) the condition 12 < 22 is always TRUE. So a endless loop til run out of memory should be: (; i < 22; ++i) Link to comment Share on other sites More sharing options...
Fritigern Gothly Posted November 27, 2020 Share Posted November 27, 2020 3 hours ago, sophy7777 said: [18:51] Object [script:menu_textute_change] Script run-time error [18:51] Stack-Heap Collision Your lists are filling up, and then the script is trying to add more to the list. That is what a stack heap collision is. Molly's advice is sound, so give that a go. Link to comment Share on other sites More sharing options...
sophy7777 Posted November 28, 2020 Author Share Posted November 28, 2020 thanks so much for the advise it dd stop the stack heap collision but now i can't switch between menus so gonna poke it a lil more! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now