Script to "pause" time

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Dollard Desmarais
Posts: 28
Joined: 09.10.2003
With us: 21 years 1 month
Location: Sechelt, B.C., Canada

Script to "pause" time

Post #1by Dollard Desmarais » 25.08.2004, 22:59

I would like to include a script in the start.cel file to pause time when Celestia opens. When showing off Celestia I like to zoom in to Sechelt. Unless time is stopped, the location labels are unsteady. This can be fixed by hitting the space bar. I would like to do this automatically by using a script. Can someone show me how to do this?

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Re: Script to "pause" time

Post #2by Harry » 26.08.2004, 11:18

Dollard Desmarais wrote:I would like to include a script in the start.cel file to pause time when Celestia opens.[...] This can be fixed by hitting the space bar. I would like to do this automatically by using a script.

You can insert this line somewhere between the outer { ... } in start.cel (for instance at the second line):

Code: Select all

timerate { rate 0.0 }


But this is not the same as pressing the spacebar, i.e. you can't resume by presssing space again. Instead you have to set the timerate back to 1 by pressing "".

Harald

Topic author
Dollard Desmarais
Posts: 28
Joined: 09.10.2003
With us: 21 years 1 month
Location: Sechelt, B.C., Canada

Post #3by Dollard Desmarais » 26.08.2004, 12:55

Thanks for the response Harald. After mulling over this, and following up on a suggestion in a private message from Don, I think the best solution to prevent quivering of the labels is to replace the script:

follow {}

with the script:

synchronous {}


Return to “Scripting”