Script: Theme Texture Change v2

Documentation ยท Theme Texture Change
Version 2.1

Status: Released. Added: module Rez Prop Add-On. Improvements in the API. New functionality.

[Black Tulip] Script - Theme Texture Change v2 in Marketplace. Check this video for an introduction of some of its features: Theme Texture Change v2, in action.

Follow these directions carefully. Complete the several Step by Step Guides in the first place, then check the rest of the sections. There's a Troubleshooting section at the end. Before asking for help, check that your problem isn't one of the problems described in there. There's a section in this documentation meant for advanced users. Its purpose is to provide more concise and to the point information so they don't have to wade through long tutorials. Still, having a look at the step by step guides is recommended.

License of Use: Click here to read the License of use.

What's included in your purchase

Check that your box contains the following assets:

  • ! READ ME: ABOUT OBJECTS PLACED IN DIFFERENT LOCATIONS
  • [Black Tulip] Do Not Texture This Side
  • [Black Tulip] Normal map - NO NORMAL (32x32)
  • [Black Tulip] Proof Of Purchase - Theme Texture Change v2
  • [Black Tulip] Specular map - NO SPECULAR (32x32)
  • [Black Tulip] Theme Texture Change v2.1
  • [Black Tulip] Theme Texture Change v2.1 - AUX TOOL
  • [Black Tulip] Theme Texture Change v2.1 - POSES ADDON
  • [Black Tulip] Theme Texture Change v2.1 - HUD SCRIPT
  • [Black Tulip] Theme Texture Change v2.1 - REZ PROP
  • [Black Tulip] Theme Texture Change v2.1 - REZ PROP (PROP)
  • [Black Tulip] Theme Texture Change v2 - HUD SCRIPT ~CFG~
  • [Black Tulip] Theme Texture Change v2 - REZ PROP ~CFG~
  • [Black Tulip] Theme Texture Change v2 - REZ PROP (PROP) ~CFG~
  • [Black Tulip] Theme Texture Change v2 ~CFG~
  • [Black Tulip] Theme Texture Change v2 ~DOC~
  • [Black Tulip] TTCv2 - Items for Tutorial (add) (boxed/folder)
    • [Black Tulip] Chair for Texture Change V2
    • [Black Tulip] Swing
    • [Black Tulip] Table for Texture Change V2
    • [Black Tulip] Test Box
  • [Black Tulip] TTCv2 - Notecards for Tutorial (add) (boxed/folder)
    • [BT]:ALPHA:Legs 25%
    • [BT]:ALPHA:Legs 50%
    • [BT]:ALPHA:Top 25%
    • [BT]:ALPHA:Top 50%
    • [BT]:COLOR:Legs Magenta
    • [BT]:COLOR:Legs Red
    • [BT]:COLOR:Top Magenta
    • [BT]:COLOR:Top Red
    • [BT]:Legs:Dark Brown
    • [BT]:Legs:Green
    • [BT]:Legs:Light Brown
    • [BT]:Legs:White
    • [BT]:Swing - Dark Brown
    • [BT]:Swing - Light Brown
    • [BT]:Swing - White
    • [BT]:Swing - Dark BrownREMOVETHISTEXT
    • [BT]:Swing - Light BrownREMOVETHISTEXT
    • [BT]:Swing - WhiteREMOVETHISTEXT
    • [BT]:Top:Dark Brown
    • [BT]:Top:Green
    • [BT]:Top:Light Brown
    • [BT]:Top:White
  • [Black Tulip] TTCv2 - Sample HUD (add) (boxed/folder)
    • [Black Tulip] Table for Texture Change V2 - Needs HUD
    • [Black Tulip] Table for Texture Change V2 - Needs HUD - Master
    • [Black Tulip] Table for Texture Change V2 - Needs HUD - Slave
    • [Black Tulip] TTCv2 - Sample HUD
  • [Black Tulip] TTCv2 - Sample Scripts for API (add) (boxed/folder)
    • [Black Tulip] TTCv2 - llMessageLinked sample
    • [Black Tulip] TTCv2 - llRegionSay sample
  • [Black Tulip] TTCv2 - Textures for Tutorial (add) (boxed/folder)
    • [Black Tulip] Chair Legs - Dark Brown
    • [Black Tulip] Chair Legs - Green
    • [Black Tulip] Chair Legs - Light Brown
    • [Black Tulip] Chair Legs - White
    • [Black Tulip] Chair Seat - Dark Green
    • [Black Tulip] Chair Seat - Dark Red
    • [Black Tulip] Chair Seat - Dark Red Two
    • [Black Tulip] Swing - Metal
    • [Black Tulip] Swing - Wood - Dark Brown
    • [Black Tulip] Swing - Wood - Light Brown
    • [Black Tulip] Swing - Wood - White
    • [Black Tulip] SwingLegs - Dark Brown
    • [Black Tulip] SwingLegs - Light Brown
    • [Black Tulip] SwingLegs - White
    • [Black Tulip] Table Legs - Dark Brown
    • [Black Tulip] Table Legs - Green
    • [Black Tulip] Table Legs - Light Brown
    • [Black Tulip] Table Legs - White
    • [Black Tulip] Table Top - Dark Brown
    • [Black Tulip] Table Top - Green
    • [Black Tulip] Table Top - Light Brown
    • [Black Tulip] Table Top - White

