Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorsintrenton
    • CommentTimeFeb 15th 2008
     # 1

    Hello everyone,

    I am making an information box with multiple choices, navigating to the right notecard.

    In the script I was first using

    llGiveInventory(llGetOwner(), "Schooners");

    but that of course only gave the notecard to me.
    So I changed it to

    llGiveInventory(llDetectedKey(0), "Schooners");

    It still seems to work very well, with chat repsonses still working
    However, it no longer hands out any notecards.

    Have I missed something?

  1.  # 2

    Hello sintrenton.

    Could we have a look at the code in context?

    •  
      CommentAuthorsintrenton
    • CommentTimeFeb 16th 2008 edited
     # 3

    Well, code (BBCode) doesn't work for me here, so hope it's readable.

    I've been trying all three alternatives, but using text, I at least get the breaks, even if not the indenting correct

    // when touched, present a dialog with four color choices

    integer CHANNEL = 42; // dialog channel
    list MENU_MAIN = ["Navigator", "Scholar", "Boats", "Furniture"]; // the main menu
    list MENU_TWO = ["Product F", "Spyglass", "Product G", "Product H", "...Back"]; // a submenu
    list MENU_THREE = ["Product I", "Product J", "Product K", "Product L", "...Back"]; // a submenu
    list MENU_FOUR = ["Product N", "...Back"]; // a submenu

    default {
    state_entry()
    {
    llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users)
    }

    touch_start(integer total_number)
    {
    llDialog(llDetectedKey(0), "Choose product group, please. \nNavigator: Spyglass, compass, etc\nScholar: Pens\nBoats: Canal Runner\nFurniture: Desk, lamps", MENU_MAIN, CHANNEL); // present dialog on click
    }

    listen(integer channel, string name, key id, string message)
    {
    if (llListFindList(MENU_MAIN + MENU_TWO + MENU_THREE, [message]) != -1) // verify dialog choice
    {
    llSay(0, name + " picked the option '" + message + "'."); // output the answer
    if (message == "Navigator")
    llDialog(id, "Pick an navigation", MENU_TWO, CHANNEL); // present submenu on request
    else if (message == "Scholar")
    llDialog(id, "Pick a scholar", MENU_THREE, CHANNEL); // present submenu on request
    else if (message == "Boats")
    llDialog(id, "Pick a boat", MENU_FOUR, CHANNEL); // present submenu on request
    else if (message == "Spyglass")
    llGiveInventory(llDetectedKey(0), "Spyglass");
    else if (message == "...Back")
    llDialog(id, "What do you want to do?", MENU_MAIN, CHANNEL); // present main menu on request to go back

    } else
    llSay(0, name + " picked invalid option '" + llToLower(message) + "'."); // not a valid dialog choice

    }

    }

  2.  # 4

    Ah, there we go...you are trying to detect the person in the listen event. Use the llDetectedKey(0) in the touch event to declare a global variable you can use to give the item in the listen event.

    Right now your llDetectedKey(0) is silently failing in the listen.

    •  
      CommentAuthorsintrenton
    • CommentTimeFeb 18th 2008
     # 5

    Ah, ok!
    I will try that one. Thanks for the help!

  3.  # 6

    Surely...
    llGiveInventory(id, "Spyglass");
    would work better... your are already using the id from the listen event to in your llDialog..
    t