Difference between revisions of "MLPV2 Texture Changer Add-on"

From Second Life Wiki
Jump to navigation Jump to search
Line 7: Line 7:




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 prims in the object with the MLPV2 scripts.
Simple add on tool for MLPV2 that puts a button on the MLPV2 menu that sets the texture on any number of prims.  Put several in a menu to give a choice of textures.
(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.  
This script won't work for props, only for the prim where the MLPV2 scripts are, and the prims linked to it.
This script should *not* be used for objects with lots of prims that need retexturing.


By Teq Hutchinson, November 2009.
Simplified by Lear Cale, March 2011.


'''Steps to use:'''
'''Steps to use:'''


#Create a new script in your inventory.  Name it whatever you want, but I recommend "~~texture".
#Create a new script in your inventory.  Name it whatever you want, but LC recommends "~~texture".
#Drop this script into every prim that you want retexturable;
#Drop this script into every prim that you want retexturable;
#Add the textures you wish to use into each retexturable prim;
#Add the textures you wish to use into each retexturable prim;
#Add lines like the following to a menu in your MLPV2 .MENUITEMS.* notecard:
#Add lines like the following to a menu in your MLPV2 .MENUITEMS.* notecard(s):


  LINKMSG Choice1 | 0,-1,987777,Texture1
  LINKMSG Choice1 | 0,-1,987777,Texture1
Line 24: Line 26:
  ...
  ...


Each line creates a menu button.  There are two elements for you
Each line creates a menu button.  There are two elements for you to customize:
to customize as appropriate:


* Choice1 : the wording that you want to appear for the button on the blue menu.
* Choice1 : the wording that you want to appear for the button on the blue menu.

Revision as of 05:06, 25 March 2011


Simple add on tool for MLPV2 that puts a button on the MLPV2 menu that sets the texture on any number of prims. Put several in a menu to give a choice of textures.

This script won't work for props, only for the prim where the MLPV2 scripts are, and the prims linked to it. This script should *not* be used for objects with lots of prims that need retexturing.

By Teq Hutchinson, November 2009. Simplified by Lear Cale, March 2011.

Steps to use:

  1. Create a new script in your inventory. Name it whatever you want, but LC recommends "~~texture".
  2. Drop this script into every prim that you want retexturable;
  3. Add the textures you wish to use into each retexturable prim;
  4. Add lines like the following to a menu in your MLPV2 .MENUITEMS.* notecard(s):
LINKMSG Choice1 | 0,-1,987777,Texture1
LINKMSG Choice2 | 0,-1,987777,Texture2
...

Each line creates a menu button. There are two elements for you to customize:

  • 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> // Texture Changer script // add-on by Teq Hutchinson for MLPV2. November 2009. // simplified by Lear Cale, March 2011

default {

   link_message(integer sender_num, integer num, string str, key id)
   {
       if (num == 987777 && llGetInventoryType(str) == INVENTORY_TEXTURE)
       {
           // This will apply your texture to all the sides of the prim
           // SEE https://wiki.secondlife.com/wiki/LlSetTexture if you need something different
           llSetTexture(str, ALL_SIDES);
       }
   }

} </lsl>