Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

conflicting scripts question

Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
12-26-2004 22:49
My goal here is to create the perfect light i.e. one that responds to both chat AND touch as well as auto-sensing day/night. This is just too good not to work

right now i have the touch and chat functions working just fine (both altering prim materials from glass to light)

the problem is in the day/night sensing. It overrides the prim properties as it re-senses the current day time (i.e. it forces the light back on again if it's turned off manually)

is there a way i could over come this? i'm not much of a scripter and i'm simply using three seperate scripts here. The day/night script is Chromal Brodsky's


thanx for your help!
~Lefty
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
12-26-2004 23:29
How do you want the day/night script to behave based on what the voice/touch script does?
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
12-27-2004 00:05
From: Carnildo Greenacre
How do you want the day/night script to behave based on what the voice/touch script does?


all i really need is to find a way for the day/night script to not force the settings back to light if they were changed to glass during the night.

the only thing i can think of is to find a another way to get the auto change at dusk/dawn without querrying the sun's position constantly.
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
12-27-2004 00:20
so you want some thing like this.. modes: auto on / off , on, off. force off , and force on?

for mode "force on" and "force off" there is no need for a timer. So you'll set the timer to 0.0. Witch stops the timer.

For modes "auto", "on", and "off" you'll set the timer arproperetly and...
if it's mdoe auto, check to see if it's light or dark set the light apropetly.
if it's "on", don't bother to check the time. just set the light to on,
if it's "off",turn the light off
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
12-27-2004 02:50
I'm guessing that no matter what, if the sun sets you want it to turn on... unless you turn it off after sunset... then you want it to stay off. so set a status integer for the auto sun control in addition to your manual on/of integer.... if the light is turned off, the manual status is FALSE, if on, TRUE....

If the sun is down and:
manualOn == FALSE & autoOn == FALSE turn on/set autoOn = TRUE
manualOn == TRUE & autoOn == FALSE set autoOn = TRUE
manualOn == FALSE & autoOn == TRUE do nothing
manualOn == TRUE & autoOn == TRUE do nothing

if the sun is up and:
manualOn == FALSE & autoOn == FALSE do nothing
manualOn == TRUE & autoOn == FALSE do nothing
manualOn == FALSE & autoOn == TRUE set autoOn = FALSE
manualOn == TRUE & autoOn == TRUE turn off/set autoOn = FALSE
Lefty Belvedere
Lefty Belvedere
Join date: 11 Oct 2004
Posts: 276
05-25-2005 00:22
anyone interested in putting all this together in a pastable script? IM me for cost if need be.

~Lefty
Talila Liu
Micro Builder
Join date: 29 Jan 2004
Posts: 132
05-25-2005 09:59
You could just simply use one boolean(integer set to TRUE or FALSE) if the light is on or off.

No Need to mess with multiple compairisons that cause some performance issues if used multiple times.

so when the timer forces on or off the light it would check if the light were already on, or off, and if it was in the state it was changing to, do nothing.