Jump to content

llDialog Menu from Notecard


Swimmie Chaffe
 Share

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

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

Recommended Posts

Greetings,

I am wondering if there is any way to read llDialog list from a notecard, but read a list only as labels and keep associated actions static. What I am hoping to accomplish is to have a line such as below in a script:

list MENU = ['option 1," "option 2", "option 3", "option 4"];

and substitute these generic "option 1" ... list with more meaningful labels read from a notecard. In the end, I would like to be able to prompt an action using the original list -- e.g., if an avatar chooses option 1, no matter what label it may be associated with, will prompt the same action that is associated with option 1.

Is it possible to do this? If so, how shall I set up a script and notecard? Your advise will be appreciated. Thanks in advance!

Swimmie

 

 

Link to comment
Share on other sites

Try http://wiki.secondlife.com/wiki/Read_Note_Card_Configuration  

Code your notecard with a single line with values for your list options:

Blue,Red,Green,Puce

or

Left,Right,Inside,Outside

or

Chicago,New York,Boston, Kokomo

whatever.....

In your dataserver event, read the line as a single variable and decode as

list gOptions = llCSV2List(data);

Then go ahead and use gOptions in your llDialog statements, wherever they appear, and in the if tests in your listen event.

 

  • Like 1
Link to comment
Share on other sites

Thanks Ivanova, Ojiro and Rolig for your replies! I can have a script read a list from a NC, but when I do that, a list on the NC replaces the original list. What I am trying to do is to retain the original generic list (option 1, option 2 etc), so that I can use option 1, option 2 etc, as global variables. I'll study Wikis you shared more closely. Thanks again!

Link to comment
Share on other sites


Swimmie Chaffe wrote:

[ ....]  I can have a script read a list from a NC, but when I do that, a list on the NC replaces the original list. [ .... ]

Sorry.  I thought that's what you wanted to do.  Something generically like this, using the appropriate global variables ....

dataserver (key id, string data){    if (id == gkTheKeyIWasExpecting)    {        glMyButtons = llCSV2List(data); // where "data" is a notecard line with button labels separated by commas    }}touch_start(integer num){    llListen(giMyChannel,"","","");    llDialog(llDetectedKey(0)," \n Pick an option", glMyButtons,giMyChannel);}listen (integer channel, string name, key id, string msg){    integer idx = llListFindList(glMyButtons,[msg]);    if (idx == 0)    {        // Do option one    }    else if (idx == 1)    {        //Do option two    }    // And so forth}

 

Link to comment
Share on other sites

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