Thursday, October 25, 2007

Attachment Set Tutorial

Hullo, and welcome to the Attachment Set Tutorial. This is the first tutorial I’ve ever written, so if there is anything that doesn’t quite make sense, or is simply omitted, well, I suppose it was to be expected. Feel free to drop me a reproving word here or in world via IM.

Attachment Set is a free, open source, full permission script written by the talented and slightly goth Mrs. Carricre Wind. Its primary use is to prevent your prim skirts from falling down when sitting, or from trailing behind whilst walking. Here is the “ad” for it I did for Mrs. Wind (sorry about the rather plain model :P)



Now then, the first thing you need do is run out and get a copy of the script. It is currently available inworld at Mrs. Wind’s Caveat Emporium in New Toulouse . Follow this SLURL to the address.


Caveat Emporium in New Toulouse http://slurl.com/secondlife/New%20Toulouse/120/84/24


Essentially, Attachment set works by monitoring the state that your Second Life avatar is in, and moving the skirt (or any other prim attachment) to a location and rotation you have preset for the skirt.

To make all these adjustments easier, you will want to have a central “pivot prim”. In other words, your skirt should have a prim that the rest of the dress can pivot around like this:



If it does not have one, rez your skirt on the ground. Then right click the ground and select create, click on the sphere icon, then click on the ground to create a sphere. Then right click the sphere, edit, then hold the control and shift keys down together. You will see little white boxes. Drag one of those boxes until the sphere is very small (look on the object page and try to shrink it to about .02. Don’t go to .01, or you will not be able to shrink the skirt later on. Trust me on this ;)). Release the cntrl and shift keys, and you will see the position arrows. Drag on the position arrows until the sphere is in position above the skirt. Then click the skirt, and hold the shift and L keys down.

The sphere is now the “root prim” of the skirt. When you edit the skirt, that central prim should light up yellow, the rest of the skirt blue.

Note that this is not precisely necessary, but it makes it easier to rotate the skirt.

Now, take the skirt back into inventory, don the skirt and right click on it. Select “Edit”, then go to the “Contents” tab. Drag the script marked AttachmentSet OSS from your inventory to the Contents page on the edit window. If you do nothing else now, the skirt will automatically move back to this position in all stances.

But we want the skirt to move as we move. So, first turn on your animation override if you have one (vendors will probably want to just use default Linden settings). Now we will turn off the Attachment set.

Type “/66 suspend” in chat (no quotes). The skirt will say “Skirt animations stopped.”

Next, adjust the skirt to how you want it to be when you are standing. If you know how to do that, skip the next three paragraphs.

Right click the skirt, select Edit from the pie chart, then you will see three arrow representing the three axes you can move the skirt on. Click and drag on the ends of the arrow to move the skirt in that direction.

If you wish to rotate the skirt, hold the Cntrl key down. You will see three circles instead of the arrows. Click and move the cursor along the circles to rotate the skirt. (Trust me, this makes much more sense when you actually do it).

Finally, if you wish to resize the skirt hold the control and shift keys down together. You will see little white boxes. Drag one of those boxes inward or outward until the skirt is the size you like. You will probably need to reposition it after this.

Now you should look something like this:



Type “/66 set stand”. The skirt will say “Standing position and rotation edited and reset.”

Now sit down somewhere.



Terrible looking isn’t it? Saucy expose of knees and stocking will not do. So, edit the skirt as above into position so it looks something like this:




Then type “/66 set sit”. The skirt will say “Sitting position and rotation edited and reset.”

Next, we want to combat the way flexi skirts trail behind us when we walk. So, to do that, we want to tilt the skirt forward a bit when walking. About 10 degrees does the trick for walking, about 15 for running. From the side it will look like this (for a walk position):



Again, once walk is set type “/66 set walk”. The skirt will say “Sitting position and rotation edited and reset.” Once run is set type “/66 set run”. The skirt will say “Running position and rotation edited and reset.”

Finally, you will want to set the ground sit. Sit on the ground (or play the ground sit animation, if you have it in inventory). The stock ground sit is a bit, well, ugly, and takes a bit of a fiddle to get it to look right in a long dress. But here it is:



Once set type “/66 set ground”. The skirt will say “Ground sit position and rotation edited and reset.”

