Sonntag, 28. Dezember 2014

Easy Item Switcher

Hello :-)


Today I'd like to share something with you, which came to my mind, after I bought some clothes with lots of different options (=cloth-layers/prims). It is nice to have these options, but changing them is a little tedious (open inventory, search the right folder, search the right item, and so on) and sometimes one even forgets about them.

Therefore I created a way which requires nothing but a little bit of setting up and then clicking at the place of an avatars body, where the item should be changed.

You will need a basic understanding of the creation and editing of the easiest SL-objects to copy my approach, as well as a RLV-compatible viewer.

You can find the script here: http://pastebin.com/4Y04mhwf

Example:

I will use the Hobble Doll Black from Mesmerize Dungeon as an example.

It comes with 1 optional part for the head, 3 options for the breasts, optional gloves and socks and two options for the lower part (and also some other options, which I won't cover here ;-) ). Her is a picture of the folder which I received:

Yes, that are many items ^^

So the first step is bringing some order into these items:

-When I can I always choose the underwear-layer for catsuits and similar items, because I won't have to worry about tattoos on the actual tattoo-layer then.
-Everything worn on the head must be a tattoo-layer. That's a SL-Restriction.
-Gloves have to be worn on the gloves-, socks on the socks-layer.
-I also added empty folders so that the script can take of parts (technically it adds the empty folders while removing all the other folders from the outfit).

That's how the folder looks after I ordered the items. Note that I only attached the marked items. The folders for my top and my "pants" have been attached automatically, because they contain the modifier ":default".

Also note, that all the folders are categorized. Folders with the second parameter ":pants" can only be controlled with the item of the same name. The names matter! (not the most beautiful solution, but this way you don't have to play around with menus or notecards to set the system up). Also note: even if your folder only contains one category of items (e.g. you only have tops) you still have to use the categories in the names.


And, of course, this folder must be located anywhere under the #RLV-Folder. Mine is at #RLV/>Clothes/>Costumes/>Catsuits/Latex Catsuit MD Hobble Doll Black Folder but you can place it wherever you like..... while it has the folder "#RLV" (the name matters again ;-) ) as its highest parent-folder.

But where are these prims which I attached? They are invisible (that means their textures transparency is 100%). If you hit CTRL+ALT+T you can see them. Like this:


Note that I attached two items with the same name at two different places. That's because I think it makes sense to control the gloves from either hand.


Now, when I click on one of the prims, a menu shows up. For example the breasts menu:

It shows 4 options. Take a look at the folder above and you see, that every folder, who has "Top" right after the question mark in its name, is listed here. When I click on one of these buttons all folders in the "Top"-Category will be detached and the chosen folder attached. For example I could choose "CutOutBreasts" and the result will look like this:

Don't forget to give the server some time to bake the textures. Your viewer will change the items in a few seconds, but it might take a little longer to actually display the change on your avatar.

That's it.... in case you don't want others to play around with your stuff. In case you want them to do that (just like me ;-) ) you can set your items to public. Doing so is easy, just add ":public" to the items name. Like this:

The hood on my head has been attached by my friend, who controlled the menu for this item. Since I only declared the Head as being public she wasn't able to use the menu for the other parts.

Note that you have to detach an reattach the controlling item, before a change of the name takes effect.


Creating the controlling item....


is easy. In my opinion ;-)

First hit CTRL+B to bring up the build-menu. Click somewhere on the ground. You might need to be at a place where building is allowed, a sandbox is a safe choice. You will get a basic form.

Right click it and choose "Put On->Attach" and the place where you want to attach the item.

The go to the content-tab and add a script ("New Script"). Double click it and paste my code in it. In case you missed it at the top of the post: http://pastebin.com/4Y04mhwf

Stretch and Rotate the object until it is in position. Then go to the Texture-Tab and set the Transparency to 100%.


I hope you enjoy it :-)


The license for my codes is GNU GPLv3

Keine Kommentare:

Kommentar veröffentlichen