Jump to content

Wurdy

Resident
  • Posts

    18
  • Joined

  • Last visited

Posts posted by Wurdy

  1. On 26.02.2019 at 16:36, Fenix Eldritch said:

    Если я вас правильно понимаю, то да: возможно написать сценарий, который будет определять, куда объект будет прикрепляться при ношении. Взгляните на llAttachToAvatar () и вариант llAttachToAvatarTemp () . Они принимают входной параметр, который определяет целевую точку подключения, которую он будет использовать. Существуют константы для каждой действительной точки подключения, включая HUD. Смотрите вики-страницы для деталей.

    Имейте в виду, что с этим есть небольшая оговорка ... Это будет работать только в том случае, если вы позволите самому скрипту присоединиться. Если вы попытаетесь прикрепить объект с помощью меню средства просмотра и выберите явную точку (например, левой рукой), то я считаю, что это переопределит скрипт и принудительно прикрепит объект к левой руке. Чтобы достичь своей цели, вы должны позволить сценарию выполнить фактическое присоединение.

    Кроме того, объекты хранят данные о том, где они были в последний раз прикреплены. Поэтому, как только объект был успешно прикреплен, он «запомнит» это местоположение. Затем создайте этот экземпляр объекта, который будет всегда присоединяться к той же точке, если вы используете общее действие «изнашивание» от зрителя (без указания точки присоединения).

    Yes, you understood me correctly.
    Apparently, if you use the inventory menu to dress things, then it ignores the script and there's nothing to be done about it, which is a pity.

  2. Good evening, I became interested in the question: of how to make the HUD always dress correctly, from any point of attachment, I did it.
    But now I have a question. Is it possible to write a script that will dress any prim as HUD?
    For example, I will choose to attach to my left hand, but the prim will be dressed as a HUD anyway.

  3. 4 minutes ago, Rolig Loon said:

    Ну, во-первых, ваш запрос на обработку разрешений неверен. Что вам нужно

    
    

    На небольшом, но значимом примечании вы все еще используете номер ссылки для идентификации кнопки. Это часто потенциально опасно, так как вы можете испортить номера ссылок при последующих настройках модели. Как правило, разумнее использовать названия ссылок. Так, например, назовите ваши четыре кнопочные ссылки "крестик", "прямоугольник", "точки" и "плитка", а затем разберитесь с этой конкретной кнопкой, написав

    
    

    Таким образом, вам никогда не нужно знать, что такое номер ссылки, и вы можете заново связать HUD, не испортив сценарий.

    Wow, thanks for the tip.

    I just read in the function description llDetachFromAvatar
    quote:  "Only works in the root prim of the attachment. Сalling it from a script in a child prim will cause it to fail silently". 

    It seems to me the whole thing in this, but I just saw how the close button is used outside the parent, how is it implemented?

  4. In general, I do not understand why the script does not work.

    image.png.37927529b3b1418ab78a83cc3af54856.png

     The button (cross)  has number 2. 

    I checked it using this script:

    default
    {
        state_entry()
        {
        }
    
        touch_start(integer num_detected)
        {
            llOwnerSay("Link number clicked: " + (string)llDetectedLinkNumber(0) );       
        }
    }

    Here is the script of the button itself (cross)

    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();
                }
             }
    
        changed(integer change)
        {
            if(change & CHANGED_OWNER)
            {
                llResetScript();
            }
        }
    }

    The problem is that when I press the button, nothing happens.

  5. 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

  6. 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?

  7. 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.

  8. 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

  9. 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

  10. 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?

  11. 2 minutes ago, steph Arnott said:
     
    
    Включите это прозрачным. Это все еще там, невидимый.

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

  12. 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.

  13. 2 minutes ago, steph Arnott said:
    
    Напиши, что ты имеешь в виду на русском языке, как я запутался.

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

  14. 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.

×
×
  • Create New...