Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Can someone pls tell me how to use this tinting script

Zerock Parx
Registered User
Join date: 5 Jul 2008
Posts: 120
09-24-2008 08:07
Hi
I got a free script that tints windows. It came with two scripts:

Menu Driven Window Tint Script-controller prim
Menu Driven Window Tint Script-window prim

And no support.
I had made a switch prim and put the controller prim in it and set it running. I can click the switch and invokes a hud for varioius windows, and when I select a window I can set the tint %.

I also placed the window script in a window - but can't figure out how to modify the script and get this to work. I assume I will need to modify the script placed in the various windows to correspond to the switch selections.

Thanks in advance
-Zerock
_____________________
Enjoying a new world
Zerock Parx
Registered User
Join date: 5 Jul 2008
Posts: 120
09-24-2008 08:08
Here is the full window script:


// Menu Driven Window Tint Script
//Window tinting script using menu based options for a two story building, but can be modified however you'd like for whichever building style you have. This script controls several windows with one controller, varying the tinting from window to window as you choose the transparency level.
//
// This program is resell software; you can redistribute it and/or modify as version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// Please remember, we do not offer support for this script; your use of
// this script is your acknowledgement and agreement to the above
// terms.
//
// DO NOT REMOVE THE ABOVE HEADER FOR ANY REASON WHATSOEVER.
//
//
//
//Here the target (aka Windows), put this script into them.
integer chan = -28394; // uncomment for UPPER_FRONT
//integer chan = -28395; // uncomment for LOWER_FRONT
//integer chan = -28396; // uncomment for UPPER_BACK
//integer chan = -28397; // uncomment for LOWER_BACK
//integer chan = -28398; // uncomment for UPPER_SIDE
//integer chan = -28399; // uncomment for LOWER_SIDE
//integer chan = -28400; // uncomment for CEILING

//START SCRIPT
default
{
state_entry()
{
llListen(chan, "", 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);
}
}
}
//////END SCRIPT
_____________________
Enjoying a new world
Zerock Parx
Registered User
Join date: 5 Jul 2008
Posts: 120
09-24-2008 08:10
And this is the full switch script:


// Menu Driven Window Tint Script
//Window tinting script using menu based options for a two story building, but can be modified however you'd like for whichever building style you have. This script controls several windows with one controller, varying the tinting from window to window as you choose the transparency level.
//
// This program is resell software; you can redistribute it and/or
// modify as version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// Please remember, we do not offer support for this script; your use of
// this script is your acknowledgement and agreement to the above
// terms.
//
// DO NOT REMOVE THE ABOVE HEADER FOR ANY REASON WHATSOEVER.

// Window Controller Script (put into controller prim)
list TINT_OPTIONS = ["40%", "20%", "None", "100%", "80%", "60%"];
list WALL_OPTIONS = ["Lower Front", "Lower Back", "Lower Sides", "Upper Front", "Upper Back", "Upper Sides", "Ceiling", "All"];
integer UPPER_FRONT = -28394;
integer LOWER_FRONT = -28395;
integer UPPER_BACK = -28396;
integer LOWER_BACK = -28397;
integer UPPER_SIDE = -28398;
integer LOWER_SIDE = -28399;
integer CEILING = -28400;
integer CHANNEL = -28393;
integer wallChannel;
integer allWalls;

PaintAllWalls(string tintLevel)
{
integer i;
integer j;

j = -28394;

for (i = 0; i < 7; i++)
{
llSay(j, tintLevel);
j--;
} // end for
} // end PaintAllWalls

default {
state_entry()
{
llListen(CHANNEL, "", NULL_KEY, "";); // listen for dialog answers (from multiple users)
} // end state_entry()

touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "Which wall would you like to tint?", WALL_OPTIONS, CHANNEL); // present dialog on click
allWalls = 0;
} // end touch_start()

