Script: Theme Texture Change v2

Documentation ยท Theme Texture Change
Version 2

Version 2 is on the works. Watch this space for news. Current state: Documenting and adding last features.

[Black Tulip] Script - Theme Texture Change v2 in Marketplace.

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:

  • [Black Tulip] Theme Texture Change v2 - AUX TOOL
  • [Black Tulip] Theme Texture Change v2
  • [Black Tulip] Theme Texture Change v2 ~CFG~
  • [Black Tulip] Do Not Texture This Side
  • [Black Tulip] Proof Of Purchase - Theme Texture Change v2
  • [Black Tulip] Theme Texture Change v2 ~DOC~
  • [Black Tulip] Normal map - NO NORMAL (32x32)
  • [Black Tulip] Specular map - NO SPECULAR (32x32)
  • [Black Tulip] Theme Texture Change v2 - POSES ADDON
  • [Black Tulip] TTCv2 - Items for Tutorial (boxed/folder)
    • [Black Tulip] Test Box
    • [Black Tulip] Chair for Texture Change V2
    • [Black Tulip] Table for Texture Change V2
  • [Black Tulip] TTCv2 - Textures for Tutorial (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] 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
  • Complete tutorial objects and textures included
  • Scripting API
  • Poses Add-On: Change the texture depending on which pose is being played in AVsitter 2

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

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 to 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 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 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.

    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 (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

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 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.

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.

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

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.

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 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.