G Général

Multiple Timer Scripts (Example and Demonstration) Version 1.0

Multiple Timer Scripts  (Example and Demonstration)
Détails
Caractéristiques
Contenu
Avis

When you are scripting, sooner or later you need timers. (for timeout handling in unresolved menus, for change times in picture shows, or similar)

Unfortunately the LSL supports only one timer; it is even persistent throughout the run time of a script.

This demonstration example is how to circumvent this restriction, and allows you for more than one concurrent running active timers.

Concept
----------
since every script can run a single timer at any given time, you can simply run more scripts - each holding its unique timer (the llSetTimerEvent() statement, together with the timer() event); you only need a method to start them individually, and retrieve their firing timer event accordingly.

This is done by the MessageLinked functionality:
- the individual timer scripts will be addressed with a prim-internal link message (the setup),
- the timer event (when it happens) is reported back with a similar link message (the feedback)

This little (hopefully well) documented demonstration gives you a working example of this concept:

You should have basic knowledge about LSL, especially how to address other scripts by using the link message concept.

  • for two or more concurrent active timers