Jump to content

best practice for multi-button HUDs and listen handlers?


Quarrel Kukulcan
 Share

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

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

Recommended Posts

Same idea as Rolig, but if you want to have separate objects for each button (my preferred method), you can use a single script and llDetectedLinkNumber to figure out which button was touched.

default
{
    touch_start(integer n)
    {
        integer link = llDetectedLinkNumber(0);
        string button = llGetLinkName(link);

        if (button == "cool button")
        {
            // stuff, llSay or llWhisper
        }
        else if (button == "boring button")
        {
            // stuff, llSay or llWhisper
        }
    }
}

 

Edited by Wulfie Reanimator
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Maybe sort of a cross between Rolig and Wulfie's methods is to make a mesh object that uses a separate face for each button. You can then have a single script use a combination of llDetectedLinkNumber (if you need to use more than one mesh object to accommodate more than eight button faces) and llDetectedTouchFace to decide what to say to the receiving object.

I think llRegionSayTo is the most efficient and secure method of sending chat to an object, but it does require the sending script to know the receiving object's UUID.

Link to comment
Share on other sites

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