Jump to content

Dialog Menu


Renegade Travesty
 Share

You are about to reply to a thread that has been inactive for 2756 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi all,

I have a menu script that I want a group to use but it is set for owner only. I have spent a few hours trying to do this using llSameGroup, llDetectedKey but to no avail. If some one could take a look and advise as to what I need to do. This is a learning curve for me. I can see how the owner side works in the lines I will post but for the life of me can't see how to set for group usage.

Regards,

Renegade.

dialog( integer ctrl ) {
    goDeaf();
    lis = llListen( channel, llKey2Name( owner_id ), owner_id, "" );
    llDialog( owner_id, dialog_msg, diaList( ctrl ), channel );
    llSetTimerEvent( 20.0 );
}

default {
    timer() {
        if ( ready ) {
            goDeaf();
            if ( was_waiting ) {
                was_waiting = FALSE;
                dialog( FALSE );
            }
        }
    }
    state_entry() {
        owner_id = llGetOwner();
        ncl_req = llGetNotecardLine( nc_name, nc_line );
    }
    changed( integer change ) {
        if ( change & ( CHANGED_INVENTORY | CHANGED_OWNER ) ) {
            llResetScript();
        }
    }
    touch_start( integer nd ) {
        while ( nd ) {
            if ( llDetectedKey( --nd ) == owner_id ) {
                if ( ready ) {
                    was_waiting = FALSE;
                    sublist_start = 0;
                    dialog( FALSE );
                } else {
                    llSetTimerEvent( 0.1 );
                }
                return;
            }
        }
    }

 

Edited by Renegade Travesty
Link to comment
Share on other sites

That's way more complicated than it needs to be.  The likelihood of having two people touch the object within 0.2 seconds is very low, and you can just block a second clicker and force her to wait.  There's also no need to put the dialog function into a user-defined function.  Just inline that stuff (cleaned up) and save yourself a lot of trouble.  You should be able to do what you want with something like this (schematically):

// A mess of global declarations here........
// But no need for the dialog() function or the GoDeaf() function;

default 
{
    state_entry() 
    {
        owner_id = llGetOwner();	//You may still need this somewhere
        ncl_req = llGetNotecardLine( nc_name, nc_line );	// I assume that you are reading a notecard somewhere, so you need a dataserver event too
    }

    changed( integer change ) 
    {
        if ( change & ( CHANGED_INVENTORY | CHANGED_OWNER ) ) 
        {
            llResetScript();
        }
    }

    touch_start( integer nd ) 
    {
    	if (llSameGroup(llDetectedKey(0))	// Here's your group filter
    	{
	        if ( ready ) // This blocks a second person from touching
	        {
	            ready = FALSE;
	            sublist_start = 0;
	            lis = llListen(channel, "","","");	// No need to be more specific here
	            llDialog(llDetectedKey(0), dialog_msg, dialist, channel);
	        }
	    }   
    }

    listen (integer channel, string name, key id, string mesage)
    {
    	llListenRemove(lis);
    	ready = TRUE;
    	// Do other stuff with the dialog reponses
    }
}

ETA:  Do be sure to set ready = TRUE in your global declaration or in state_entry so that it's TRUE the first time you click on the thing.

Edited by Rolig Loon
Clarification
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2756 days.

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
 Share

×
×
  • Create New...