This brings up the subject of animation overrides, also know as AOs. I usually use Mme Kamileh Hauptmann’s excellent Victorian AO. It works fine with the same dress positions as the defaults, except with the ground sit. So, when I fit my dress for me, I do it with the AO on, and set THAT position as the ground sit.



Vendors might wish to keep this in mind for their customers and let them know that if they have a very unusual AO, they might have to do some adjustment.

Now, we’re all set! To start the AttachmentSet working again, type “/66 resume”. The skirt will say “Skirt animations restarted.” Note that since the skirt only notices change in state (in order to keep lag down), you will have to move before it adjusts itself.



Additional notes
:

Using the skirt is very simple. Wear it, and it automatically adjusts itself. Note that different sized avatars might need a bit of adjustment, so if you sell skirts with AttachmentSet, you might wish to include instructions (feel free to link to this page, but I’d prefer links to copying).

When making skirts using Attachment Set, you will want at least a short glitch pant, as the skirt will need to rotate forward when sitting, invariably exposing the fundament.

If you use a pose ball, including a dance ball, SL thinks the avatar is sitting. If you don’t wish to have the skirts move to the sit position (such as when dancing), type “/66 suspend” before getting on, then “/66 resume” when getting off.

This is a fairly low lag script. It only moves the skirt when the avatar’s position changes, and uses a slower timer than most AOs. Still, if sim lag is an issue, you might wish to turn it off via “/66 suspend”. When you want it on, you can type “/66 resume” resume again.

If you want the skirt to automatically stop in high lag areas, copy the following code into a script, then drag the script into the contents tab of the skirt (script is derived from a Linden LSL wiki example):


integer paused;
default
{
on_rez(integer s)
{
llResetScript();
}

state_entry()
{
llSetTimerEvent(0.3); //Repeat every 3/10th of a second.
}

timer()
{
float dilation = llGetRegionTimeDilation(); //Get the dilation
if(dilation < 0.65)
{
llOwnerSay("Sim lag is high, pausing skirt animation");
llSetScriptState(“AttachmentSet OSS”,FALSE); //Pause it
paused=TRUE;
}
else
{
//If the dilation is more than 65%
llSetScriptState(“AttachmentSet OSS”,TRUE); //run it
if (paused==TRUE)
{
llOwnerSay("Sim lag is low, restarting skirt animation");
paused=FALSE;
}
}
}
}


This will also tell the owner when the script is stopping and starting.

Finally, don't forget that there are many other things besides skirts that can use this. Mrs. Wind made a clever walking stick that demonstrates how it can be used for a walk and a stand animation: the stick neatly slides into the appropriately jaunty position based on avatar posture. I'm sure the creative can can up with even more examples than this!

Well, off to start fiddling with all my dresses in stock :P

11 comments:

Nancy Frye said...

Excellent! No more knees poking out!

Eva Bellambi said...

Miss Virrginia -
You have been tagged, my friend.

:-)

Please see my latest blog entry for details. Or those blogs of Mr. O'Toole, Miss Kelley, or Baron Bardhaven, for that matter. :-)

Yours,
Eva

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Thank you for this wonderful tutorial. It was very kind of you to create it, and I appreciate the time you spent on it.

Tanya

Deb said...

Hi. Sorry, I know this is an old post... but I've looked all over for that Attachment Set script, and cannot find it. Is it still available?

Thanks.

Virrginia Tombola said...

It still is, Deb! It should be out at the Caveat Emporium in New Toulouse.

http://slurl.com/secondlife/New%20Toulouse/120/84/24

New Toulouse is a telehub, so you'll have to "follow the red arrow" once you land. If you still can't find the place, IM me inworld.

Deb said...

Got it. Thank you so much!!

Anonymous said...

Thank you for this wonderful script :-) Sissy Zabelin

Anonymous said...

this is totally nice just one little hint...

the place where to look for it in sl is not called caveat emporium but caveat emptorium...with a t in it...saves you on a lot of searching :)

greetings and thanks

Anonymous said...

just tried to get there, says its not available anymore

Virrginia Tombola said...

Hmmm...I haven't been there in a bit. I'll check with Ms. Carricre Wind and find out where the latest location is.