Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

newbie menu questions

Maja Koenig
Registered User
Join date: 21 Jan 2007
Posts: 41
05-20-2007 15:20
I have recently started to script and I am getting the hang of it slowly. Yesterday I managed to fix a menu for an object I gave to a friend as an attachment. Now most of the options work proper when my friend wears the attachment, but I am able to manipulate the same menu when I clcik on it. I am assuming it would have something to do with getowner key but I am not sure where to put it. Do I duplicate the whole menu code twice? One with the owners options and one with options availble to everyone.

Which brings us to the second question. I need to also have this menu switch from a timer that is set at 8 times in two minutes to a 4 times in two minutes I can easily do one or the other with timerevent scripts set at the right times but I am not sure how to set up the menu to switch.

Will my object create lag if I am making too many scripts inside of it instead of doing better scripting and letting 1 do what 4 are doing now?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
05-21-2007 00:47
Without seeing your script its a bit hard to be specific but:-

Where you start the listen you are probably calling something like the following :-

Listening = llListen( Channel , "" , "" , "" );

Change this to

Listening = llListen( Channel , "" , llGetOwner() , "" );

To have 2 menu's with different functionality based on user does not require duplication of everything, just the actual menu contents i.e.

Code fragment - not expected to compile/run!!!
CODE

list Choices;
list OwnerMenu;
list NonOwnerMenu;
string Title = "Menu";

ShowMenu(key id)
{
if(llGetOwner() == id)
Choices = OwnerMenu;
else
Choices = NonOwnerMenu;
llDialog(id, Title, Choices, Channel);
llListen(Channel,"",id,"");
}

default
{
touch_start(integer total_number)
{
key id = llDetectedKey(0);
}
}


Not 100% sure what you mean about switching timers, Do you mean you want the Menu to allow the user to set when certain other events occur ? Just add menu entries for the required items and then in the associated listen set new Timer events.

Again without seeing your code its hard to say how much lag you will be inducing, one badly written script can be worse than 4 efficient ones.
_____________________
I'm back......