Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A Lil Help

RaveWolf Strauss
Registered User
Join date: 1 Jan 2006
Posts: 53
10-02-2006 17:48
Im Needing This Script To Change All The Windows In A House Can Some One Pls Help Me....
CODE
default 
{
touch_start(integer total_number)
{
llSetTexture("WindowDiamond.tga",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("RNWindowDkGlass",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state default;
}
}
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
10-02-2006 19:42
What is the problem?
RaveWolf Strauss
Registered User
Join date: 1 Jan 2006
Posts: 53
...
10-02-2006 20:40
It Doesnt Change All The Windows In The House It Jus Changes The One That Is Clicked....i Need It To Change All The Windows In The Whole House Not Just The One Touched.....
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
Design
10-02-2006 20:51
Each window will need its own script. Then, you need to use llLinked* or llListen so taht when one window is rtouched, it tells the others that it was touched.

If you're lucky, the neighbors windows will go dark, too.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
10-02-2006 20:51
From: RaveWolf Strauss
It Doesnt Change All The Windows In The House It Jus Changes The One That Is Clicked....i Need It To Change All The Windows In The Whole House Not Just The One Touched.....


In order to do that you will need a script in each window, and set up the script so that when it's touched, it broadcasts the message (using llSay or llShout, prefferably on a negative channel) to the other windows to change. It's a relatively simple script setup to do.

CODE

default
{
state_entry()
{
llListen(-15432,"",NULL_KEY,"");//Sets the script to listen for incoming commands from other windows
}

touch_start(integer total_number)
{
llSetTexture("WindowDiamond.tga",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.
llShout(-15432,"open");//Lets all the other windows know to open
state blinds;

}

listen( integer channel, string name, key id, string message )//what to do when a message is heard from another window
{
if(message=="open")//If the message is to open the window
{
llSetTexture("WindowDiamond.tga",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);
state blinds;
}
}

}
state blinds
{
state_entry()
{
llListen(-15432,"",NULL_KEY,"");//Sets the script to listen for incoming commands from other windows
}
touch_start(integer total_number)
{
llShout(-15432,"close");
llSetTexture("RNWindowDkGlass",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state default;
}

listen( integer channel, string name, key id, string message )//what to do when a message is heard from another window
{
if(message=="close")//If the message is to close the window
{
llSetTexture("RNWindowDkGlass",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);
state default;
}
}
}


I haven't tested this out in game yet, but it should do what you're asking to. just copy this script into every window you want to open and close.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
RaveWolf Strauss
Registered User
Join date: 1 Jan 2006
Posts: 53
group only ...
10-03-2006 10:36
Well Anyone Can Touch This And Change It Can It Be Group Only?