I am new at Celestia scripting. I have written the simple .CEL script included below for simulating a space flight from launch at ground level to Earth orbit, and a sample destination such as the Moon -- complete with a fake countdown
The script starts in Milano (Italy), where I live. It is very simple and demonstrates some crude but effective techniques for giving the illusion of space flight.
There are still a couple of issues. The first is that some camera movements could be made smoother. Also, although I supposedly initialize the script to a known state, when I run it, it occasionally starts at the wrong location or orientation, e.g. not on the surface of the Earth. I'm probably missing some inizialization issue.
I have tested the script with Celestia 1.3.2 and GTK interface under Slackware Linux 10.0.
Paolo Amoroso
Code: Select all
# earth-launch.cel - Paolo Amoroso, 8 May 2005 - <amoroso@mclink.it>
#
# Script for simulating a space flight from launch at ground level to
# Earth orbit, and beyond.
#
# You can freely use this script for any purpose, provided you give me
# credit.
#
# Requires Celestia 1.3.2 or later, but no add-ons. It looks better
# with good Earth textures. If the textures are too large, expect
# jerky movements.
{
# INITIALIZATION
print { text "Setting up the script..." origin "left" column 5 duration 3 }
# My favorite settings...
cancel {}
cls {}
renderflags { clear "automag|boundaries|comettails|constellations|grid|orbits|markers"}
renderflags { set "atmospheres|cloudmaps|galaxies" }
labels { clear "asteroids|comets|constellations|galaxies|moons|planets|spacecraft|stars"}
unmarkall {}
set { name "ambientlightlevel" value 0 }
time { utc "2005-05-14T14:00:00.0000" }
timerate { rate 1.0 }
select { object "Sol/Earth" }
synchronous {}
# Go to Milano, Italy, and rotate the camera in order to bring
# the horizon into view
gotolonglat { time 1 distance 1.00001 up [0 1 0] longitude 9.18 latitude 45.46 }
wait { duration 1 }
rotate { duration 4.5 rate 20 axis [-1 0 0] }
wait { duration 4.5 }
print { text "Ready for countdown..." origin "left" row -6 column 5 duration 3 }
wait { duration 3 }
# Coundown
print { text "-9" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-8 ...Main engines start" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-7" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-6" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-5" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-4" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-3 ...Full thrust" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-2" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "-1" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
print { text "0 ...Liftoff! We have a liftoff!" origin "left" row -6 column 5 duration 1 }
wait { duration 1 }
# LAUNCH
changedistance { duration 9 rate 0.2 }
changedistance { duration 8 rate 0.4 }
changedistance { duration 6 rate 0.6 }
# Keep horizon in view
rotate { duration 9 rate 5 axis [1 0 0] }
# Keep northern Europe in view by going progressively higher and looking back
changedistance { duration 7 rate 0.2 }
orbit { duration 3 rate 1.5 axis [0 -1 0] }
rotate { duration 5 rate 5 axis [1 -1 0] }
changedistance { duration 2 rate 0.4 }
orbit { duration 15 rate 1.5 axis [0 -1 0] }
# GO TO THE MOON
# This is a sample further destination, for example the Moon
select { object "Sol/Earth/Moon" }
goto { time 30 distance 3.5 }
wait { duration 30 }
print { text "The script ends here" origin "left" column 5 duration 3 }
}