Jump to content

How detach HUD


Wurdy
 Share

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

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

Recommended Posts

Edit: I just noticed my explanation was removed when I updated the code. 😂

TLDR: You need to check which link number was clicked, then request permission and detach.

// Which link number closes the HUD?
integer close_button = 2;

default
{
    touch_start(integer n)
    {
        if(llDetectedLinkNumber(0) == close_button)
        {
            llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
        }
    }

    run_time_permissions(integer permission)
    {
        if(permission)
        {
            llDetachFromAvatar();
        }
    }

    // If the HUD is given to someone else,
    //  the script must be reset,
    //  or llGetOwner won't work.
    changed(integer change)
    {
        if(change & CHANGED_OWNER)
        {
            llResetScript();
        }
    }
}

 

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

4 minutes ago, steph Arnott said:

Является ли HUD вашим творением и является ли он модом объектов?

My friend and I study SL. He made a HUD. To change the color of the eyes, and asked me to make a cross to close the HUD so as not to constantly separate myself.

Link to comment
Share on other sites

3 minutes ago, Wurdy said:

My friend and I study SL. He made a HUD. To change the color of the eyes, and asked me to make a cross to close the HUD so as not to constantly separate myself.

Напиши, что ты имеешь в виду на русском языке, как я запутался.
Link to comment
Share on other sites

1 minute ago, steph Arnott said:

Напиши, что ты имеешь в виду на русском языке, как я запутался.

He means making a close button. Aka an X above the hud that when clicked will close it. I think the "separate myself" refers to hiding the hud over detaching it. 

Link to comment
Share on other sites

2 minutes ago, steph Arnott said:

Напиши, что ты имеешь в виду на русском языке, как я запутался.

В общем, я хочу научиться делать ХУД для предметов, например, цвет менять вот я сделал доску на ней несколько примитивов (типо кнопки) и нужно сделать кнопку для закрытия всего ХУДа чтобы не лазать в инвентарь постоянно для снятия ХУДа

Link to comment
Share on other sites

3 minutes ago, chibiusa Ling said:

He means making a close button. Aka an X above the hud that when clicked will close it. I think the "separate myself" refers to hiding the hud over detaching it. 

Yes, I just want to make an X button to close the entire HUD.

Link to comment
Share on other sites

1 minute ago, Wurdy said:

В общем, я хочу научиться делать ХУД для предметов, например, цвет менять вот я сделал доску на ней несколько примитивов (типо кнопки) и нужно сделать кнопку для закрытия всего ХУДа чтобы не лазать в инвентарь постоянно для снятия ХУДа 

 
Включите это прозрачным. Это все еще там, невидимый.
Link to comment
Share on other sites

2 minutes ago, steph Arnott said:
 

Включите это прозрачным. Это все еще там, невидимый.

Maybe you misunderstood, I just need to remove the HUD, why make it transparent?

Link to comment
Share on other sites

18 minutes ago, Wulfie Reanimator said:

// Which link number closes the HUD?
integer close_button = 2;

default
{
    touch_start(integer n)
    {
        if(llDetectedLinkNumber(0) == close_button)
        {
            llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
        }
    }

    run_time_permissions(integer permission)
    {
        if(permission)
        {
            llDetachFromAvatar();
        }
    }

    // If the HUD is given to someone else,
    //  the script must be reset,
    //  or llGetOwner won't work.
    changed(integer change)
    {
        if(change & CHANGED_OWNER)
        {
            llResetScript();
        }
    }
}

 

In principle, everything is clear, but I wanted to clarify the number to the button you need to assign yourself? Or is it automatically assigned and you just need to find out?

Link to comment
Share on other sites

Just now, Wurdy said:

Maybe you misunderstood, I just need to remove the HUD, why make it transparent?

Ваш заголовок и пост являются противоречивыми утверждениями. Инициируйте команду detatch в сценарии или отдельном сценарии.
Link to comment
Share on other sites

32 minutes ago, Wulfie Reanimator said:

