Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Need a little help with using Timers

Cyrus Odets
Registered User
Join date: 5 Oct 2005
Posts: 51
11-19-2005 11:44
Greets,

I'm stumped here and was hoping someone might help me out with some wiz-bang solution or trick.

My question is with regards to timers.

I understand and can use the llSetTimerEvent function, but my problem comes with the fact of...

What do you do if you have more than one timer you need running...with each timer doing different events?

For example...

Say you have a timer that starts when an object is touched, and say...every 600 seconds you want a certain bunch of code to fire off. For example, maybe for this timer its a timer that starts a listen...and 300 seconds later you want it to automatically 'shut down' your object and remove the listen.

But then....after you've already touched and started the timer above..., you need to set another timer so that another different set of code loops once every 100 seconds. Say, for example, you have a certain animation that you need to play through once every 100 seconds.

Then...to further complicate matters, the above mentioned animation needs to have a facial expression 'held' for the entire duration of the animation. So....you need a third timer that fires off that restarts that facial expression once every .25 seconds to 'hold' the facial expression in place.

So...in my example above...I have 3 separate 'timers' I need running...with each executing 3 separate chunks of code each timer their timer elapses. So...in essence...I need to loop a bunch of actions on a timer.

I can't any ability to 'instantiate' a separate timer for each activity I need to do....they all share the same timer it seems. So...each subsequent use of llSetTimerEvent will 'override' the first it seems.

Anyone have any advice on a method to do this?

Thanks!!!
AJ DaSilva
woz ere
Join date: 15 Jun 2005
Posts: 1,993
11-19-2005 12:52
Off the top of my head, you could use 3 separate scripts.

Alternativly you could just run most regular script, increment a counter each time and run the other code when the counter gets to a set point.

Hope that helps. :)
_____________________
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
11-19-2005 14:39
My TimerEnhancer code may help with this :)
==Chris
Cyrus Odets
Registered User
Join date: 5 Oct 2005
Posts: 51
11-21-2005 08:56
Thanks Christopher!!!