Updated Solar System Mini Tour script

Description: All about writing scripts for Celestia in Lua and the .cel system

L2Cache
Topic author
L2Cache
Topic author
Posts: 25
With us: 13 years 8 months

#1by L2Cache » 02.02.2004, 03:14

I've added an intro onto the front that shows the orbits of the planets while text is being displayed.

I found that in 1.3.1, the field of view setting changes when the user changes the window size. The range is from 18 to 32 on testing on my systems. In the script, I changed the FOV to 21 as an adjustment for this, and made a few more small changes.

Copy the script to a text editor and save as SolarMiniTour.cel

Code: Select all

# Start of Script ------------------------------------------------------------------
{
   #---------------------------------------------------------------------------
   # SolarMiniTour.cel  Version 1.0.0  Last updated on 2/1/2004
   # A brief tour of the solar system
   # By L2Cache
   # With inspiration from the demo and other scipts and the script guide
   # Designed as a brief introduction to the solar system for students, etc.
   # It visits the Sun, our Moon, and the nine planets.
   # Tested with Celestia 1.3.0 and 1.3.1 on 640x480 and 800x600 displays
   # Tested on Windows 98SE and Red Hat Linux 9.0, KDE
   # The Sun spots will not show in lowres mode.
   # In Celestia 1.3.1, make sure orbits for moons and planets are activated
   # So that the script can show them. In Windows, on the menu bar, go to Render,
   # View Options, Orbits/Lables and check Orbits for Moons and Planets.
   # Leave other Orbits unchecked.
   # To clear the extra text on the screen, press the v key a couple of times.
   # Set full screen mode to hide the title bar.
   # Turn off your screensaver or up it's delay so the show won't be interrupted.
   #---------------------------------------------------------------------------

   cancel { }
   wait {duration 2.0 }
   timerate { rate 1 }
   labels { clear "stars|galaxies|moons|planets|spacecraft" }   
   labels { clear "asteroids|constellations" }   
   renderflags { clear "galaxies|stars|planets|orbits|comettails|boundaries|markers" }
   renderflags { clear "eclipseshadows|pointstars|constellations" }
   set { name "FOV" value 21 }
   renderflags { set "cloudmaps|nightmaps|ringshadows|atmospheres" }

   set { name "StarDistanceLimit" value 3 }
   select { object "Sol" }
   renderflags { set "stars|planets|orbits" }
   labels { set "stars|planets" }
   gotolonglat {time 2 distance 3350 up [0 1 0] longitude 0 latitude 90 }   
   print { text "Solar System Tour - Press ESC to end.
   Now showing planet orbits around the sun
   If the orbits don't show in Celestia 1.3.1, go to
   Render, View Options, Orbits/Lables and check Orbits
   for Moons and Planets. Leave other Orbits unchecked." row -6}
   wait { duration 17.0 }
   gotolonglat {time 2 distance 7600 up [0 1 0] longitude 0 latitude 90 }
   wait { duration 9.0 }
   print { text "To clear the extra text on the screen, press the v key
   once or twice. To hide the menu bar, set full screen mode." row -3 }
   gotolonglat {time 2 distance 17000 up [0 1 0] longitude 0 latitude 90 }
   wait { duration 7.0 }
   gotolonglat {time 2 distance 33000 up [0 1 0] longitude 0 latitude 90 }
   wait { duration 5.0 }
   gotolonglat {time 2 distance 55000 up [0 1 0] longitude 0 latitude 90 }
   wait { duration 4.0 }
   gotolonglat {time 2 distance 75000 up [0 1 0] longitude 0 latitude 90 }
   wait { duration 5.0 }
   print { text " " row -2 }

   renderflags { clear "orbits|stars|planets" }
   labels { clear "stars|planets" }
   set { name "FOV" value 170 }
   select { object "Milky Way" }
   gotolonglat {time 2 up [0 1 0] longitude 0 latitude 0 }
   wait {duration 2.0 }
   set { name "AmbientLightLevel"       value 1.0 }
   renderflags { set "galaxies" }
   print { text "Our Galaxy, the Milky Way . . .
   If you can't see it, increase the monitor's brightness a little." row -3 }
   set { name "FOV" value 140 }
   wait { duration 0.1 }
   set { name "FOV" value 135 }
   wait { duration 0.1 }
   set { name "FOV" value 130 }
   wait { duration 0.1 }
   set { name "FOV" value 125 }
   wait { duration 0.1 }
   set { name "FOV" value 120 }
   wait { duration 0.1 }
   set { name "FOV" value 115 }
   wait { duration 0.1 }
   set { name "FOV" value 110 }
   wait { duration 0.1 }
   set { name "FOV" value 100 }
   wait { duration 0.1 }
   set { name "FOV" value 95 }
   wait { duration 0.1 }
   set { name "FOV" value 90 }
   wait { duration 0.1 }
   set { name "FOV" value 85 }
   wait { duration 0.1 }
   set { name "FOV" value 80 }
   wait { duration 0.1 }
   set { name "FOV" value 75 }
   wait { duration 0.1 }
   set { name "FOV" value 70 }
   wait { duration 0.1 }
   set { name "FOV" value 65 }
   wait { duration 0.1 }
   set { name "FOV" value 60 }
   wait { duration 0.1 }
   set { name "FOV" value 55 }
   wait { duration 0.1 }
   set { name "FOV" value 50 }
   wait { duration 0.1 }
   set { name "FOV" value 45 }
   wait { duration 0.1 }
   set { name "FOV" value 40 }
   wait { duration 0.1 }
   set { name "FOV" value 35 }
   wait { duration 0.1 }
   set { name "FOV" value 30 }
   wait { duration 0.1 }
   set { name "FOV" value 27 }
   orbit { axis [ 0 1 0 ] rate 30 duration 18 }
   wait { duration 2.0 }

   renderflags { set "stars|planets" }
   set { name "AmbientLightLevel"       value 0.1 }
   set { name "StarDistanceLimit" value 1000000 }
   print { text "Starting Solar System Tour . . ." row -2 }
   wait { duration 3.0 }
   labels { set "stars" }
   select { object "Sol" }
   set { name "FOV" value 26 }
   wait { duration 0.08 }
   set { name "FOV" value 25 }
   wait { duration 0.08 }
   set { name "FOV" value 24 }
   wait { duration 0.08 }
   set { name "FOV" value 23 }
   wait { duration 0.08 }
   set { name "FOV" value 22 }
   wait { duration 0.08 }
   set { name "FOV" value 21 }
   goto { time 10 distance 10 }
   wait { duration 10.0 }
   print { text "Let's start at the Sun with it's spots. . ." row -2 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   labels { clear "stars" }
   labels { set "planets" }
   print { text "Now on to Mercury . . ." row -2 }
   select { object "Sol/Mercury" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "Then Venus . . ." row -2 }
   select { object "Sol/Venus" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "And now, our Earth . . ." row -2 }
   select { object "Sol/Earth" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 20 }
   wait { duration 2.0 }

   print { text "Let's see the Moon . . ." row -2 }
   select { object "Sol/Earth/Moon" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "Show orbits and on to Mars . . ." row -2 }
   renderflags { set "orbits" }
   labels { set "moons" }
   select { object "Mars" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   renderflags { set "orbits" }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "And Jupiter . . ." row -2 }
   select { object "Jupiter" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "Then Saturn and it's rings. . ." row -2 }
   select { object "Saturn" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "Now Uranus . . ." row -2 }
   select { object "Uranus" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "And Neptune . . ." row -2 }
   select { object "Neptune" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "At last, Pluto . . ." row -2 }
   select { object "Pluto" }
   goto { time 15 distance 10 }
   wait { duration 15.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 15 }
   wait { duration 2.0 }

   print { text "And we head back home to Earth." row -2 }
   select { object "Sol/Earth" }
   goto { time 25 distance 10 }
   wait { duration 25.0 }
   orbit { axis [ 0 1 0 ] rate 30 duration 20 }
   wait { duration 2.0 }
   renderflags { clear "orbits" }
   labels { clear "planets|moons" }
   print { text "The End." row -2 }
   wait { duration 3.0 }
}
# End of script ----------------------------------------------------

don
don
Posts: 1709
With us: 14 years 2 months
Location: Colorado, USA (7000 ft)

#2by don » 02.02.2004, 19:35

Very nicely done L2Cache! :D

I like the way you display orbits at the beginning so the user knows if they are active or not.

Good job!

Image Image

-Don G.

L2Cache
Topic author
L2Cache
Topic author
Posts: 25
With us: 13 years 8 months

#3by L2Cache » 02.02.2004, 22:01

Thanks much Don.

-L2Cache


Return to “Scripting”

Who is online (over the past 5 minutes)

Users browsing this forum: 2 guests