Jump to content

i need help. new to scripting .


Shashi Winterwolf
 Share

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

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

Recommended Posts

Hello! Can anyone help me understand what I've done wrong? The dialog box shows up, but nothing else happens. The chat doesn't display any messages and the prims alpha don't change either. If I change the "channel ==100" to "o", then it simply displays the button names in the chat.

 

default
{
    state_entry()
    {

    }

    touch_start(integer total_number)
    {

        llDialog(llDetectedKey(0), "select an option:",["option 1","option 2"],1979);
        }

    listen(integer channel, string name, key id, string message)
    {
        if(channel == 1979){
            if(message == "option 1"){
                llSay( 0," you chose the first option on the dialog.");
                 llSetLinkAlpha(3,0,ALL_SIDES);           
                   llSetLinkAlpha(2,0,ALL_SIDES);
                 
;                }else if(message == "option 2"){
                        llSay(0," you chose the second option on the dialog.");
                         llSetLinkAlpha(3,1,ALL_SIDES);                     
                           llSetLinkAlpha(2,1,ALL_SIDES);
                        

;                        }
        }
    }}

 

were have I gone wrong  . please help 

Link to comment
Share on other sites

sweet thank  that worked  how about this 

integer owner;

default
{
   state_entry()
    {
       llListen(1979, "", NULL_KEY, "");
    }
    touch_start(integer total_number)
    {

        llDialog(llDetectedKey(0), "select an option:",["option 1","option 2"],1979);
        }

    listen(integer channel, string name, key id, string message)
    {
        if(channel == 1979){
            if(message == "option 1"){        
            string oldName = llGetObjectName();
            llSetObjectName("");
            owner = llGetDisplayName(llGetOwner());
            llSay(0," " + owner + "you chose the first option on the dialog.");
            llSetObjectName(oldName);
           
                 llSetLinkAlpha(3,0,ALL_SIDES);           
                   llSetLinkAlpha(2,0,ALL_SIDES);
                 
;                }else if(message == "option 2"){
                        llSay(0," you chose the second option on the dialog.");
                         llSetLinkAlpha(3,1,ALL_SIDES);                     
                           llSetLinkAlpha(2,1,ALL_SIDES);
                        

;                        }
        }
    }}

trying to get it to say my name in chat and not the box name 

the editor I'm using asks this

Cannot implicitly convert type 'string' to 'integer'. An explicit conversion exists (are you missing a cast?)

were would I learn about casts?

Link to comment
Share on other sites

10 hours ago, Marvin Benelli said:

SetObjectName(owner);

llSay(0,” has chosen option x”);

I'm not a fan of objects that change their name to the first word in the message. llSay(0, owner+" has chosen "+message); is fine. Setting the object name to the display-name of the owner of an attachment makes it look to rlv(a) enabled viewers like the actual owner of the object is speaking, which is not something you generally want unless you're scripting a gag. If you really were wanting it to appear from the owner's mouth, my grammar preference would be more along the lines of "I choose X." or "/me chooses X."

If you want to obscure the message source, just set the object name to "".

11 hours ago, Shashi Winterwolf said:

owner = llGetDisplayName(llGetOwner());

I personally prefer using SLURLs to display avatar's names: owner = "secondlife:///app/agent/"+(string)llGetOwner()+"/inspect";

Edited by Quistess Alpha
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 141 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...