If any of these is missing, contact Auryn Beorn for a replacement.

Features list

  • Auxiliary tool with clean web output
  • Works with materials/non materials
  • Reads relevant prims from name or description (compatibility with UniDoor and KoolDoor)
  • Back to AVsitter 2 button or any other application you need
  • Define default access mode
  • Demo mode for stores: load a theme after a given time
  • Works with RLV in AVsitter 2
  • The [MODULE] script is no longer necessary: everything is handled by the same script
  • Separate unlinked objects have a common menu (for example, swings or big houses)
  • Special menus to change color only or transparency only
  • Create texture change HUDs with the HUD script
  • Poses Add-On: Change the texture depending on which pose is being played in AVsitter 2
  • Rez Prop Add-On: Coordinates theme textures with rezzed poses
  • Complete tutorial objects and textures included
  • Scripting API

Users of Texture Change v1 should know this

If you're an user of the previous version of this script, you will find that the basic and usual setup is basically the same in this version. However, there are four important and big changes to be aware of:

  • The notecards no longer begin in BT_TEXTURE:. Now they begin in [BT]:
  • There's a configuration notecard that must be used in conjunction with the script: [Black Tulip] Theme Texture Change v2 ~CFG~
  • The number to use in the ADJUST line has changed. Now it is -31400100, so your ADJUST line now should look like:
    ADJUST TEXTURE|-31400100
    (This value may change depending on a parameter on the configuration. This is explained at a later moment.)
  • The [MODULE] script is no longer needed. There's a parameter in the [Black Tulip] Theme Texture Change v2 ~CFG~ configuration notecard that handles this behaviour: clickMode. Normally, you want to have it set to 2.

