Jump to content

HUD Issue. Really weird


DarkEmperor13
 Share

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

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

Recommended Posts

Ok this startingt post is gonna be a bit long so bare with me. OK so I'm making a HUD and the picture below shows u how it looks:

309897026_SDHUD.thumb.png.66138ef9c8fb409eb4326645c301afff.png

Mind you, this is a HUD for an Outfit I've made. the outfit has 3 parts to it: Top, Skirt and Leggings. The Top has 2 faces that indicate the shirt's main texture and the back strap texture. The Skirt has two faces as well indicating the Skirts main and trim textures and the leggings are only one face. Now on the HUD in the picture above, (where you see Shirt, Backstrap, Etc, Etc) below is the the codes for the Shirt and Backstrap buttons:

======= Shirt Button =======

default
{
    touch_start(integer total_number)
    {
        llRegionSay(17789, "Shirt");
    }
}


====== Backstrap Button ======

default
{
    touch_start(integer total_number)
    {
        llRegionSay(17789, "Backstrap");
    }
}

Ok now if u look the right in the picture above, you see the 40 squared buttons. For this example i'll use the button with red and white stripes. The code is this:

default
{
    state_entry()
    {
        llListen(17789, "", NULL_KEY, "");
    }
    listen(integer ch, string nm, key id, string msg)
    {
        if(msg == "Backstrap")
        {
            state Back;
        }
        if(msg == "Skirt")
        {
            state Skirt;
        }
        if(msg == "Skirt Trim")
        {
            state Trim;
        }
        if(msg == "Pants")
        {
            state Pants;
        }
    }
    touch_start(integer total_number)
    {
        llRegionSayTo(llDetectedKey(0), 479813, "Stripe Red");
    }
}

state Back
{
    state_entry()
    {
        llListen(17789, "", NULL_KEY, "");
    }
    listen(integer ch, string nm, key id, string msg)
    {
        if(msg == "Shirt")
        {
            state default;
        }
        if(msg == "Skirt")
        {
            state Skirt;
        }
        if(msg == "Skirt Trim")
        {
            state Trim;
        }
        if(msg == "Pants")
        {
            state Pants;
        }
    }
    touch_start(integer total_number)
    {
        llRegionSayTo(llDetectedKey(0), 479814, "Stripe Red");
    }
}

state Skirt
{
    state_entry()
    {
        llListen(17789, "", NULL_KEY, "");
    }
    listen(integer ch, string nm, key id, string msg)
    {
        if(msg == "Backstrap")
        {
            state Back;
        }
        if(msg == "Shirt")
        {
            state default;
        }
        if(msg == "Skirt Trim")
        {
            state Trim;
        }
        if(msg == "Pants")
        {
            state Pants;
        }
    }
    touch_start(integer total_number)
    {
        llRegionSayTo(llDetectedKey(0), 479815, "Stripe Red");
    }
}

state Trim
{
    state_entry()
    {
        llListen(17789, "", NULL_KEY, "");
    }
    listen(integer ch, string nm, key id, string msg)
    {
        if(msg == "Backstrap")
        {
            state Back;
        }
        if(msg == "Skirt")
        {
            state Skirt;
        }
        if(msg == "Shirt")
        {
            state default;
        }
        if(msg == "Pants")
        {
            state Pants;
        }
    }
    touch_start(integer total_number)
    {
        llRegionSayTo(llDetectedKey(0), 479816, "Stripe Red");
    }
}

state Pants
{
    state_entry()
    {
        llListen(17789, "", NULL_KEY, "");
    }
    listen(integer ch, string nm, key id, string msg)
    {
        if(msg == "Backstrap")
        {
            state Back;
        }
        if(msg == "Skirt")
        {
            state Skirt;
        }
        if(msg == "Skirt Trim")
        {
            state Trim;
        }
        if(msg == "Shirt")
        {
            state default;
        }
    }
    touch_start(integer total_number)
    {
        llRegionSayTo(llDetectedKey(0), 479817, "Fishnet Red");
    }
}

Now if i go to the actual top of the outfit(or shirt if u prefer to call it that) it will have two codes: SD - Top and SD - Backstrap. The codes are as followed:

//for both scripts, I left out all the if() events except for "if(msg == Stripe Red);" cause the codes are long and i'm trying not to make this post any longer than it is!
====== SD - Top ======
default
{
    state_entry()
    {
        llListen(479813, "", NULL_KEY, "");
    }
    listen(integer ch, string nm, key id, string msg)
    {
        if(msg == "Stripe Red")
        
        {
            llSetLinkPrimitiveParams(LINK_THIS, [PRIM_TEXTURE, 0, "9d613082-f79f-9cba-5013-1ecf1beaa3d9", <1,1,0>, <0,0,0>, 0, PRIM_COLOR, 0, <0.963, 0.227, 0.209>, 1, PRIM_ALPHA_MODE,0, PRIM_ALPHA_MODE_BLEND, 0]);
            llSetLinkPrimitiveParams(LINK_ALL_CHILDREN, [PRIM_TEXTURE, 0, "e000197d-e2d5-09ab-57f7-84d8923f9939", <1,1,0>, <0,0,0>, 0, PRIM_COLOR, 0, <1, 1, 1>, 1, PRIM_ALPHA_MODE,0, PRIM_ALPHA_MODE_BLEND, 0]);
        }
    }
}
              
              
====== SD - Backstrap ======
default
{
    state_entry()
    {
        llListen(479814, "", NULL_KEY, "");
    }
    listen(integer ch, string nm, key id, string msg)
    {
        if(msg == "Stripe Red")
        
        {
            llSetLinkPrimitiveParams(LINK_THIS, [PRIM_TEXTURE, 1, "9d613082-f79f-9cba-5013-1ecf1beaa3d9", <1,1,0>, <0,0,0>, 0, PRIM_COLOR, 0, <0.963, 0.227, 0.209>, 1, PRIM_ALPHA_MODE,0, PRIM_ALPHA_MODE_BLEND, 0]);
            llSetLinkPrimitiveParams(LINK_ALL_CHILDREN, [PRIM_TEXTURE, 1, "e000197d-e2d5-09ab-57f7-84d8923f9939", <1,1,0>, <0,0,0>, 0, PRIM_COLOR, 0, <1, 1, 1>, 1, PRIM_ALPHA_MODE,0, PRIM_ALPHA_MODE_BLEND, 0]);
        }
    }
}

Next if I got over to the HUD and Click the red and white stripe button i mentioned before, the shirt of the mesh out fit gets colored red and white stripes on face #0 which is what it should do. But when i click on the Backstrap button and then i click on lets say the black and white stripe button, instead of coloring the shirt of the mesh black and white striped on facve #1, it does it once again on face #0. So i went back in Script "SD - Backstrap and in one of the state_entry()'s i put llSay(0, "Touched Backstrap Button") and when i went to the HUD and clicked Backstrap, in local it said, "OBject: Touched Backstrap Button". So I know that the texture buttons are listening to the labeled buttons so why is it not doing what it should?

Link to comment
Share on other sites

To be exact, about.... 50. 45 are in the hud, 2 in the shirt mesh of the outfit, 2 in the skirt and 1 in the leggings. I first tried doing a touch event that went like:


default
{
	touch_start(integer total_number)
	{
		integer linkNumber = llDetectedLinkNumber(0);
		if(linkNumber == 1)
		{
			//Lines of code
		}
		if(linkNumber == 2)
		{
			//Lines of code
		}
etc, etc.

but that did nothing

Link to comment
Share on other sites

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