MLPV2 Props Texture Changer Add-on

From Second Life Wiki
Revision as of 09:22, 25 December 2011 by Gianinni Babenco (talk | contribs) (+Category:MLPV2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 textures for props rezzed with the MLPV2 scripts.

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 Prop_Main_Script on this page into a script called as you want;
  4. Drop this second script into the root prim of the props you want to texture with it;
  5. Copy and paste the Prop_Slave_Script on this page into a script called as you want;
  6. Drop this third script into the child prims of the props you want to texture with it;
  7. Add the textures you wish to use into each concerned prims of your prop(including root prim if you want);
  8. Add to the menu in an MLPV2 menu notecard the following line(s):
LINKMSG Choice1 | 0,-4,985555,Texture1
LINKMSG Choice2 | 0,-4,985555,Texture2
...

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

  • Choice1 : the wording that you want to appear for the button on the blue menu.
  • Texture1 :the name (case and spacing sensitive) of the texture you need to use.

<lsl> //MAIN_SCRIPT //Drop me into the prim where you have the rest of the MLPV2 scripts //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 ==985555 ) llSay(-8724, str); } } </lsl>


<lsl> // Prop_Main_Script //Drop me into the root prim of the props you want to texture with it //add-on by Teq Hutchinson for MLPV2 by Lear Cale. November 2009.

integer listener;

default {

on_rez(integer start) { listener = llListen(-8724, "", "", ""); }

listen( integer chan, string name, key id, string msg ) { if (chan ==-8724) { { llMessageLinked( LINK_ALL_OTHERS, 887777, msg, "" ); if (llGetInventoryType(msg)==0) llSetTexture(msg, ALL_SIDES);

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

} } } } </lsl>


<lsl> // Prop_Slave_Script //Drop me into the child prims of the props you want to texture with it; //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 ==887777 && llGetInventoryType(str)==0 ) llSetTexture(str, ALL_SIDES);

//THIS WILL APPLY YOUR TEXTURE TO ALL THE SIDES OF THE PRIM //SEE https://wiki.secondlife.com/wiki/LlSetTexture IF YOU NEED SOMETHING DIFFERENT } }

</lsl>