Bob:
I enjoy your scripts, too. Please, keep making them.
But now that you ask, I think that you should take a look at the new Lua scripting support. Harald's work is impressive,
and it will make your job easier.
I know cel scripting is tedious: you need to adjust delays so the text messages doesn't dissapear out of time, but taking care of overall script lenght, tweaking the viewer's movements so they flow smoothly, etc. In short words, a lot of trial and error testing.
With Lua, instead, you can define:
* a constant, let's say SECONDS_PER_CHARACTER = 0.5
* a function that takes one of your text messages and counts its characters. Then multiplies this number by the constant that you already defined and saves into a variable, say 'delaytime'
* a function that takes your text message and the variable 'delaytime' and prints it on screen and waits 'delaytime' seconds
This way longer messages will have more time on screen than shorter ones, but
without annoying manual tweaking. As you see, thanks to a few lines of code, the computer does all the job, and you are free of one boring, trial-and-error task. If you notice that the script is too fast, you only need to change SECOND_PER_CHARACTER value to, let's say 0.6
Another example:
You can define a simple structure:
body, lat., long., altitude, message
And then fill this structure with data, regarding interesting features for certain bodies:
Code: Select all
Mars 56.875 43.893 1232 "look at this..."
Enceladus 23.234 12.192 589 "look at that..."
...
...
...
And then, using a function (that you need to define) make a tour to all this bodies, showing the interesting features specified on the list, and displaying the corresponding messages.
This function can be as complex as you want: it can do smooth, elegant moves when going from one location to another, it can signal the specified location with intermittent markers, etc.
Note how simple is to add a new location to this script: one more entry:
Code: Select all
Europa 22.773 43.761 786 "look at those..."
..and that's all.
Even more, you can add code to split the text message into small pieces, so it doesn't get cut by screen limits, etc.
As you see, a lot of added functionality. (Please note that this examples
might need some extra Lua internal support within Celestia that
might be not present today. Harald has the knowledge here)
Of course, learning a programming language is not an easy task, but there should be a beginner's scripting guide out there.
Anyway, keep the good job!
Bye