Hud Kit Example

Here's a simple way to make your own custom HUD and decorate it yourself.

First your HUD should have a root prim with the ACS HUD Root script in it. Then link on additional prims to function as your buttons. The name of each prim will be relayed to the root prim as the command.

If the button is for the horn, name it with the "Horn" command as the prim name and place this script inside it:

default
{
    touch_start(integer total_number)
    {
        llMessageLinked(LINK_ROOT,100,llGetObjectName(),"");
    }
}

When you touch that button it will relay the "Horn" command to the root prim, and the ACS HUD Root will relay it through to a connected vehicle.

When you click on the HUD root prim, it will turn on or off the HUD. It will also send a link message telling the HUD it is on or off, you an intercept that message and use it to rotate the HUD to open/close display your HUD buttons.

This script placed in the HUD Root would intercept the ON/OFF messages sent by touching the HUD root prim from the HUD Root script, and rotate the HUD accordingly:

default
{

    link_message(integer sender_num, integer num, string str, key id)
        {
          if (num == 400)
          {
              if (str == "on")
                  {
                      llSetRot(llEuler2Rot(<0,0,0>*DEG_TO_RAD));//rotates HUD to the ON position
                  }
              else if (str == "off");
                  {
                     llSetRot(llEuler2Rot(<0,0,90>*DEG_TO_RAD)); //rotates HUD to the OFF position
                  } 
            }
        }
}