Step by Step Guide: The auxiliary tool (Let's start with a box)

First of all, make sure that you're working on an object that has, for you, copy/modify/transfer permissions. You can of course change permissions for the next owner, but it is relevant that the object is full permissions to you, or the auxiliary tool will not work.

This said, let's begin by rezzing a box. Write t;myBox in its description field, as the image shows:

Set a different color to each face of the box. For example:

Drop the [Black Tulip] Theme Texture Change v2 - AUX TOOL script in its contents.

Click on the box to get the auxiliary tool menu.

Now click on "Create!" and wait while the texture lines are being output. You can choose to copy them to a notecard (its name, we'll indicate it later), or you can choose to open the link that shows at the end of all the texture lines. The link has the following aspect:

When you open the link in your browser, you will have text like this one:

Select the text. CTRL C to copy it. Now create a notecard named:

[BT]:Plywood Colors

and paste in it (CTRL V) the text you've copied from your browser. Your notecard will look like:

Excellent! You've created your first texture theme. Keep the [BT]:Plywood Colors. We'll need it later.

What have we learned so far:

  • We have to write a description in the prims that will change their texture.
  • This description begins by t; and then the text we want (minus the # character)
  • We have dropped the auxiliary tool and created a theme using the menu.
  • We have created a texture theme notecard with the web output.
  • The texture theme notecard has a name that begins with [BT]: (Yes, there's a : after [BT]; we'll discuss its importance later.)
  • After that, we write what we want as theme name (in this case, Plywood Colors).
  • The theme name cannot have more than 24 bytes (usually, 24 characters).

Let's color our cube, all of it, white, and then select the Blank texture so the cube is entirely white with a white texture.

Bring up again the auxiliary tool menu if you don't have it already up (or if it expired), and click on "Create!" for the new texture theme data.

Save the new output in a notecard named:

[BT]:White

Now texture the box so the Default (plywood) texture is set, and the top face is tinted black:

Run again the auxiliary tool, and copy the (web) output in a notecard named:

[BT]:Black Top

We have three theme texture notecards, enough for our next important step, so bring up again the auxiliary tool menu:

Hit on the "[DELETE]" option, and confirm. This will delete the auxiliary script from inside the box. We don't need it anymore once we've created all of our notecards.

Now we change in our inventory the permissions for Next Owner of the [Black Tulip] Theme Texture Change v2 script as follows:

  • Right click on the script, select "Properties" from the menu.
  • Change permissions for Next Owner as the image shows:

Drop the three theme notecards that we've created, then the [Black Tulip] Theme Texture Change v2 ~CFG~ configuration notecard included in your package. Once this notecard is in, we drop the main script into the box. It is important doing it in this order.

If everything is correct, the texture change script will read the configuration notecard and notify once it's finished. From this point on, we can use the texture change script.

Click on the box and select one theme from the options we get on the buttons. The texture changes accordingly to the theme:

What have we learned so far:

  • How to create more than one texture theme.
  • The fact that we have to drop first the configuration notecard, and after that, the script.
  • Selecting themes from the menu.
  • Setting up the object.

We're completing this first section by learning how to create themes that will affect only some faces, but not all of them. This means that the faces not involved will keep their texture on, whichever this is at the moment of selecting the theme that only changes some but not all faces.

Delete the main script and drop again the auxiliary tool in the box.

Let's change the box's texture so:

  • The top face is colored red with the Default plywood texture.
  • The rest of the faces display the [Black Tulip] Do Not Texture This Side texture, included in your package.

Create a texture theme notecard called:

[BT]:Only Red Top

with the contents of creating this new theme. Delete again the auxiliary tool.

Now drop this notecard in the object, and the main script. Try some texture changes (for example, try "White") and then the theme that only changes the top face to a red color.

What have we learned so far:

  • How to create a texture theme that involves only some faces of the object.
  • How to work if we need a new theme after we had completed a starting set of themes.
  • Theme notecards changing fewer faces require less time to load.

Repeat these steps as many times as necessary, and then let's continue the tutorial in the next section: The auxiliary tool (Now with a table and a chair). Check the [Black Tulip] Test Box included object to see the finished example (This item is inside the [Black Tulip] TTCv2 - Items for Tutorial (add) box/folder).

Step by Step Guide: First important notes

IMPORTANT: When you want to write the t; block, but there's text already that needs to be there.

  • If the description field cannot hold more characters (for example, if using UniDoor or KoolDoor), then you can write the t; block in the NAME field of the object.
  • If the description field can hold more characters, then use the # character to separate the existing part from your t; block.
  • If you're using the NAME field, it is likely that you already have something written in there (like, the name of the object). Go to the end of the name, add a # character, then write your t; block.
  • In conclusion: The # character serves as a separator.

IMPORTANT: When you're using the NAME field of the prim for the t; block, you have to click on "Read Name" on the auxiliary tool's menu to make sure that the auxiliary tool reads the name instead of the description. If its output is empty, remember to click on that button. Check also that your prims have t; blocks in descriptions or names.

IMPORTANT: You have to choose if the texture change will read descriptions, or names. This means that if one prim needs to use the name, then all the texture change prims must have the t; block in the NAME. Conversely, if one prim needs to use the description, then all the texture change prims must have the t; block in the DESCRIPTION.

IMPORTANT: If we're reading the name, we have to specify this in the configuration notecard of the script. We see how when we talk about all the notecard parameters.

IMPORTANT: The t; blocks are like this: t;identifierChosenByUs. If you have more than one texture-change prims, each one must have something DIFFERENT as "identifierChosenByUs". For example, t;legs and t;top if we're talking of a table.

Step by Step Guide: The auxiliary tool (Creating submenus)

Rez the [Black Tulip] Table for Texture Change V2 item (inside the [Black Tulip] TTCv2 - Items for Tutorial box/folder). Inspect it, and check that it has two SL-faces. The top of the table is one SL-face, the legs of the table is another SL-face.

Write the following text in the description field of the table:

t;table

Texture the legs with the [Black Tulip] Do Not Texture This Side texture so your table looks like:

Drop the auxiliary tool script inside the table. Texture the top of the table with the [Black Tulip] Table Top - Dark Brown (included in the [Black Tulip] TTCv2 - Textures for Tutorial box/folder). Create a theme for this:

Create a notecard named [BT]:Top:Dark Brown to copy the output of the script. Proceed similarly with the other three [Black Tulip] Table Top - textures, and create theme notecards with the same structure: [BT]:Top:COLOR. At the end of this, we have four notecards named:

  • [BT]:Top:Dark Brown
  • [BT]:Top:Green
  • [BT]:Top:Light Brown
  • [BT]:Top:White

Now we repeat with the legs. First, texture the top of the table with the [Black Tulip] Do Not Texture This Side texture, then texture the legs with [Black Tulip] Table Legs - Dark Brown to begin with. Create a theme with this:

Create a notecard named [BT]:Legs:Dark Brown to copy the output of the script. Proceed similarly with the other three [Black Tulip] Table Legs - textures, and create theme notecards with the same structure: [BT]:Legs:COLOR. At the end of this, we have four notecards named:

  • [BT]:Legs:Dark Brown
  • [BT]:Legs:Green
  • [BT]:Legs:Light Brown
  • [BT]:Legs:White

Now delete the auxiliary script with the [DELETE] menu option, edit the table, drop the [Black Tulip] Theme Texture Change v2 ~CFG~ configuration notecard, and then drop the [Black Tulip] Theme Texture Change v2 script. Wait for the configuration notecard to be read, and click on the table for the menu. The menu should be something like this:

Notice that instead of having the names of the eight notecards as buttons, we only have two options: Legs and Top. Let's click on "Top" to get a menu like this one:

Now we have specific color choices, and the menu is telling us that we're in "Top" as "Current theme". Select a color, "Dark Brown" for example, and see how only the top of the table is changing its texture:

We can go back to the previous menu and select "Legs" to then go through the texture choices for the table legs.

The important thing here is to realize how we've constructed submenus in the menu: By writing a : character to create the menu structure. For example, the notecard named [BT]:Legs:Green is creating a submenu called "Legs" and then "Green" is the texture option to select.

What have we learned so far:

  • We can texture sides of the object separately using the [Black Tulip] Do Not Texture This Side texture.
  • We can create a structure of menus and submenus by simply separating them with : characters in the notecard's name.

In order to consolidate this knowledge, proceed similarly and create texture notecards for the [Black Tulip] Chair for Texture Change V2 sample object, with submenus called "Wood" and "Seat". Then complete the setup to have a finished scripted object.

You can also create themes for specific combinations of Wood/Seat or Top/Legs textures, and assign them to their own menu: try it!

When you feel comfortable with creating themes in all the ways we've seen, move on to the next section to learn about the configuration notecard.

The configuration notecard: Basic parameters, new number for ADJUST and BUTTON, demo mode for store displays

The basic parameters

  • clickMode
    Possible values:
    • 0 - We get the menu on touch, regardless of the avatar that clicks sitting on the object or not.
    • 1 - We never get the menu on touch, we get it through link messages only: for example through a BUTTON or an ADJUST option in AVsitter 2. (The number to send is -31400100)
    • 2 - We get the menu on touch if we're not sitting on the object. If we're sitting, then we get it through link messages only (BUTTON or ADJUST in AVsitter 2; the number to send is -31400100).
    The usual value here is 2, but maybe you want to set it to 1 in your AVsitter 2 engines. If you set it to 1, an avatar must be sitting to get the menu through a BUTTON or ADJUST.
  • readPrimDesc
    Possible values:
    • 0 - Reads the t; block from the NAME of the object.
    • 1 - Reads the t; block from the DESCRIPTION of the object.
    The usual value here is 1: Read from DESCRIPTION.
  • defaultAccessMode
    This is the access mode the object has by default. The owner can later change this in the [ACCESS] menu. Possible values:
    • 0 - Access is open to everybody by default.
    • 1 - Access is open only to the owner by default.
    • 2 - Access is open to the object's group by default.
    The default value is 0: access open to everybody by default.
  • button
    If it has no value, the main menu displays a [CLOSE] button on the bottom left corner on the menu. But, if it has a value, the main menu displays a button with a text of our choosing. The line has, thus, the following format:

    button = buttonTextInMenu|codeNumber|primNumberTarget|extraText|showMenu|showButtonIfStanding|showButtonIfSitting and it will send a linked message with this format:
    llMessageLinked(primNumberTarget, codeNumber, extraText, id) where id is the UUID of the avatar that got the texture menu. Finally, showMenu is 0 if we don't want to show the texture menu after the special button has been clicked, or 1 if we want to show the texture menu after the special button has been clicked.
    The last parameters have the purpose of showing buttonTextInMenu when we're sitting or not. For example, we may want the [^AVsit] button to show when we're sitting, but no when we're standing up. We solve this with showButtonIfStanding set to 0 and showButtonIfSitting set to 1. Other combinations using the 0 and 1 values are possible.

    Confused by all this? Simply utilize the following line to have a "Back to AVsitter" button in your main menu of the texture change:
    button = [^AVsit]|90005|-1||0|0|1 (this is the recommended thing to do when clickMode, seen above, has 1 or 2 as value).

IMPORTANT: New number for BUTTON and ADJUST in AVsitter 2

As a consequence of unifying the style of BUTTON/ADJUST numbers through all of the new Black Tulip scripts, this version of the texture change has a NEW value to use in both the BUTTON and ADJUST lines: -31400100

This means that now our BUTTON and ADJUST lines will look like this:

  • BUTTON Texture|-31400100
  • ADJUST Texture|-31400100
IMPORTANT: The add parameter and how this affects to BUTTON and ADJUST

Let's consider this kind of build with, say, 10 prims:

  • Prim #2 contains [AV]menu, [AV]prop, and AVpos
  • Prim #2 contains a copy of the texture change
  • Prim #5 contains [AV]menu, [AV]prop, and AVpos
  • Prim #5 contains a copy of the texture change
  • Prim #10 contains [AV]menu, [AV]prop, and AVpos
  • Prim #10 contains a copy of the texture change

If we use in each AVpos notecard the same value either in ADJUST or in BUTTON (BUTTON Texture|-31400100 or ADJUST Texture|-31400100), we will obtain three times the texture change menu, one per copy of the texture change. How to avoid this? With the following setup

  • Prim #2 contains [AV]menu, [AV]prop, and AVpos, AVpos contains either BUTTON Texture|-31400100 or ADJUST Texture|-31400100
  • Prim #2 contains a copy of the texture change, the configuration notecard contains a parameter named add with value 0: add = 0
  • Prim #5 contains [AV]menu, [AV]prop, and AVpos, AVpos contains either BUTTON Texture|-31400101 or ADJUST Texture|-31400101
  • Prim #5 contains a copy of the texture change, the configuration notecard contains a parameter named add with value 1: add = 1
  • Prim #10 contains [AV]menu, [AV]prop, and AVpos, AVpos contains either BUTTON Texture|-31400102 or ADJUST Texture|-31400102
  • Prim #10 contains a copy of the texture change, the configuration notecard contains a parameter named add with value 2: add = 2

We can have up to 100 different prims with a setup like this, the numbers going from 0 to 99.

Demo mode for stores

Store owners may want that their items on display go back to a selected texture theme after some time has gone by. This helps in having your store display everything with a consistent theme, not having to worry about the test choices your possible customers will make. The parameters we explain now are to be used only in your store. Your final product doesn't need them and values can be empty.

  • demoMode
    Possible values:
    • 0 - Demo mode is inactive.
    • 1 - Demo mode is ACTIVE, and the following parameters take effect.
  • demoTime - In here we indicate how many seconds after the texture has been changed, to return to the texture theme we want to show by default. This value has to be at least 60 or it will default to 300 seconds (five minutes).
  • demoBaseNC - In here we write the name of the texture theme notecard that we want to be applied after the time specified in demoTime has passed.

Remember: These three parameters are not meant for your final product! These are only for the store/event display items. The final product should have them with empty values.

Step by Step Guide for ADVANCED users

The use of this script consists of three steps:

  • Decide which prims will change their texture. Write t;identifier in each prim's description that has the texture, a different identifier for each one. Or, if you're using UniDoor or KoolDoor, write t;identifier in the name of the prim(s) after using a # character as a separator. Again, it is important to write different identifiers in different prims.
  • Use the "Create!" button of the auxiliary tool script to get the texture theme. Use "Read Name" to switch between reading the name or the description for t; blocks. Use the "Do not texture this side" to skip faces that should not change their texture in a prim that has SOME faces changing texture. Create a theme notecard per texture theme. They have to be named [BT]:YourTextureThemeName - as you include more : characters in the notecard name, you get your themes sorted into subfolders.
  • Change permissions of your script in inventory. Drop the configuration notecard, all the texture theme notecards, and after you have them, drop the main script. Let the configuration notecard to be read and ready to go.

The configuration notecard: Advanced use

The special Color and Alpha menus

We can have only one special Color menu and/or only one special Alpha menu per object. The purpose of these menus is to present with options to either change the color of the object (or some parts), or change the transparency of the object (or some parts).

We set this up using the colorMenu and alphaMenu parameters of the configuration notecard. We specify in here the notecard name of the corresponding submenu with the options that only change color or only change alpha.

This works in conjunction with the Cr. Color, Cr. Alpha, and Cr. C&A of the auxiliary tool. When we click on Cr. Color, the auxiliary tool only outputs the color that the object should have for that specific theme. When we click on Cr. Alpha, the auxiliary tool does the same with the transparency. When we click on Cr. C&A, the auxiliary tool does the same with both color and alpha.

Now, this color might be lost when another texture theme is applied, and same happens to the transparency. How can we avoid this? We can avoid this in the texture themes where we want for the color to persist by changing the color field (or the transparency field) to an asterisk * character.

For instance, if our texture theme is this:

t;table|1|5JAIgQsce9eQXDvHQQlGERHw3Z5mBg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||P4|0|0|0|0||I58OfgYJibcAc8aKqweOK4MAdmzXsg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|
|jfGF9grmz0UAvpAwBAqUY8AQiwyA4Q|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||51|0|1|0

We locate the seventh field (empty fields count) and substitute it by an asterisk * character like this:

t;table|1|5JAIgQsce9eQXDvHQQlGERHw3Z5mBg|<1.0,1.0,0.0>|<0.0,0.0,0.0>||*|P4|0|0|0|0||I58OfgYJibcAc8aKqweOK4MAdmzXsg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|
|jfGF9grmz0UAvpAwBAqUY8AQiwyA4Q|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||51|0|1|0

Similarly happens with the transparency. If we choose to generate themes that only change the transparency, this can be lost when another texture theme is applied. How can we avoid this? Like we do with the color: using an * character, this time on the eighth field.

For instance, if our texture theme is this:

t;table|1|5JAIgQsce9eQXDvHQQlGERHw3Z5mBg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||P4|0|0|0|0||I58OfgYJibcAc8aKqweOK4MAdmzXsg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|
|jfGF9grmz0UAvpAwBAqUY8AQiwyA4Q|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||51|0|1|0

We locate the eighth field (empty fields count) and substitute it by an asterisk * character like this:

t;table|1|5JAIgQsce9eQXDvHQQlGERHw3Z5mBg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||*|0|0|0|0||I58OfgYJibcAc8aKqweOK4MAdmzXsg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|
|jfGF9grmz0UAvpAwBAqUY8AQiwyA4Q|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||51|0|1|0

And if we want to preserve both color and alpha? Then the texture theme lines would be like this:

t;table|1|5JAIgQsce9eQXDvHQQlGERHw3Z5mBg|<1.0,1.0,0.0>|<0.0,0.0,0.0>||*|*|0|0|0|0||I58OfgYJibcAc8aKqweOK4MAdmzXsg|<1.0,1.0,0.0>|<0.0,0.0,0.0>|
|jfGF9grmz0UAvpAwBAqUY8AQiwyA4Q|<1.0,1.0,0.0>|<0.0,0.0,0.0>|||51|0|1|0

Can we do this in an easy way? Yes, by using the Cr. No Color, Cr. No Alpha or the Cr. No C&A buttons of the Auxiliary Tool. Each one creates the appropriate texture theme lines with an asterisk * character in the right place.

Setting the script to work as master or slave in different objects that should coordinate their textures

When we want two (or more) objects changing textures coordinately, we follow the procedure explained next. But first, let's answer this question: when do we want objects changing textures coordinately? For example, when we have a swing. Usually, the legs of the swing are a separate object from the swing itself. But both have wood textures that we may want to coordinate. So this is how we have to proceed.

First, we choose which will be the master object. Swing legs? Swing? Let's suppose we choose the swing as the master object. This means, the swing legs is the slave object. Both objects will have the texture change script included, and they will have notecards with common names for the themes that should coordinate. This means, we need for instance a notecard named [BT]:Dark wood in both the master and the slave (with different content, obviously). Do this for all the notecards that apply.

Now, in the master object, we set this in the configuration notecard:

master = 1
showMenuFromHUD = 0
listenWithClick = 0
listenWithClickTime = 0
channelObjects = Your channel number (for example, -123456)
setName = Your unique name here (for example, Spring Set 1)
areaMgmSys = The area name

and in the slave object, we set this in the configuration notecard:

master = 0
showMenuFromHUD = 0
listenWithClick = 0
listenWithClickTime = 0
channelObjects = Your channel number (for example, the same -123456)
setName = Your unique name here (for example, the same Spring Set 1)
areaMgmSys = The area name

The difference is this: all the slave objects set master to 0, while the master object sets master to 1.

IMPORTANT: The master and slave objects must have the same listenToChannelObjects number. They also must have the same setName and areaMgmSys values. But we can and in fact must use different settings for different sets of objects that we sell.

IMPORTANT: If we're NOT using a master/slave configuration, listenToChannelObjects and listenWithClick must be set to 0. The value of listenWithClick might be different if we're creating a HUD, which is discussed in the corresponding section.

IMPORTANT: When working with a master-slave configuration, all the slave items (even the slave-master we see next) must have the clickMode parameter set to 1.

There's yet another distinction to make that is controlled by one parameter in the notecard. Let's see it with examples.

Suppose we have a pair of earrings and a HUD to change textures/colors/alpha for it. When we click on the color button, a menu shows. Twice. One per earring. We don't want this. We want having just one color menu that changes both. So this means we need a structure like this:

  • Main Object: The HUD
  • Main earring (sets master to 0 and showMenuFromHUD to 1): The earring that will show the color/alpha menu
  • Rest of slave earrings (sets master to 0 and showMenuFromHUD to 0): The earring that will simply apply the texture theme, not showing the menu

Under a setting like this, the main earring object needs that the parameter showMenuFromHUD is set to 1, and the rest of earring objects need that the parameter showMenuFromHUD is set to 0.

We have a similar-yet-a-little-different scenario in a swing with separate parts. The structure we need is this:

  • Master Object: The swing
  • Slave with showMenuFromHUD set to 0: The swing legs that will simply apply the texture theme, not showing the menu

Working with a control management system

If you work with a control management system, make sure that either in a configuration notecard or in a script you use the value assigned to areaMgmSys in the configuration notecard.

Creating Texture HUDs

Creating a texture HUD is like creating a master/slave setup, the HUD being the master and the object(s) being the slave(s). There's a difference, though. The HUD uses the following assets instead of the regular [Black Tulip] Theme Texture Change v2 script and CFG notecard:

  • [Black Tulip] Theme Texture Change v2 - HUD SCRIPT
  • [Black Tulip] Theme Texture Change v2 - HUD SCRIPT ~CFG~

Those are the only assets the HUD needs to work. Then the slave(s) have a regular set up, as we've discussed. The important parameters in the HUD configuration notecard are:

channelObjects = -872342
setName = Your unique name here
areaMgmSys = AREA 1

which have the same meaning as we saw in the master/slave section, and have to be used the same way. The sample notecard contains some more lines that we will discuss later.

The slave configuration notecard presents a small difference. We can, of course, use these values like in the master/slave section:

master = 0
listenWithClick = 0

which means that the slave objects are constantly listening, or we can use these values:

master = 0
listenWithClick = 1
listenWithClickTime = 150

which means that the slave objects will start listening only after they're touched, and they will listen for a maximum of listenWithClickTime seconds. After that, they become dormant and will need of a new click to have them listen. This allows us to selectively change textures, for instance.

There is a case where using the listenWithClick setup is not recommended: in small objects like jewelry, for they're difficult to click on. So, as a rule of thumb, set listenWithClick to 0 when the objects are small (jewelry, body adornments), and set listenWithClick to 1 when the objects are normal sized (like furniture, houses, etc.)

If you have a "Color" or an "Alpha" button in your HUD, remember to set showMenuFromMasterOrHUD to 1 in the configuration notecard of the object that will show the menu.

Constructing the HUD

The functionality of the HUD is based in this idea: each HUD button is associated to one function: change a texture, show the COLOR menu, show the ALPHA menu, show the MAIN MENU, show a text where we link to our social media venues. If we examine the [Black Tulip] TTCv2 - Sample HUD object, we find that the texture buttons have this DESCRIPTION format:

  • btnT=[BT]:Top:Dark Brown
  • btnT=[BT]:Top:Green
  • btnT=[BT]:Top:Light Brown
  • btnT=[BT]:Top:White
  • etc.

So the DESCRIPTION format is:

btnT=TEXTURE THEME NOTECARD NAME

for the buttons which function is to apply a specific texture theme.

The button that will invoke the COLOR menu has the following DESCRIPTION:

btnCOLOR=[BT]:COLOR

The button that will invoke the TRANSPARENCY (ALPHA) menu has the following DESCRIPTION:

btnALPHA=[BT]:ALPHA

And the button that will invoke the MAIN menu has the following DESCRIPTION:

btnTEXTURE_MENU

Lastly, we can use as many buttons as we wish with the following format:

btnM=mediaBL

This means that the script will read the [Black Tulip] Theme Texture Change v2 - HUD SCRIPT ~CFG~ notecard and look for a line that begins with btnM, which in our example is:

mediaBL = Follow our blog for all our news: www.yourlink.here

So when the corresponding button is clicked, the text "Follow our blog for all our news: www.yourlink.here" will show up in chat for the user eyes only.

IMPORTANT: Don't forget the parameter showMenuFromHUD that was discussed in the previous section. It is vital if the HUD applies to more than one object and we want to show one menu that affects all the slaves.

IMPORTANT: Remember that when working with a master-slave configuration, all the slave items (even the slave that shows the menu from the HUD) must have the clickMode parameter set to 1.

The Poses Add-On (AVsitter 2)

Ever wanted to be able to change the texture of your object when a pose is selected? Now this is possible with the Poses Add-On.

Make sure in the first place that you drop the [Black Tulip] Theme Texture Change v2 - POSES ADDON before you drop any other scripts, and that you do in the same prim where the texture change script AND the AVsitter engine will be included.

The configuration notecard supports two parameters:

  • TexturePose = nameInMenu|textureNotecardToLoad
  • TexturePoseDefault = textureNotecardToLoad

The first one, TexturePose, defines what textureNotecardToLoad when the pose nameInMenu is played in AVsitter. Notice the pipe character | used to separate both values.

You can use as many TexturePose lines as you need (limited by script memory.)

The second one, TexturePoseDefault, defines what textureNotecardToLoad when a pose is selected and it doesn't show in any of the TexturePose lines.

The Rez Prop Add-On

Suppose you have a set of cushions that can change their texture with the main script, and now you want that for a certain pose, AVsitter rezzes a single pillow or maybe two (whatever you need). But you want more. You want that when the pillow set is rezzed, it changes the texture to the same theme than the main set of cushions has set.

How can we do this? Using the REZ PROP add-on.

The idea is simple: Your prop must contain [AV]object (as in every normal setup in AVsitter), the [Black Tulip] Theme Texture Change v2 - REZ PROP (PROP) script, the [Black Tulip] Theme Texture Change v2 - REZ PROP (PROP) ~CFG~ configuration notecard, and all the needed theme notecards in it. We talk more about the notecards later.

The rezzer prim (the one with the AVsitter engine) must contain, besides the AVsitter setup, the main texture change script with its configuration notecard and the theme notecards, the [Black Tulip] Theme Texture Change v2 - REZ PROP script and its [Black Tulip] Theme Texture Change v2 - REZ PROP ~CFG~ configuration notecard.

Let's go now for the details.

First: Your prop has its own t; blocks. This means that the main object may have t;pillow1 and t;pillow2 , and your prop can be simply t;pillow .

Second: Your prop needs that the theme notecards are named the same as the main object's notecards. BUT the content may and will be different.

A prop with [AV]object already loaded is built by setting the [Black Tulip] Theme Texture Change v2 - REZ PROP (PROP) ~CFG~ notecard parameters, dropping it in the prop before the script, then dropping all the theme notecards for it, then finally dropping the [Black Tulip] Theme Texture Change v2 - REZ PROP (PROP). Do not do this in a different order. Wait until the prop says it's ready before taking it into inventory.

The previous notecard contains a few parameters:

  • setName: This parameter has to coincide with the setName of the main [Black Tulip] Theme Texture Change v2 ~CFG~ configuration notecard.
  • channelRezzer. This parameter must coincide with the channelObjects of the [Black Tulip] Theme Texture Change v2 ~CFG~ configuration notecard.
  • channelProps. This parameter has to coincide with the channelProps parameter of the [Black Tulip] Theme Texture Change v2 - REZ PROP ~CFG~ configuration notecard.
  • readPrimDesc. Set it to 1 if it will read the t; blocks from the description. Set it to 0 if it will read them from the name.

Once the prop is built and taken into inventory, let's see about the [Black Tulip] Theme Texture Change v2 - REZ PROP ~CFG~ notecard. Usually, it is meant to define which themes are EXCLUDED from loading in the prop. These are usually the names of folders and subfolders.

How does a folder/subfolder look like? For example, if your theme is named [BT]:Legs:Red , the folder to add as a theme to exclude in the configuration notecard is [BT]:Legs .

Similarly, if your theme is named [BT]:Legs:Reds:Burgundy , the subfolder to add as a theme to exclude in the configuration notecard is [BT]:Legs:Reds .

When you've made the list of the themes that will be excluded (menus and submenus), drop the [Black Tulip] Theme Texture Change v2 - REZ PROP ~CFG~ configuration notecard in the object and then the [Black Tulip] Theme Texture Change v2 - REZ PROP script.

If instead of exclude we use include, then the listed themes will be the only ones to be applied.

IMPORTANT: The plugin only knows about the last theme used. It doesn't know if your furniture needs one, two or thirteen themes for a specific configuration you like. Only the last one will be applied to the prop that rezzes.

Scripting API

This section is for scripters only. It describes the commands you can use with linked messages and llRegionSay commands in order to perform several functions. You need a good understanding of LSL to continue with this section.

Command numbers to be used as linked messages:

  • -31400100 - add: Shows up the menu taking the access level into account. Only needs the id of the avatar that will receive the menu in the key parameter; the string parameter is ignored. See the "The configuration notecard: Basic parameters" section and the subsection "IMPORTANT: The add parameter and how this affects BUTTON and ADJUST" for a reminder of what add is.
  • -31400200: This is a notification sent by the texture change script, not a command. When a texture is selected to load from the menu, or loaded, the following link message is sent:
    llMessageLinked(LINK_SET
        , -31400200
        , notecardName + "|" + pathToNotecard + "|" + areaMgmSys + "|" + setName
        , avatarID);
    

Command numbers to be used as both linked and listen messages (in the channelObjects channel defined in the configuration notecard):

  • 800000: Loads a notecard, does not show up menu after loading
  • 800001: Changes the notecard path
  • 800006: Shows the textures menu in the current path (listen only)

The format of the latter messages when using llRegionSay is as follows:

channel: channelObjects
command: "MSG_CODE|" + ncToRead + "|" + currentNCname + "|" + areaMgmSys
+ "|" + setName + "|" + llGetObjectName() + "|" + (string)id

Where MSG_CODE is one of the three command numbers specified previously (800000, 800001, and 800006) and currentNCname is the path to the ncToRead we specify (if ncToRead = [BT]:MyTest, then currentNCname = [BT]).

When sent as a link_message, the string in the third parameter of the event has the following format:

str|areaMgmSys|setName

The value of str is the name of the notecard to load when the code is 800000, and it is the path where we want to point at when the code is 800001.

Check the [Black Tulip] TTCv2 - Sample Scripts for API box/folder for examples using the scripting API.

The notecard for your customers

Your purchase contains a notecard named ! READ ME: ABOUT OBJECTS PLACED IN DIFFERENT LOCATIONS. This is a notecard to include in your creations when master-slave setups are used on rezzed objects (not in attachments). It explains to the final user (your customer) how to proceed to have different copies of the same set scattered around the sim without one affecting each other. You can of course include your own notecard if you want to rewrite mine, but remember to include it.

Troubleshooting

Q: I've added the ADJUST line in AVpos, but the button isn't showing under [ADJUST].

A: First, make sure that you have only one ADJUST line in your AVpos notecard. Use the Search feature for this. If you have one ADJUST line, for instance:

ADJUST COLOR|12345

then you need to modify the ADJUST line like, for example:

ADJUST COLOR|12345|TEXTURE|-31400100

If your AVsitter 2 doesn't admit this format, it is likely that you're using one of the first versions of AVsitter 2. Update to the latest version to have all of AVsitter's features - including this one.

Q: I've set up everything, but only one prim changes its texture.

A: Make sure that you've given different identifiers to your descriptions/names. Make sure they're consistent, i.e., that it's either all in descriptions, or all in names. They can't be mixed.

Q: I've set up everything, and all prims but a few change their texture.

A: See above. Likely, some prims share identifier.

Q: I've set up everything and when using the texture menu, some (or all) the textures are gray.

A: First, make sure that you're working with a full perms object. If you are, try redoing the themes with a fresh new copy of your object. If this doesn't work, then go to another sim and create the themes in a fresh new copy of your object.

Q: The auxiliary tool's output is empty.

A: Make sure that you've assigned t; blocks to either descriptions or names and that you're using the correct mode (description/name) in the auxiliary tool.

Q: I already have a description/name in this prim, what do I do?

A: Remember, you can separate the description/name in sections by adding a # character and then the t; block.

Q: I have added the textures add-on, but the textures don't change with the poses. What can I do?

A: Likely, the textures add-on was dropped after the texture change script. Reset the texture change script USING THE [RESET] MENU BUTTON (under [ACCESS]) and try again.

If after having followed the directions and checked the troubleshooting list, you have problems making the script work, please click here for the customer service form.