Jump to content

Arcadia Fehr

Resident
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Arcadia Fehr

  1. I need a little help if possible. I am using these scripts as an inspiration to derive from but with some differences. I just do not know how to go about it. I want to switch things around to where I can conveniently place the texture UUIDs in the hud instead of the mesh objects themselves. Basically send the texture UUID as a message to the receiver script and apply the texture. These scripts work well but I would rather not have to change each receiver script's uuid settings and rather have it down to just configuring the HUD script settings. 

    Any and all help is appreciated.

    Sender (HUD):

    Quote
    
    //===== Texture Changing HUD - by Sylvia Wasp =====
    //      installed in the root prim of a linkset
    //      where the other prims are *named* buttons
    //=================================================
    
    integer     cmdChannel;
    integer     app_id = 73245;
    string      HUD_Name = "Product HUD";
    
    default
    {
        state_entry ()
        {
            llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_NAME,HUD_Name]);
            cmdChannel = (integer)("0x"+(string)llGetOwner());
            if (cmdChannel == app_id) ++app_id;
            cmdChannel = cmdChannel ^ app_id | 0x80000000;
        }
    
        touch_start(integer n)
        {
            string button = llGetLinkName(llDetectedLinkNumber(0));
            llRegionSayTo(llGetOwner(),cmdChannel, button);
            llSay(cmdChannel, button);                      // delete when done
        }                
    }

    Receiver Script:

    Quote
    
    //===== Texture Changer (Mesh) - by Sylvia Wasp ========
    //      installed in an item of mesh clothing,
    //      receives messages from "Texture Changing HUD"   
    //======================================================
    
    integer     cmdChannel;
    integer     app_id = 73245;
    
    key         texture_01 = "36e9d64c-3f58-92d1-b2d1-807ddc996558";    
    key         texture_02 = "1db31c0c-622a-d120-23dd-52519592d253";
    key         texture_03 = "614544ae-4bdf-c8d6-2cb3-0115a990943b";    
    key         texture_04 = "06943dd0-0216-16c7-83de-4f40c6185106";
    key         texture_05 = "33a2a763-dae0-e4b9-d908-b56d9c50fb47";    
    key         texture_06 = "bfba4c48-cea2-3523-b62d-52beafcb3a77";
    
    default
    {
        state_entry ()
        {
            cmdChannel = (integer)("0x"+(string)llGetOwner());
            if (cmdChannel == app_id) ++app_id;
                cmdChannel = cmdChannel ^ app_id | 0x80000000;
                
            llListen(cmdChannel, "Product HUD", NULL_KEY, "");
        }
    
        listen(integer channel, string name, key id, string message) 
        {
            key msg_owner = llGetOwnerKey(id);
            key msg_creator = llList2Key(llGetObjectDetails(id, [OBJECT_CREATOR]), 0);
            
            if ((msg_owner == llGetOwner()) && (msg_creator == llGetCreator())) {
               llOwnerSay("Hi! I am good thank you");    
                }         
    
            if (message == "button_01" ) {
                llSetLinkPrimitiveParamsFast(LINK_THIS,[ PRIM_TEXTURE, ALL_SIDES, texture_01, <1.0, 1.0, 1.0>,ZERO_VECTOR, 0.0 ]);
                }
            else if (message == "button_02") {
                llSetLinkPrimitiveParamsFast(LINK_THIS,[ PRIM_TEXTURE, ALL_SIDES, texture_02, <1.0, 1.0, 1.0>,ZERO_VECTOR, 0.0 ]);
                }
            if (message == "button_03" ) {
                llSetLinkPrimitiveParamsFast(LINK_THIS,[ PRIM_TEXTURE, ALL_SIDES, texture_03, <1.0, 1.0, 1.0>,ZERO_VECTOR, 0.0 ]);
                }
            else if (message == "button_04") {
                llSetLinkPrimitiveParamsFast(LINK_THIS,[ PRIM_TEXTURE, ALL_SIDES, texture_04, <1.0, 1.0, 1.0>,ZERO_VECTOR, 0.0 ]);
                }
            if (message == "button_05" ) {
                llSetLinkPrimitiveParamsFast(LINK_THIS,[ PRIM_TEXTURE, ALL_SIDES, texture_05, <1.0, 1.0, 1.0>,ZERO_VECTOR, 0.0 ]);
                }
            else if (message == "button_06") {
                llSetLinkPrimitiveParamsFast(LINK_THIS,[ PRIM_TEXTURE, ALL_SIDES, texture_06, <1.0, 1.0, 1.0>,ZERO_VECTOR, 0.0 ]);
                }
        }
    } 

     

    • Like 1
×
×
  • Create New...