09-16-2006 08:58
Quoted from the Building Forum thread...

From: Karl Herber
I have built my first house, but I now need a script for the windows. What I have is 2 textures: the normal transparent one, and another with blinds closed across the window for privacy. What I would like to do is add a script so that when the window is touched by myself or other residents of the house, the texture of the prim will toggle between the normal transparent texture, and the privacy blinds-closed texture. The script needs to be copyable because I have several windows in the house. :)

But my scripting knowledge is something less than zero, so I am unable to write it myself.

I have tried the Search of the forums and everywhere else I can think of, and while there do seem to be some scripts listed, I don't really understand what I'm looking at or how to make them work to do what I want to do. If someone could point me to where I can find such a script, and give me detailed easy instructions on how to install it and add people to the list (so I can give permission to other residents to operate the window), I would be extremely happy. I need baby-steps and handholding, but I'm willing to pay for it.



Here is a script using touch to rotate between two different textures.

If you use the texture name, such as "window" in the llSetTexture call, then you must also include the texture in the object contents with the script. You can use the UUID of the texture instead, which is what I prefer to do, as it simplifies the permissions issues.

These will respond to anyone's touch, not just those you give permissions to. That is another level of complications I have not addressed.

CODE
//This script rotates between textures window and blind textures when touched.

default
{
touch_start(integer total_number)
{
llSetTexture("window",ALL_SIDES);//the texture shown in the default state is "window".
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a texture, 0.0 shows none
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale if needed.
state blinds;

}
}
state blinds
{
touch_start(integer total_number)
{
llSetTexture("blinds",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state default;
}
}


Here is another example rotating between 3 textures:

CODE
//This script rotates between textures 3 textures when touched.

default
{
touch_start(integer total_number)
{
llSetTexture("window",ALL_SIDES);//the texture shown in the default state is "window".
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a texture, 0.0 shows none
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale if needed.
state blinds;

}
}
state blinds
{
touch_start(integer total_number)
{
llSetTexture("blinds",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state stone;
}
}
state stone
{
touch_start(integer total_number)
{
llSetTexture("stone",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state default;
}
}
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo