Menu Driven Texture Script - Need Help
|
Andrea Sage
Registered User
Join date: 18 Oct 2006
Posts: 14
|
08-22-2009 11:28
Ok... I got this script here: http://wiki.secondlife.com/wiki/Texture_Menu_ManagementBut I need one that can handle more than 23 textures... more like... 150. Can anyone help? I can mess around and change scripting some to fit my needs, but this is way beyond me.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 12:11
You are allowed 12 buttons on a pop up menu and that is why that script uses multiple lists of 12 inventory items each. Just keep doing like it is written to add enough menus to cover 150 items. That script is wasteful in the fact that it should build the menu lists in state entry and only rebuild them if inventory changes.
If you are asking someone to write it for you with no attempt on your part, then no, post it in Products Wanted. This is Scripting Tips not Scripts Wanted.
_____________________
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
|
Andrea Sage
Registered User
Join date: 18 Oct 2006
Posts: 14
|
08-22-2009 12:17
Not asking that at all... but I am trying to edit it to allow for more menus, and I just keep braking it. Some help pointing me in the right direction is all I am asking for.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 12:20
From: Andrea Sage Not asking that at all... but I am trying to edit it to allow for more menus, and I just keep braking it. Some help pointing me in the right direction is all I am asking for. Post what you have
_____________________
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
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 12:27
From: Jesse Barnett That script is wasteful in the fact that it should build the menu lists in state entry and only rebuild them if inventory changes. Why would it be considered wasteful? That's a perfectly valid way to list assets in object inventory, especially since building a list of them could run you out of memory otherwise.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 12:39
From: Talarus Luan Why would it be considered wasteful?
That's a perfectly valid way to list assets in object inventory, especially since building a list of them could run you out of memory otherwise. It is wasteful to make the simulator do the same thing multiple times, when only doing it if inventory changes, works. Even 150 texture names is not going to exceed script memory AND that script is already building the lists. Which is better for the simulator?: Touch the object 20 times and..... ........... A) Build multiple lists 20 times. B) Build lists 1 time. ?????????????????
_____________________
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
|
Andrea Sage
Registered User
Join date: 18 Oct 2006
Posts: 14
|
08-22-2009 12:49
its not letting me post it... when I try I get the "cannot find this page" error. Is it too long?
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 12:56
From: Andrea Sage its not letting me post it... when I try I get the "cannot find this page" error. Is it too long? Drop me a PM by clicking on my name here and "Send a private message to Jesse Barnett" with your script pasted inside. I will post it and point out why the forum would not allow you to post it. Hang in there Andrea, glad to see you are interested in learning. We get a lot of people looking for freebies and sometimes it is hard to tell the difference.
_____________________
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
|
Andrea Sage
Registered User
Join date: 18 Oct 2006
Posts: 14
|
08-22-2009 13:05
Wont let me PM the script to you either. This is what I get:
Not Found
The requested URL /private.php was not found on this server. Apache/2.2 Server at forums.secondlife.com Port 80
And when I try to put the script in a reply and post it I get this:
Not Found
The requested URL /newreply.php was not found on this server. Apache/2.2 Server at forums.secondlife.com Port 80
Guess Its not meant to be for me...
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 13:09
From: Jesse Barnett It is wasteful to make the simulator do the same thing multiple times, when only doing it if inventory changes, works. Even 150 texture names is not going to exceed script memory AND that script is already building the lists.
Which is better for the simulator?:
Touch the object 20 times and..... ...........
A) Build multiple lists 20 times.
B) Build lists 1 time.
????????????????? So? You're going to be building a separate list anyway every time you call llDialog, since it can't take the entire prebuilt list of options. What if someone wants to put in 500 textures, or 1000? If you think people won't, you're dreaming. The amount of effort/time taken to build a list of options every dialog isn't that much greater than pulling from a pre-built list, and doesn't suffer from memory limitations.
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 13:11
From: Andrea Sage Wont let me PM the script to you either. This is what I get:
Not Found
The requested URL /private.php was not found on this server. Apache/2.2 Server at forums.secondlife.com Port 80
And when I try to put the script in a reply and post it I get this:
Not Found
The requested URL /newreply.php was not found on this server. Apache/2.2 Server at forums.secondlife.com Port 80
Guess Its not meant to be for me... Andrea, make sure that anywhere you use vector notation, there is a space before and after any < or >. It will likely let you post it then.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
08-22-2009 13:13
It's just the silly way the forums accept things to post. You have to go through your entire script and be sure that there is a space after every "< " symbol (and now, I guess, every "& " symbol too) or the forums will refuse to upload it. There are a few other stupid rules, but that's the usualy one that causes trouble.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 13:17
From: Talarus Luan Andrea, make sure that anywhere you use vector notation, there is a space before and after any < or >. It will likely let you post it then. Newly discovered one: = [ without a space between.
_____________________
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
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 13:20
From: Talarus Luan So? You're going to be building a separate list anyway every time you call llDialog, since it can't take the entire prebuilt list of options.
What if someone wants to put in 500 textures, or 1000? If you think people won't, you're dreaming.
The amount of effort/time taken to build a list of options every dialog isn't that much greater than pulling from a pre-built list, and doesn't suffer from memory limitations. I understand what you are saying and have used inventory pointers before and will probably use an inventory pointer here instead of building 16 separate lists. My point was still valid in regards to THAT script. From: someone THAT script is wasteful in the fact that it should build the menu lists in state entry and only rebuild them if inventory changes.
_____________________
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
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
08-22-2009 13:23
From: Jesse Barnett Newly discovered one: = [ without a space between. Oh, great. :=[ Hey! Wait a sec .......... ???
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
08-22-2009 13:23
=[ ?
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 13:24
From: Rolig Loon Oh, great. :=[ Hey! Wait a sec .......... ??? Investigating further. This script will not post unless you add the space between = & [ http://docs.google.com/Doc?docid=0AWKSp4VPA02sZGRrMmNrc3ZfMWdxYzRyamZr&hl=en
_____________________
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
|
Andrea Sage
Registered User
Join date: 18 Oct 2006
Posts: 14
|
08-22-2009 13:30
THanks for the help Jesse... and for accepting the script inworld. I know when you look at it you are going to be like "She missed this, and this, and this, and this..." but I am really just trying to learn as I go. I scritped for an RPG game a few years back, was similar, but it was a long time ago, and its different enough that I am lost when it comes to anything major with LSL.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 13:31
list questions =["What did you have for breakfast this morning?", "What is your star sign?", "Do you like pie?"];
string caption; list answers; list temp;
integer in_use; integer counter; integer listen_channel = 5; integer dialog_channel = -15045; integer handle;
integer max;
key av_id; give_dialog(key av_id) { handle = llListen(dialog_channel, "", av_id, ""); caption = "Please click OK and then reply on channel " + (string) listen_channel + " to the following question:"; llDialog(av_id, caption + (string) (counter + 1) + " " + llList2String(questions, counter),["OK"], dialog_channel); llSetTimerEvent(20.0); }
default {
state_entry() {
max = llGetListLength(questions); }
touch_start(integer n) { key toucher = llDetectedKey(0); if (in_use == FALSE) { // no one's using me in_use = TRUE; counter = 0; av_id = toucher; give_dialog(av_id); } else if (in_use == TRUE) { if (toucher != av_id) { llInstantMessage(toucher, "Sorry, this is in use at the moment"); return; } else { give_dialog(av_id); } }
}
timer() { // the av has got bored with the survey, so let's time out and reset llSetTimerEvent(0.0); llListenRemove(handle); temp =[]; av_id = NULL_KEY; in_use = FALSE; }
listen(integer channel, string name, key id, string msg) {
if (channel == dialog_channel) { llListenRemove(handle); llSetTimerEvent(0.0); handle = llListen(listen_channel, "", id, ""); } else if (channel == listen_channel) { llListenRemove(handle); llSetTimerEvent(0.0); answers +=["In reply to question " + (string) (counter + 1) + ", " + name + " said "]; answers +=[msg]; temp +=[msg]; ++counter; if (counter < max) { give_dialog(id); } else { for (counter = 0; counter < max; ++counter) { llInstantMessage(id, "In reply to the question, \"" + llList2String(questions, counter) + "\" you said, \"" + llList2String(temp, counter) + "\""); } temp =[]; av_id = NULL_KEY; in_use = FALSE; } }
} }
}
_____________________
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
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 13:38
From: Jesse Barnett Newly discovered one: = [ without a space between. Ewww.. suck.
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 13:50
From: Jesse Barnett I understand what you are saying and have used inventory pointers before and will probably use an inventory pointer here instead of building 16 separate lists. My point was still valid in regards to THAT script. *shrug* Well, I respect your opinion; I don't happen to share it, is all. I don't find it "wasteful", especially since it is an example. In practice, either method can be just as "wasteful". In one, you're "wasting" memory. In the other, you're wasting CPU cycles. However, an interesting benchmark result I discovered comparing the two: 100 iterations: [13:43] Object: Testing pulling a list subset [13:43] Object: 2009-08-22T20:43:56.950622Z [13:43] Object: 2009-08-22T20:43:57.094210Z [13:43] Object: Testing pulling a list from inventory [13:43] Object: 2009-08-22T20:43:57.094373Z [13:43] Object: 2009-08-22T20:43:58.079384Z Multiple tries show the first method to be around twice as fast as the second. 1000 iterations: [13:44] Object: Testing pulling a list subset [13:44] Object: 2009-08-22T20:44:16.387130Z [13:44] Object: 2009-08-22T20:44:59.522195Z [13:44] Object: Testing pulling a list from inventory [13:44] Object: 2009-08-22T20:44:59.594338Z [13:45] Object: 2009-08-22T20:45:09.442944Z Multiple tries show the first method to be around three times as slow as the second. Both mono compiled. Test script: list gaList; integer giLoopCount = 1000;
default { state_entry() { integer liIndex; // Pre-build the main list gaList = []; for (liIndex = 0; liIndex < 200; ++liIndex) gaList += ["1234567890123456789012345"]; } touch_start(integer total_number) { list laList; integer liIndex; integer liCount; integer liInvIndex; integer liStart; integer liEnd;
llOwnerSay("Testing pulling a list subset"); liCount = llGetListLength(gaList); llOwnerSay(llGetTimestamp()); for (liIndex = 0; liIndex < giLoopCount; ++liIndex) { liStart = llFloor(llFrand((float)liCount-12.0)); laList = llList2List(gaList,liStart,liStart+11); } llOwnerSay(llGetTimestamp()); llOwnerSay("Testing pulling a list from inventory"); liCount = llGetInventoryNumber(INVENTORY_TEXTURE); llOwnerSay(llGetTimestamp()); for (liIndex = 0; liIndex < giLoopCount; ++liIndex) { laList = []; liStart = llFloor(llFrand((float)liCount-12.0)); liEnd = liStart + 11; for (liInvIndex = liStart; liInvIndex <= liEnd; ++liInvIndex) laList += [llGetInventoryName(INVENTORY_TEXTURE,liInvIndex)]; } llOwnerSay(llGetTimestamp()); } }
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 13:50
Well crap! Playing hell to trace down the problem in Innula's script and why it will not post. I THOUGHT it was just adding the space but I also sent it through Indent.exe first. Indent.exe is changing her original script so that it works but I can not replicate what it has changed, even using winmerge. Except for some cosmetic changes such as where the brackets end up, adding spaces for some brackets and stripping whitespace. There is something thou in Innula's script that the forum does not like at all.
Still looking.
_____________________
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
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 14:08
The forum hates you, Jesse. GIVE UP NOW! 
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
08-22-2009 14:11
two instances of variable test with < followed my "max" in the listen event... (if statement and for loop) it's not just vectors/rotations, it's any usage, including math tests (so remember to space around your math/comparison operators, it also prevents negation vs subtraction errors)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 14:24
From: Void Singer two instances of variable test with < followed my "max" in the listen event... (if statement and for loop) it's not just vectors/rotations, it's any usage, including math tests (so remember to space around your math/comparison operators, it also prevents negation vs subtraction errors) Yep that was it.
_____________________
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
|