MLPV2 Color Changer Add-on

From Second Life Wiki
Revision as of 12:01, 30 November 2009 by Teq Hutchinson (talk | contribs)
Jump to navigation Jump to search


Simple add on tool for MLPV2 that puts a button on the MLPV2 menu that, when clicked, gives a user a choice of colors for prims in the object with the MLPV2 scripts. (This script won't work for props, only for the prim where the MLPV2 scripts are, and the prims linked to it)

By Teq Hutchinson, November 2009.


Steps to use:

  1. Copy and paste the Main_Script on this page into a script called as you want;
  2. Drop this first script into the prim where you have the rest of the MLPV2 scripts;
  3. Copy and paste the Slave_Script on this page into a script called as you want;
  4. Drop this second script into the prims you want the color to be changed (including root prim or prim where the MLPV2 scripts are);
  5. Add to the menu in an MLPV2 menu notecard the following line(s):
LINKMSG ColorName1 | 0,-4,987788,<0.0,0.0,0.0>
LINKMSG ColorName2 | 0,-4,987788,<0.5,0.5,0.5>
...


In the above line, there are two elements for you to customize as appropriate:


  • ColorName1 : the wording that you want to appear for the button on the blue menu.
  • <0.0,0.0,0.0> :the color vector you need to use, in RGB, format: <RED value,GREEN value,BLUE value>.


(More about colors here: LSL_Color and here: LlSetColor/Newbie_Notes)


<lsl> // Color Changer MAIN_SCRIPT //add-on by Teq Hutchinson for MLPV2 by Lear Cale. November 2009.

default { link_message(integer sender_num, integer num, string str, key id) {

if (num ==987788 ) llMessageLinked( LINK_SET, 987799, str, "" );

} } </lsl>


<lsl> // Color Changer SLAVE_SCRIPT //add-on by Teq Hutchinson for MLPV2 by Lear Cale. November 2009. default { link_message(integer sender_num, integer num, string str, key id) {

if (num ==987799 ) llSetColor( (vector) str, ALL_SIDES );

//THIS WILL APPLY THE COLOR TO ALL THE SIDES OF THE PRIM //SEE https://wiki.secondlife.com/wiki/LlSetColor IF YOU NEED SOMETHING DIFFERENT

} } </lsl>