Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Hud Script

LaZy Hulka
Registered User
Join date: 11 Apr 2006
Posts: 32
08-02-2006 16:33
This script is use for a hud.

What do the scripts do is it hide the prims on the hud so you can make a hud that works for a weapon or somthing and you can just add this to your script. The first script is main. The main script well show and keep showing the prim it is in. The second script well hide or show when you touch first or the prim that main script is in like a buttom or another prim.


If you want a example please IM LaZy Hulka for a free Pvp Abuse Hud that show you how script work. I also modle hud or other combat item feel free to IM me.

:cool: First and main script
CODE

//This is the main script this is use for a hud. Add this to first prim this prim well not hide/ go invisible. This prim well also be showing. The other script well make every thing elss on hud hide and show
//********************************************************************************************************************************************************
//You can Change the HIDE or SHOW to what ever just edit the other scritp to. You can change it so it can hide or show one thing and not others.
integer visible = TRUE;

default
{
touch_start(integer num)
{
if(visible == FALSE)
{
llMessageLinked(LINK_SET,0,"SHOW",NULL_KEY); //This well show the button when touch
visible = TRUE;
return;
}
if(visible == TRUE)
{
llMessageLinked(LINK_SET,0,"HIDE",NULL_KEY); //This well hide the button when touch
visible = FALSE;
return;
}
}
}


:cool: Second script
CODE

// This is the script that you well add to the button or one you want to show and hide. The other script is the main script.
string text;
default
{
link_message(integer sender,integer num,string msg,key id)
{
if(msg == "HIDE")
{
llSetAlpha(0,ALL_SIDES);
llSetText("",<1,1,1>,1);
state hidden;
}
}
}

state hidden
{
link_message(integer sender,integer num,string msg,key id)
{
if(msg == "SHOW")
{
llSetAlpha(1,ALL_SIDES);
llSetText(text,<1,1,1>,1);
state default;
}
}
}



Thank For read and look at my message. How this script works for you if you have any question feel free IM or leave a reply and i'll try get back to for "ASAP" :cool:
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
08-02-2006 23:00
/15/eb/126580/1.html
_____________________
i've got nothing. ;)
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
08-03-2006 06:55
One problem with this script is that the hidden button is still "there", and you cannot touch things that are behind it in SL. It would be wise to also move it when it is hidden. It can be moved to go behind the always-visible prim, where it will not interfere with interaction with other objects.

Otherwise, very good, nice for people to have access to this example for use in their own HUD scripting.

Baron H.