Change font size
It is currently Sat Dec 15, 2018 1:16 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 8 posts ]
Author Message
 Post subject: Basic dialog script
PostPosted: Tue May 20, 2008 8:38 pm 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
{L_CODE}:
// Basic dialog script

integer CHANNEL = 42; // dialog channel
list MENU_MAIN = ["Color", "Alpha"]; // the main menu
list MENU_OPTIONS = ["Red", "Green", "Blue", "...Back"]; // a submenu
list MENU_ALPHA = ["Clear", "Translucent", "Opaque", "...Back"];

default
{
    state_entry()
    {
        llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users)
        llSetText("Dialog Test",<1,1,1>,1.0);
    }
    touch_start(integer total_number)
    {
        llDialog(llDetectedKey(0), "What do you want to do?", MENU_MAIN, CHANNEL); // present dialog on click
    }
    listen(integer channel, string name, key id, string message)
    {
        if (message == "Color")
        {
            llDialog(id, "Pick a color", MENU_OPTIONS, CHANNEL); // present submenu on request
        }
        else if (message == "Alpha")
        {
            llDialog(id, "Pick alpha", MENU_ALPHA, CHANNEL);
        }
        else if (message == "...Back")
        {
            llDialog(id, "Select option", MENU_MAIN, CHANNEL); // present main menu on request to go back
        }
        else if (message == "Red")
        {
            llSetColor(<1,0,0>,ALL_SIDES);
        }
        else if (message == "Green")
        {
            llSetColor(<0,1,0>,ALL_SIDES);
        }
        else if (message == "Blue")
        {
            llSetColor(<0,0,1>,ALL_SIDES);
        }
        else if (message == "Clear")
        {
            llSetAlpha(0.0, ALL_SIDES);
        }
        else if (message == "Translucent")
        {
            llSetAlpha(0.5, ALL_SIDES);
        }
        else if (message == "Opaque")
        {
            llSetAlpha(1.0, ALL_SIDES);
        }
    }
}


Top
 Profile  
 
 Post subject: Re: Basic dialog script
PostPosted: Sun Feb 20, 2011 2:19 pm 
Furious Typer
User avatar

Joined: Fri Jul 16, 2010 2:53 pm
Posts: 240
I'm trying to build a menu to change textures on multiple linked windows in a room. I don't know much about scripting. I know how to follow the instructions that may come with a script and that is about it. My biggest achievement was finally figuring out how to use multiple sit poses for single users using the MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License). This took me more than a month to figure out, so this tells you I'm really not good at this at all ... lol

When I found this basic menu, I thought I could use it to change textures on multiple windows in a room, by replacing "Color" to Blinds in this line;
list MENU_MAIN = ["Color", "Alpha"]; // the main menu.
That part worked ok.

Then I figured out I had to change the "Color" to "Blinds" in this line;
if (message == "Color")
This worked also... Go Me Go ... :mrgreen:

Because I am using textures, I thought I would have to change this line;
llSetColor(<1,0,0>,ALL_SIDES);
To;
llGetInventoryName(<1,0,0>,ALL_SIDES); << --- using the name of each textures
Or;
llGetInventoryKey(<1,0,0>,ALL_SIDES); << --- using the UUID of each textures
Or:
llGetInventoryName(INVENTORY_TEXTURE, currenttexture); << --- this I got from another script
None of those worked.

I'm stuck. Help please? :(

My goal is to have 1 menu per room and if I get good at this, maybe have one single menu for all rooms.

I appreciate any help I can get.

Selea


Top
 Profile  
 
 Post subject: Re: Basic dialog script
PostPosted: Mon Feb 21, 2011 12:09 am 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
Go to my store on Wright Plaza, Oni Kenkon Creations, on the second floor there is a "Hair Hud" kit, it does exactly everything you need. I actually wanted to make it do exactly what you propose, i was going to use it for things like carpet, curtains, walls, exterior siding, sooo many possibilities, please let me know how it goes, i would love to see what you do with it. If you get stuck figuring it out let me know, its pretty easy to use.


Top
 Profile  
 
 Post subject: Re: Basic dialog script
PostPosted: Mon Feb 21, 2011 7:25 pm 
Furious Typer
User avatar

Joined: Fri Jul 16, 2010 2:53 pm
Posts: 240
That is exactly what I was looking for.

That hud is awesome. From what I saw so far, you can control a whole house or even a whole region with it, once you get the hang of it.

So for the next few days, that is what i'll try to do. Get the hang of it ... lol

Thank you for your help, but I'll probably be back with a question or two :)

Selea


Top
 Profile  
 
 Post subject: Re: Basic dialog script
PostPosted: Tue Feb 22, 2011 8:50 am 
Furious Typer
User avatar

Joined: Fri Jul 16, 2010 2:53 pm
Posts: 240
I'm working with the Hair Hud v1.1 (Everyone)

I have the same 5 textures for all windows; Open, Semi-Open, Closed, Semi-Closed and Glass.

When I clicked the Kitchen button, then all the windows in whatever room will change to the texture I have chosen. The textures all have the same UUID, so I thought I would have to change the listen channel?

I tried changing the;
integer lchannel =
or the;
dchannel = (integer)llFrand
or the;
channel:

None of those worked.

I'm not sure where to go from here so again ... help please?

Selea


Top
 Profile  
 
 Post subject: Re: Basic dialog script
PostPosted: Tue Feb 22, 2011 3:55 pm 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
you need to change the channel in the notecard for both the controller and receiver scripts, do not modify the scripts.


Top
 Profile  
 
 Post subject: Re: Basic dialog script
PostPosted: Tue Feb 22, 2011 5:00 pm 
Furious Typer
User avatar

Joined: Fri Jul 16, 2010 2:53 pm
Posts: 240
Ok, thank you so much for your help :)


Top
 Profile  
 
 Post subject: Re: Basic dialog script
PostPosted: Thu Feb 24, 2011 10:03 am 
Furious Typer
User avatar

Joined: Fri Jul 16, 2010 2:53 pm
Posts: 240
Nebadon Izumi {L_WROTE}:
Go to my store on Wright Plaza, Oni Kenkon Creations, on the second floor there is a "Hair Hud" kit, it does exactly everything you need. I actually wanted to make it do exactly what you propose, i was going to use it for things like carpet, curtains, walls, exterior siding, sooo many possibilities, please let me know how it goes, i would love to see what you do with it. If you get stuck figuring it out let me know, its pretty easy to use.



As I said before, this is just awesome.

With being able to give a different channel for each part, and since I can work with textures, this is what I am doing so far;
5 different blinds for the windows
5 different blinds for the patio doors
3 different curtains for other customized windows
Lights - On or Off << --- using the a full bright for ON and the alpha one for Off
Fireplace - On or OFF << --- using the flame texture for ON and the alpha one for Off

I'm actually turning this hair hud into a Home Control Menu. When I'm done with this modern house i'm working on, i can send you the region's coordinates if you want.

I'm sure i'll find other uses for this soon enough.

But again, ty ty ty for sharing this great script and for your help.

Selea


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 8 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net