// Which link number closes the HUD?
integer close_button = 2;

default
{
    touch_start(integer n)
    {
        if(llDetectedLinkNumber(0) == close_button)
        {
            llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
        }
    }

    run_time_permissions(integer permission)
    {
        if(permission)
        {
            llDetachFromAvatar();
        }
    }

    // If the HUD is given to someone else,
    //  the script must be reset,
    //  or llGetOwner won't work.
    changed(integer change)
    {
        if(change & CHANGED_OWNER)
        {
            llResetScript();
        }
    }
}

 

Understood with llDetectedLinkNumber, but for some reason, when I press the button, nothing happens, although the close button does have 2 numbers, I checked

Link to comment
Share on other sites

20 minutes ago, steph Arnott said:

Ваш заголовок и пост являются противоречивыми утверждениями. Инициируйте команду detatch в сценарии или отдельном сценарии.

We do not understand each other. Here Wulfie Reanimator understood what I mean, but for some reason the script does not work, although the idea itself is clear

Link to comment
Share on other sites

3 minutes ago, Wurdy said:

We do not understand each other. Here Wulfie Reanimator understood what I mean, but for some reason the script does not work, although the idea itself is clear

did you set integer close_button=2; to the link number that is your close button?.

 

So if your close button is link 4 it would read     integer close_button=4;

 

You can find out what link your close button is by putting llOwnerSay((string)llDetectedLinkNumber(0)); under the touch_start event. Like so :

touch_start(integer x){

    llOwnerSay((string)llDetectedLinkNumber(0));

}

 

When you click your close button it will output the link number in chat.

Link to comment
Share on other sites

3 minutes ago, chibiusa Ling said:

did you set integer close_button=2; to the link number that is your close button?.

 

So if your close button is link 4 it would read     integer close_button=4;

 

You can find out what link your close button is by putting llOwnerSay((string)llDetectedLinkNumber(0)); under the touch_start event. Like so :

touch_start(integer x){

    llOwnerSay((string)llDetectedLinkNumber(0));

}

 

When you click your close button it will output the link number in chat.

Yes, yes, I'm telling you, I checked that the close button is 2, I registered for checking everything that you wrote just now, exactly the close button has number 2.

Link to comment
Share on other sites

5 minutes ago, chibiusa Ling said:

Вы установили целое число close_button = 2; на номер ссылки, которая является вашей кнопкой закрытия ?.

 

Поэтому, если ваша кнопка закрытия - ссылка 4, она будет читать целое число close_button = 4;

 

Вы можете узнать, по какой ссылке находится ваша кнопка закрытия, поместив llOwnerSay ((string) llDetectedLinkNumber (0)); под событием touch_start. Вроде так :

touch_start (целое число x) {

    llOwnerSay ((строка) llDetectedLinkNumber (0));

}

 

Когда вы нажимаете кнопку закрытия, он выводит номер ссылки в чате.

After all, I correctly understood that this script should be given to the parent, and the button itself does not need to register anything like that?

Link to comment
Share on other sites

5 minutes ago, chibiusa Ling said:

Вы установили целое число close_button = 2; на номер ссылки, которая является вашей кнопкой закрытия ?.

 

Поэтому, если ваша кнопка закрытия - ссылка 4, она будет читать целое число close_button = 4;

 

Вы можете узнать, по какой ссылке находится ваша кнопка закрытия, поместив llOwnerSay ((string) llDetectedLinkNumber (0)); под событием touch_start. Вроде так :

touch_start (целое число x) {

    llOwnerSay ((строка) llDetectedLinkNumber (0));

}

 

Когда вы нажимаете кнопку закрытия, он выводит номер ссылки в чате.

image.thumb.png.fe45431cde9e8bb7069bb4df2fa2aaef.png

So I checked the button number

 

 

and this is the parent script

image.thumb.png.5729ff63c73151dd85b0e9dbe74d948a.png

Link to comment
Share on other sites

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