listen(integer channel, string name, key id, string message)
{
if (llListFindList(TINT_OPTIONS + WALL_OPTIONS, [message]) != -1) // verify dialog choice
{
if (message == "Upper Front";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
wallChannel = UPPER_FRONT;
}
else if (message == "Upper Back";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
wallChannel = UPPER_BACK;
}
else if (message == "Upper Sides";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
wallChannel = UPPER_SIDE;
}
else if (message == "Lower Front";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
wallChannel = LOWER_FRONT;
}
else if (message == "Lower Back";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
wallChannel = LOWER_BACK;
}
else if (message == "Lower Sides";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
wallChannel = LOWER_SIDE;
}
else if (message == "Ceiling";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
wallChannel = CEILING;
}
else if(message == "All";)
{
llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
allWalls = 1;
}

if (message == "100%";)
{
if(allWalls == 1)
{
PaintAllWalls("100";);
}
else
{
llSay(wallChannel, "100";);
}
}
else if (message == "80%";)
{
if(allWalls == 1)
{
PaintAllWalls("80";);
}
else
{
llSay(wallChannel, "80";);
}
}
else if (message == "60%";)
{
if(allWalls == 1)
{
PaintAllWalls("60";);
}
else
{
llSay(wallChannel, "60";);
}
}
else if (message == "40%";)
{
if(allWalls == 1)
{
PaintAllWalls("40";);
}
else
{
llSay(wallChannel, "40";);
}
}
else if (message == "20%";)
{
if(allWalls == 1)
{
PaintAllWalls("20";);
}
else
{
llSay(wallChannel, "20";);
}
}
else if (message == "None";)
{
if(allWalls == 1)
{
PaintAllWalls("0";);
}
else
{
llSay(wallChannel, "0";);
}
}
} // end if (valid message)
} // end listen
} // end default
_____________________
Enjoying a new world
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
09-24-2008 08:19
We would need to see what you did with the controller script.

BTW, love these old scripts, kind of silly the way it is setup. This replaces all of the if/else if tests and does the same thing:

CODE
integer chan = -28394; // uncomment for UPPER_FRONT
//integer chan = -28395; // uncomment for LOWER_FRONT
//integer chan = -28396; // uncomment for UPPER_BACK
//integer chan = -28397; // uncomment for LOWER_BACK
//integer chan = -28398; // uncomment for UPPER_SIDE
//integer chan = -28399; // uncomment for LOWER_SIDE
//integer chan = -28400; // uncomment for CEILING

default
{
state_entry()
{
llListen(chan, "", NULL_KEY, "" );
}

listen( integer channel, string name, key id, string message )
{
llSetAlpha((float)message / 100, ALL_SIDES);
}
}


EDIT: Never mind I see you just posted it. I'll take a look in a bit.
_____________________
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
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-24-2008 08:48
it looks like you need to uncomment whatever channel correspondes with the "wall" type for each prim
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Abba Thiebaud
PerPetUal NoOb
Join date: 20 Aug 2006
Posts: 563
09-24-2008 08:52
From: someone

//integer chan = -28394; // uncomment for UPPER_FRONT
//integer chan = -28395; // uncomment for LOWER_FRONT
//integer chan = -28396; // uncomment for UPPER_BACK
//integer chan = -28397; // uncomment for LOWER_BACK
//integer chan = -28398; // uncomment for UPPER_SIDE
//integer chan = -28399; // uncomment for LOWER_SIDE
//integer chan = -28400; // uncomment for CEILING


For your upstairs, front windows, remove the // in front of interger chan on the one indicating "UPPER_FRONT". Place the script into the upstairs front window prims. Repeat for the other windows, using their respective locations. You only have to do this in the windows' scripts, not in the controller script. If you simply edit the script in inventory then drop into the prims, remember to comment out (add the // at the front of the line) the window lines you're NOT using (those I've quoted above).

But there are more efficient ways to do this now. I'd suggest browsing through all the window tint scripts in the library. Something newer may be more powerful and easier to use. (Don't use the one I posted, this one appears to be a derivative of it, minor changes from the one I did. Mine is way too if/then headachy. Well, you can use it if you want, I can't stop you, but there *are* better out there.)

A
_____________________
http://www.ponystars.com/abbathiebaud Pony Up.
Zerock Parx
Registered User
Join date: 5 Jul 2008
Posts: 120
09-24-2008 11:30
Thanks everyone especially Abba:
From: someone
For your upstairs, front windows, remove the // in front of interger chan on the one indicating "UPPER_FRONT". Place the script into the upstairs front window prims.


This works perfectly
_____________________
Enjoying a new world