Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

multiple timers AGAIN

Kaige Tokhes
Registered User
Join date: 15 Mar 2006
Posts: 11
06-01-2006 10:05
ok so how does one do mutliple timers in a single script? I have takenm the script snippets in here that do a nice hardware flickering which involes a timer and the day night script that someone poisted in here that also uses a timer in it to keep checking for sun position but what i cant figure out is a way to combine the two scripts and have a script that does both day/ night checking and a flicker affect using prim_point_lighting. I trried using sleeps but it seems too slow.

I also stole, yes i am very good at taking free code and decyphering it and lousy at writing it myself, a nice lldialogue that i configured to do a brightness n the lights but it also used a timer, so do i look at wrioting three different scripts all involving their own timers or is there a way to combine them all.

I am not looking to steal anyones code to make money off i am actually doing this and going to give it to a friend whomakes amazing houses to include in her lamps but for me its more a learning experience.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
06-01-2006 12:58
There are a couple of ways of doing it. Probably for your application checking the sun's position every time wouldn't hurt the sim that much, unless you're flicking the lights very fast.

The other method, that I think you've called the steps one, is to calculate a timer speed that will give you a tick each time you need to trigger each of your timers... which can take some maths. Incremement a counter, and when the counter ticks to the right number (counter % factor ==0) fire the right thing off. This method will let you have loads of timers in theory running on the one script.

There are other ways of course, separate the script into two scripts, each can have a timer of its own.
Seronis Zagato
Verified Resident
Join date: 30 Aug 2005
Posts: 454
06-01-2006 20:12
/54/d7/110734/1.html

I actually brought this topic up YESTERDAY so the code is there with two different methods of implimentation (mine and ARgents). Enjoy