How to unlink window tints from a "federated controller"?
|
|
Buzzer Kyger
Registered User
Join date: 1 Oct 2006
Posts: 29
|
10-22-2006 15:18
The solution to my problem may have to wait until I gain more knowledge, but thought I'd give it a shot...
My house came with a wall switch that controls ALL windows in the house, so they're either all open or all closed, etc. The windows have 5 settings ranging from transparent to closed. My understanding is that before the controller linked to them, you could Touch each window and select the desired setting.
I'm finding that I'd like to be able to adjust my windows independently. For example, two windows look onto a wall of my neighbor's house, so I'd like them to be closed all the time, even when the other windows are open.
I did some playing around in a sandbox with a copy of my house. I was able to disconnect just one window by deleting its controller script, but then the window become frozen in its current state. There was no Touch menu to select another setting. Which makes sense since there was no longer a script associated with that window. (I suppose the controller deleted the original script in order to write itself in there, but I'm not sure.) But I'd still like the option of a fully-working window that is not controlled by the wall switch.
Would appreciated being pointed in the right direction to problem solve this. I figure working on practical problems are a good way to learn until I can start attend some classes.
Many thanks -
Buzzer
|
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
10-22-2006 17:16
Well, I can give you a simple script that you can put in your window to make it go totally dark or totally transparent on command. It won't do the gradiations of gray that the one you have now does, but you will be the only one that can use this one. default { state_entry() { key owner = llGetOwner(); llSay(0,"Shutters ready"); llListen(5,"","owner",""); } listen( integer channel, string name, key id, string message ) { if( message == "open" ) { llSetStatus(STATUS_PHANTOM, TRUE); llWhisper(0,"shutters open"); llSetAlpha(0,ALL_SIDES); } if( message == "close" ) { llSetStatus(STATUS_PHANTOM, FALSE); llWhisper(0,"shutters closed"); llSetAlpha(1,ALL_SIDES); } } }
To use it just put it in the windows and then say "Open" on channel 5 to open and "close" also on channel 5 to close them. As in: /5 open /5 close
|
|
Zeera Xi
Real Join Date: Mid '05
Join date: 21 Sep 2006
Posts: 54
|
10-22-2006 18:17
Well here is a script which should work by clicking on the window instead of the switch. And it is a LOT more easier and very efficient compared to the other script posted. float Alpha = 1.0; default { touch_start(integer dnum) { if(llDetectedKey(0) != llGetOwner()) return; if(Alpha > 0.2) Alpha = Alpha - 0.2; else Alpha = 1.0; llSetAlpha(Alpha,-1); } }
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
10-22-2006 18:21
as far as the windows not having scripts theres llSetLinkAlpha that allows you to set the alpha (or transparency) of other prims in the linkset so you dont need a script in every window just the one inside the control just fyi
|
|
Buzzer Kyger
Registered User
Join date: 1 Oct 2006
Posts: 29
|
10-22-2006 19:20
Cool. I'll try these out in the sandbox tomorrow.
Thx -
buzzer
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
10-23-2006 05:29
From: Zeera Xi Well here is a script which should work by clicking on the window instead of the switch. And it is a LOT more easier and very efficient compared to the other script posted. Poor efficiency in your use of english old bean. Something can be far easier or far harder but MORE easier is an invalid construct. Vares is a self confessed LSL infant. Her script is a little inefficient but certainly not that bad.
integer Channel = 5;
SetStatus(integer open) { llSetStatus(STATUS_PHANTOM, open); if(open) llSetAlpha(0,ALL_SIDES); else llSetAlpha(1,ALL_SIDES); }
default { state_entry() { key owner = llGetOwner(); llSay(0,"Shutters ready"); llListen(Channel,"",owner,"open"); llListen(Channel,"",owner,"close"); } listen( integer channel, string name, key id, string message ) { if( message == "open" ) { SetStatus(TRUE); } else if( message == "close" ) { SetStatus(FALSE); } } }
|
|
Alex Trilling
Registered User
Join date: 28 Sep 2006
Posts: 6
|
10-24-2006 08:22
Methinks it's a simple matter of UNlinking the windows you do not want affected from the controller.
|
|
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
|
10-24-2006 13:11
Newgate, I am curiouse about the script you posted. Is there a specific reason why coding it the way you did is better than the way I did it? As in, does yours uses resources better or is faster, less lag, etc. Or is more just a matter of coding style? I did write that script quite a while ago, when I was quite new to scripting. Honestly, I can't even remember why I had them go phantom.  (BTW, Eli and I miss seeing you around...)
|
|
Walker Moore
Fоrum Unregular
Join date: 14 May 2006
Posts: 1,458
|
10-24-2006 13:50
From: Buzzer Kyger I did some playing around in a sandbox with a copy of my house. I was able to disconnect just one window by deleting its controller script, but then the window become frozen in its current state. There was no Touch menu to select another setting. Which makes sense since there was no longer a script associated with that window. (I suppose the controller deleted the original script in order to write itself in there, but I'm not sure.) But I'd still like the option of a fully-working window that is not controlled by the wall switch.
It's pretty clear that your windows have an open texture (with alpha transparency) and a closed texture. When you click any window, a script in the root prim of the building sends a link message to all the other prims, and when the scripts (which you call controllers) in the windows receive this message, they toggle the window state with the llSetTexture() function. That's why, when you deleted a script from a window, it got stuck in one state. Assuming you'd like to keep the existing open/closed window designs, you'll need to obtain the original window textures from the prefab designer, and then drop a script in those windows you'd like to control individually (after you deleted the original script) which responds to touch_start() by checking the existing texture ( llGetTexture()) before replacing it with the other texture (llSetTexture()). Did that make sense? 
|
|
Buzzer Kyger
Registered User
Join date: 1 Oct 2006
Posts: 29
|
10-24-2006 15:36
Yes, Walker, thank you. I was successful in using the scripts provided so far (which means I can cut and paste  . But after playing with the the windows for a while I decided I'd really like to keep the 5-way textures. So, as you suggest, I'm going to see if I can hunt down the original script. Many thanks, all. I really appreciate the help. Buzzer
|
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
10-24-2006 16:01
From: Buzzer Kyger I'm going to see if I can hunt down the original script. Is this by any chance the BSD Archer house? It sure does sound like it. If it is, you should be able to find a copy on Help Island Public. If it is and you can`t, consider that many people have a copy in their inventory, including me.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
10-25-2006 01:54
From: Vares Solvang Newgate, I am curiouse about the script you posted. Is there a specific reason why coding it the way you did is better than the way I did it? As in, does yours uses resources better or is faster, less lag, etc. Or is more just a matter of coding style? I did write that script quite a while ago, when I was quite new to scripting. Honestly, I can't even remember why I had them go phantom.  (BTW, Eli and I miss seeing you around...) Most of its style  but the following points are worth noting: 1) You llListen Call wouldnt work. llListen(5,"","owner",""); "owner" would only listen to an object called owner. 2) Your version didnt use specific listens which is supposedly more resource intensive. (I've yet to see conclusive evidence though having read contradictory statements. Anyone got the figures?) 3) ELSE IF  if you process "open" you already know you dont need to process "close" I think you had them go phantom so you could walk through them, I seem to remember this was origianlly a door not a window? BTW miss you guys too but thats life.
|
|
Buzzer Kyger
Registered User
Join date: 1 Oct 2006
Posts: 29
|
10-26-2006 15:48
Llauren, it is indeed the BSD Archer house. Good call.
Might be interesting to post it here. Or would that be infringement of the original scriptwriter's work? If so, I will contact you in world.
Many thanks -
Buzzer
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
10-26-2006 16:10
From: Walker Moore It's pretty clear that your windows have an open texture (with alpha transparency) and a closed texture. Nope doesn't use textures. You can call various degrees of llSetAlpha just like using the edit window and using different settings for "Transparency". For Example; llSetAlpha(1.0, ALL_SIDES); //visible llSetAlpha(0.3, ALL_SIDES); // 30% transparency llSetAlpha(0.6, ALL_SIDES); //60% transparency llSetAlpha(0.0, ALL_SIDES); //100% transparency
So you just start with "blank" texture and whatever color and High Shininess to make it look like glass. (note: once it is even partially transparent you loose reflections) I have Lecina Enigma as the original creator of that tinting system. It is available in the 2006 edition free scripts. Wouldn't hurt if someone asked her if it could be posted here. It would also make a nice addition to the library.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|