Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

discussion: Window Tinting System

Lecina Enigma
Linux Client User-x86_64
Join date: 16 Nov 2005
Posts: 32
05-22-2006 13:56
Here oneof my first *smiles* working scripts, with thanks to Kyrah`s example about llDialog.



First there must be an button to controll all Windows in the House..and or Room..the scripts itselfs works with llSay so max 20 Meters around all Windows will change.



Main Script (Send Unit) :



CODE
integer menu_handler;
integer menu_channel;
menu(key user,string title,list buttons)
{
menu_channel = -37641 ; // You can change the Channel as needed...to add more systems into one house, but dont forget to change the channels in the Window (Target) Scriot too)
menu_handler = llListen(menu_channel,"","","");
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);
}

default
{
touch_start(integer t)
{
menu(llDetectedKey(0),"Window Tinting System",["100","80","60","40","20","0"]);
}
timer()
{
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
}
listen(integer channel,string name,key id,string message)
{
if (channel == menu_channel)
{
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
if(message == "100")
{
llSay(menu_channel,"100");
}
else if(message == "80")
{
llSay(menu_channel,"80");
}
else if(message == "60")
{
llSay(menu_channel,"60");
}
else if(message == "40")
{
llSay(menu_channel,"40");
}
else if(message == "20")
{
llSay(menu_channel,"20");
}
else if(message == "0")
{
llSay(menu_channel,"0");
}
}
}
}




and here the target (aka Windows), put this script into them.



CODE
default
{
state_entry()
{
llListen( -37641, "", NULL_KEY, "" );
}

listen( integer channel, string name, key id, string message )
{
if ( message == "100" )
{
llSetAlpha(1.0, ALL_SIDES);
}
else if ( message == "80" )
{
llSetAlpha(0.8, ALL_SIDES);
}
else if ( message == "60" )
{
llSetAlpha(0.6, ALL_SIDES);
}
else if ( message == "40" )
{
llSetAlpha(0.4, ALL_SIDES);
}
else if ( message == "20" )
{
llSetAlpha(0.2, ALL_SIDES);
}
else if ( message == "0" )
{
llSetAlpha(0.0, ALL_SIDES);
}
}
}

Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
05-27-2006 16:14
/15/5c/108297/1.html
_____________________
i've got nothing. ;)
audio Zenith
Registered User
Join date: 18 May 2006
Posts: 16
Linked
06-06-2006 15:47
Great script..

Though I cant get it to work on linked objects.

I have glass walls 30x30m linked objects with a water texture set to transparent 80.

Any ideas why this script will not work on them?

Thanks
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
06-06-2006 16:26
From: someone

CODE

if(message == "100")
{
llSay(menu_channel,"100");
}
else if(message == "80")
{
llSay(menu_channel,"80");
}
else if(message == "60")
{
llSay(menu_channel,"60");
}
(..)

this can be all replace with:

llSay( menu_channel, message );

From: someone
CODE

if ( message == "100" )
{
llSetAlpha(1.0, ALL_SIDES);
}
else if ( message == "80" )
{
llSetAlpha(0.8, ALL_SIDES);
}
(..)


.. and on listener end, with something like:

llSetAlpha( 0.01 * (float)(message), ALL_SIDES );
audio Zenith
Registered User
Join date: 18 May 2006
Posts: 16
Solved
06-06-2006 17:01
Problem sovled.
Dominic Russell
Registered User
Join date: 16 Oct 2005
Posts: 5
error on script
06-13-2006 20:54
when i tried to run the script for the tint button, i get an error in line 6,5 of the script...this line:
menu(key user,string title,list buttons)

the error points to the position just before the k after the (

got any ideas as to what's causing this?
Sheila Plunkett
On The Prowl!
Join date: 25 Dec 2005
Posts: 67
06-13-2006 23:48
Why the bothersome if...if...if.. stuff?
How about this:

CODE

default
{
state_entry()
{
llListen( -37641, "", NULL_KEY, "" );
}

listen( integer channel, string name, key id, string message )
{
float myalpha = (integer)message / 100
if (myalpha < 0) return;
if (myalpha > 1) return;
llSetAlpha(myalpha, ALL_SIDES);
}
}
Nefertari Wallace
Registered User
Join date: 9 Dec 2004
Posts: 64
Help!
10-30-2006 17:37
The script is marvelous but I'm having trouble tinting all the windows. My house is fairly large and I was wondering if there was a way all the windows could tint or do I need a button in every room?
carol Wombat
Registered User
Join date: 29 Jan 2006
Posts: 16
10-30-2006 17:45
Replace each llSay with llShout in the send unit.