Jump to content

HUD Questions


Yurtiel
 Share

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

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

Recommended Posts

I have hit a brick wall and can't figure out what's going on (Again).

 

integer sCh;
integer gL;
string nOwn;
string gOwn;
string dOwn;
key uSr;

default
{
    state_entry()
    {
        sCh = -4000;
        dOwn = llDetectedKey(0);
        gOwn = llGetOwner();
        nOwn = llKey2Name(gOwn);
        gL = llListen(sCh, "", gOwn, "");
        llListenRemove(gL);
    }
    touch_end(integer ts)
        {
            vector vec = llDetectedTouchST(0);
    if(llDetectedTouchFace(0) == 4 && vec.x >= 0.6 && vec.x <= 1.0 && vec.y >= 0.64 && vec.y <= 0.8)
    llSay(0, "Stat Button Pressed");
    llMessageLinked(2,0,"Touched",dOwn);
}
}
 

 Okay, on here I'm u sing a single prim main area for the main menu of the HUD.

I get to the point where it detects if I'm touching on face 4, and if the vector is equal to or less than the X and Y of the "Stat Button" part of the prim.

It successfully says "Stat Button Pressed."

I assume it is then sending the llMessageLinked message of "Touched" to linked prim "2" which is the Stat Menu prim.

 

Stat Menu Prim Code:

integer sCh;
integer gL;
string nOwn;
string gOwn;
string dOwn;
vector gPos;
key uSr;

default
{
    state_entry()
    {
        sCh = -4000;
        dOwn = llDetectedKey(0);
        gOwn = llGetOwner();
        nOwn = llKey2Name(gOwn);
        uSr = dOwn;
        gPos = llGetLocalPos();
        gL = llListen(sCh, "", gOwn, "");
        llListenRemove(gL);
        state st_menu;
    }
}

state st_menu
{
    link_message(integer root, integer num, string msg, key dOwn)
        {
        if (msg == "Touched")
            llSay(0, "Moving");
    }
}

 This is the part that's infuriating me.

 

The prim isn't doing the if command I tell it to from link_message, even when remove state st_menu and combine the link message if command block of code to the state entry it won't say anything.

 

It's as if it's either NOT sending the llMessageLinked from the root prim to the linked prim, or the linked prim's link_message simply isn't recieving the message that is being sent and I can't seem to figure it out for the life of me because it works exactly as it should in a different script for something else I did perfectly fine.


Oh great scripters of SL, show me what mine eyes apparently are fking blind too.

Link to comment
Share on other sites

A simple link message monitor like this:

default{    link_message(integer sender_num, integer num, string msg, key id)    {        llOwnerSay( "num: "+(string)num+", msg: "+msg+", key: "+(string)id);    }}

 Drop the script inside the prims in question and you can monitor each and every link message

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

Thanks, Now I know that the LLmessagelinked is happening and it is sending "Touched" to the prim it needs to send it too, but I still don't know why it isn't executing

llsay(0,"Moving")

when it recieves the linked message.

Link to comment
Share on other sites


Yurtiel wrote:

Thanks, Now I know that the LLmessagelinked is happening and it is sending "Touched" to the prim it needs to send it too, but I still don't know why it isn't executing

llsay(0,"Moving")

when it recieves the linked message.

Are you sure the recieving child prim is number 2?

Are you sure the scripts are in the same linkset?

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

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