Jump to content

hud color help


Kradrick
 Share

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

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

Recommended Posts

ok so ive gotten into scripting alot more lately and there are still some things that have me thrown for a loop, i made a finished hud with 3 color buttons all a different color, purple, green and orange, i thought i was be able to replace 1 if not all of those buttons with 1 color selector that let you choose whatever color you want for your particle, the base hud like i said works but i have no idea how to make it into 1 color selection

heres the script on all 3 of the buttons, the script listens on /99 it has a start button to turn the particle on and off, but that damn color selector is beating my ass, anyway on to the button script that resides in all 3 buttons, if you need any more information let me know and ill do my best to supply it

select_color() {
  llMessageLinked(LINK_ALL_OTHERS, 0, 
                  llList2CSV([llGetColor(ALL_SIDES), llGetLocalPos()]), 
                  NULL_KEY);
}

default {
  touch_start(integer total_number) {
    select_color();
  }

  link_message(integer sender_number, integer number, string message, key id) {
    if ((sender_number = LINK_ROOT) && (message == "reset")) {
      if (llGetObjectDesc() == "1") select_color();
    }
  }
}

i want to turn this into an RGB color selector and im about ready to rip my hair out after 6 hours, searched the forum and google and the wiki and script sites someone help me get through this please lol

Link to comment
Share on other sites

Try using llGetLinkPrimitiveParams to look for PRIM_COLOR.  That will target the specific prim you are interested in.  Then, rethink the way you are gathering the information.  You don't need to put a separate script in each button and then deal with link messages.  Put the llGetLinkPrimitiveParams statement in the main script in your root prim and then get the link number of the button that was clicked by using llDetectedLinkNumber(0).  Better still, since you know what colors your buttons are anyway, why ask?  Just write

touch_start(integer num){    string Color = llGetLinkName(llDetectedLinkNumber(0));    if (Color == "Red")    {        //make your particle display red    }    else if (Color == "Blue")    {        //make your particle display blue    }    else if (Color == "Yellow")    {        //make your particle display yellow    }}

Just be sure to name those button prims "Red", "Blue" and "Yellow".

 

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...