New Cel Script To Try

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

christoria
Topic author
christoria
Topic author

#1by christoria » 01.11.2003, 03:06

OK, try this one. Let me know how it turns out on your system. I wrote it for mine, which is a little slower than some. Also, let me know if you like it. The facts, I believe, are all correct.


Feel free to change this in any way. Just upload whatever you do. I, too, like to see Celestia just run with it sometimes.

----------------------------------------------------------------------------------

{
# Setup section
timerate { rate 1 }
labels { clear "planets|minorplanets|stars|constellations|spacecraft|asteroids|moons" }
renderflags { set "stars|planets|clouds"
clear "constellations|orbits|galaxies|boundaries" }
print { text "Beginning planet size/distance comparison in 5 seconds. . . Press ESC to end."
row -3
column 5
duration 3 }
set { name "AmbientLightLevel" value 0.4 }
set { name "FOV" value 25.0 }
setvisibilitylimit { magnitude 6.5 }
wait { duration 5 }

# Visit Sun
timerate { rate 1 }
select { object "Sol" }
center { time 10 }
goto { time 10 distance 10 }
follow {}
wait { duration 10 }
print { text "The Sun, our base point for measuring distance. We're at 7 million km away."
row -3
column 5
duration 5 }
wait { duration 5 }
print { text "Let's zoom in to 2 million km - our base number."
row -3
column 5
duration 5 }
select { object "Sol" }
wait { duration 3 }
changedistance { duration 3 rate -0.5 }
wait { duration 5 }
print { text "We'll observe all of the planets from this distance."
row -3
column 5
duration 5 }
wait { duration 5 }

# Mercury
timerate { rate 1 }
select { object "Mercury" }
center { time 10 }
print { text "On to Mercury."
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "Mercury. We are only 17 thousand km away."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "Let's go to 2 million km away, like we just did at the sun."
row -3
column 5
duration 5 }
select { object "Mercury" }
wait { duration 3 }
goto { time 6 distance 819.672 }
# changedistance { duration 3 rate 1.6 }
wait { duration 5 }
print { text "Woah! This is the same distance as from the sun!"
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Venus
timerate { rate 1 }
select { object "Venus" }
center { time 10 }
print { text "Let's check out Venus. Watch Mercury go bye bye."
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "Here we are - now we are 42 thousand km away."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "Let's go to 2 million km away again."
row -3
column 5
duration 5 }
select { object "Venus" }
wait { duration 3 }
goto { time 6 distance 330.469 }
# changedistance { duration 3 rate 1.29 }
wait { duration 5 }
print { text "Almost gone! Small compared to the sun, wouldn't you say?"
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Earth
timerate { rate 1 }
select { object "Earth" }
center { time 10 }
print { text "Now let's go home."
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "Beautiful - at a distance of 44 thousand km away."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "And at 2 milliom km. How many earths can fit inside the sun?"
row -3
column 5
duration 5 }
select { object "Earth" }
wait { duration 3 }
goto { time 6 distance 313.571 }
# changedistance { duration 3 rate 1.28 }
wait { duration 5 }
print { text "At a radius of about 25,000 miles, about a million earths could fit in the sun."
row -3
column 5
duration 5 }
wait { duration 8 }
print { text "A little bit of trivia for you..."
row -3
column 5
duration 4 }
wait { duration 5 }
print { text "Earth weighs about 6,600,000,000,000,000,000,000 (6.6 sextillion) tons."
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Mars
timerate { rate 1 }
select { object "Mars" }
center { time 10 }
print { text "Now we set off to the red planet."
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "Right now we are 23 thousand km away."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "2 million km - shall we?"
row -3
column 5
duration 5 }
select { object "Mars" }
wait { duration 3 }
goto { time 6 distance 588.928 }
# changedistance { duration 3 rate 1.48 }
wait { duration 5 }
print { text "Still not seeing much at this distance."
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Jupiter
timerate { rate 1 }
select { object "Jupiter" }
center { time 10 }
print { text "On to some bigger planets. Much bigger. First is Jupiter."
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "We are 500 thousand km away! Remember Mercury at 17 thousand km?."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "How big will this look at 2 million km? Let's see."
row -3
column 5
duration 5 }
select { object "Jupiter" }
wait { duration 3 }
goto { time 6 distance 27.975 }
# changedistance { duration 3 rate 1.29 }
wait { duration 5 }
print { text "This is much bigger planet. Actually this is the biggest planet!"
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Saturn
timerate { rate 1 }
select { object "Saturn" }
center { time 10 }
print { text "And the planet with the best rings. Saturn."
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "422 thousand km away. What a cool planet!"
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "Could watch this one for a while, but, 2 million km coming up."
row -3
column 5
duration 5 }
select { object "Saturn" }
wait { duration 3 }
goto { time 6 distance 331.785 }
# changedistance { duration 3 rate 1.29 }
wait { duration 5 }
print { text "Still looks cool. And you can see it. Also a big one!"
row -3
column 5
duration 5 }
wait { duration 8 }
print { text "Want some more trivia?"
row -3
column 5
duration 5 }
wait { duration 8 }
print { text "Saturn is the only planet, that if put in water, would float!"
row -3
column 5
duration 5 }
wait { duration 10 }
print { text "Tell me that aint cool. Saturn is cool."
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Uranus
timerate { rate 1 }
select { object "Uranus" }
center { time 10 }
print { text "Now, we chek out Uranus. That's 'your-in-iss'"
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "All blue and everything at 179 thousand km."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "Betcha it stays blue at 2 million km."
row -3
column 5
duration 5 }
select { object "Uranus" }
wait { duration 3 }
goto { time 6 distance 78.25 }
# changedistance { duration 3 rate 1.29 }
wait { duration 5 }
print { text "Still blue. Told ya. Did you notice the planet is sideways?"
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Neptune
timerate { rate 1 }
select { object "Neptune" }
center { time 10 }
print { text "OK. Two to go. Here comes Neptune. Isn't this fun?"
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "173 thousand km. The closest we've started with the gas giants."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "Here we go - 2 million km."
row -3
column 5
duration 5 }
select { object "Neptune" }
wait { duration 3 }
goto { time 6 distance 80.762 }
# changedistance { duration 3 rate 1.29 }
wait { duration 5 }
print { text "Neptune is about 4 times bigger than Earth."
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }

# Pluto
timerate { rate 1 }
select { object "Pluto" }
center { time 10 }
print { text "Lastly, we will go to Pluto. A small one you will see."
row -3
column 5
duration 5 }
goto { time 10 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 10 }
print { text "Only 8 thousand km away. At Mercury, we started at 17 thousand km."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "Say bye. 2 million km coming up."
row -3
column 5
duration 5 }
select { object "Pluto" }
wait { duration 3 }
goto { time 6 distance 1737.619 }
# changedistance { duration 3 rate 1.29 }
wait { duration 5 }
print { text "There you have it. Sun = Huge. Pluto = Where'd it go?"
row -3
column 5
duration 5 }
wait { duration 8 }
timerate { rate 1 }
wait { duration 10 }
print { text "We're done. Planets vary greatly in size."
row -3
column 5
duration 8 }
wait { duration 10 }
print { text "However, none compare to the sun. What a magnificent solar system!"
row -3
column 5
duration 8 }
wait { duration 10 }
timerate { rate 1 }
select { object "Earth" }
center { time 10 }
print { text "Let's head home to end all of this."
row -3
column 5
duration 5 }
goto { time 15 distance 8 }
follow {}
timerate { rate 1 }
wait { duration 16 }
print { text "And here is our planet - Earth. So go home already."
row -4
column 5
duration 5 }
wait { duration 10 }
print { text "You can press -D- to watch it again."
row -3
column 5
duration 8 }
wait { duration 10 }
}

--------------------------------------------------------------------------------

I used a base model script from somewhere here. I modified it a lot though. Someone gets the credit for that much, but I have neglected to account for him/her. Sorry. If you know who, please let me know, so I can give the credit appropriately.

Thank you,

christoria

ANDREA
ANDREA
Age: 72
Posts: 1528
With us: 15 years 3 months
Location: Rome, ITALY

Re: New Cel Script To Try

#2by ANDREA » 01.11.2003, 18:57

christoria wrote:OK, try this one. Let me know how it turns out on your system. I wrote it for mine, which is a little slower than some. Also, let me know if you like it. The facts, I believe, are all correct.
christoria


Hello Christoria, I've just tried your .cel script, and I found a mistake at the given 2 million Km for Saturn distance.
For Jupiter you put distance 27.975, while for Saturn you put 331.785. Check it, it should be much smaller, I haven't done calculations, but may be it should be 33.1785. If I'll find something else, I'll inform you.
For the moment, thank you, nice work.
By soon

Andrea

PS: I have an Athlon 2700 with 1 Gb RAM and Nvidia Ge Force4 Ti 4600 128 Mb.
Core 2 Quad Q6600 G0 3.8 GHz- 8 GB DDR2
DELL 2709W 1920x1200- WIN 7 64 bit- ASUS P5K-E-
8800 GTX 768MB- 6xSATA II, total 7.5 TB-260.89- Celestia 1.6.1
Celestia1.4.1_patch3- Vincent's LUA Edu Tools 1.2

christoria
Topic author
christoria
Topic author

ANDREA Is Right

#3by christoria » 01.11.2003, 22:11

Yup,

ANDREA is correct. Put the decimal between the "3" and the "1" for Saturn after you copy and paste the script. Sorry everyone. I'll test these better from now on. (gettin' all complacent and whatnot with my scripting abilities)

BTW ANDREA, were the delays too long on your system?

Thank you,

christoria

ANDREA
ANDREA
Age: 72
Posts: 1528
With us: 15 years 3 months
Location: Rome, ITALY

Re: ANDREA Is Right

#4by ANDREA » 01.11.2003, 22:19

christoria wrote:BTW ANDREA, were the delays too long on your system?
christoria


No Christoria, timing was OK on my system.
By soon

Andrea
Core 2 Quad Q6600 G0 3.8 GHz- 8 GB DDR2
DELL 2709W 1920x1200- WIN 7 64 bit- ASUS P5K-E-
8800 GTX 768MB- 6xSATA II, total 7.5 TB-260.89- Celestia 1.6.1
Celestia1.4.1_patch3- Vincent's LUA Edu Tools 1.2

ElPelado
ElPelado
Posts: 862
With us: 14 years 5 months
Location: Born in Argentina
ICQ

#5by ElPelado » 02.11.2003, 14:08

In my computer it also worked fine.
Nice job!!!
---------X---------
EL XENTENARIO
1905-2005

My page:
http://www.urielpelado.com.ar
My Gallery:
http://www.celestiaproject.net/gallery/view_al ... y-Universe

Brendan
Brendan
Posts: 296
With us: 14 years 2 months
Location: Bellows Falls, VT
ICQ

#6by Brendan » 02.11.2003, 18:32

Why did the script say that the base number for measuring distance was 7 million km, and then change that to 2 million km? :? The script worked after I fixed the decimal point for Saturn. The delays felt a bit long, but I'll try the script again and it's nice to get a while to look at each planet.
This script gave me an idea. I have gone to different planets and moons to compare the sizes of impact basins. Maybe we could make a script that does that. 8) For the one at the south pole of the moon, it's a good idea to turn up the ambient lighting.
And we could also make one that compares stars.

Brendan

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#7by Bob Hegwood » 02.11.2003, 19:38

Christoria,

Your script worked perfectly on my non-Graphically enhanced Windows XP machine. The timeframe was appropriate, and all of the displays worked perfectly.

One minor note though...

Shouldn't the renderflag value you have be defined as "cloudmaps?"

In other words, you're trying to set the cloud display using the following:
renderflags { set "stars|planets|clouds"}

Shouldn't this be set as follows?

renderflags {set "stars|planets|cloudmaps}

I really don't know if it makes a real difference, but it will only work on my machine (Using Celestia 1.3.0) if I use the above method to display clouds.

At any rate, this was a great trip. Thanks for the tour. :D

Take care, Bob
Bob Hegwood
Windows XP-SP2, 256Meg 1024x768 Resolution
Intel Celeron 1400 MHz CPU
Intel 82815 Graphics Controller
OpenGL Version: 1.1.2 - Build 4.13.01.3196
Celestia 1.4.0 Pre6 FT1

christoria
Topic author
christoria
Topic author

Thanks

#8by christoria » 03.11.2003, 02:08

Hello,

Thanks for the responses.

Brendan - We started at the sun - our base point - at 7 million km. Then moved to 2 million km - our base number. Sorry for the confusion. Also, sizes of impact basins would take a long time, and really good pics I'd think. But it would be a real education to see that one. I wonder if Celestia would be able to highlight places on planets and moons. Probably just use names for now. As far as stars, there is a really cool Lua script somewhere that will go through stars at random. No stopping for comparison though.

Bob - The "clouds" worked for me. I'm using 1.3.1pre11. I hadn't thought older versions might be different. Thanks for pointing that out. Glad you liked it.

Thank you,

christoria

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

#9by don » 03.11.2003, 05:24

Howdy christoria,

Sorry, I didn't realize you started a new thread and copied the script over to here.

Just ran it again, and noticed that the "=" sign does not work with the print statement. This code ...

Code: Select all

print { text "There you have it. Sun = Huge. Pluto = Where'd it go?"

... produces "There you have it. Sun Huge. Pluto Where'd it go?" on my display. Anyone else? Maybe my ATI card? I *am* using the latest Catalyst drivers <sigh>.

Not your fault. I tried a couple of special characters "/" and "\" and even "==", but none of them work. So, I posted a message in the Bug forum.

Also, I have to manually visit all of the planets first, one-by-one, or all I get are plain white spheres <sigh>. Maybe using:

Code: Select all

preloadtex { object "mercury.*" }

for each of the objects would help me. I'll try later. Darn ATI card <grrr>. Guess my next "upgrade" will be to a Nvidia card.

-Don G.
_____________________________________
Dell Dimension 8250
3.06 Ghz, 1 GB RAM, ATI 9700 Pro 128 MB

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

#10by don » 03.11.2003, 06:05

Howdy cristoria,

Here are some possible changes that make your script more compatible with ATI graphics cards (using the preloadtex and wait commands).

I had problems getting the Sun (Sol) to be displayed on a repeated basis. Sometimes it would display, other times it would not. (See changes.)

It seems the print command is more finicky than I thought at first, so try to keep other commands out of the "print...wait" combos (see notes).

Also, it might also help to keep the wait duration the same as the print duration. For example...

Code: Select all

print { text "some text" row -3 column 2 duration 4 }
wait { duration 4 }  <-- not 3 or 5 or 10, but 4


Here are the first several lines of your script with some lines I moved and/or changed to give you examples of the above...

Hope this helps!

-Don G.

Code: Select all

{
# Setup section
timerate { rate 1 }
labels { clear "planets|minorplanets|stars|constellations|spacecraft|asteroids|moons" }
renderflags { set "stars|planets|clouds"
clear "constellations|orbits|galaxies|boundaries" }

print { text "Beginning planet size/distance comparison in 5 seconds. . . Press ESC to end."
 row -3
 column 5
 duration 3 }
#set { name "AmbientLightLevel" value 0.4 } (moved to after wait)
#set { name "FOV" value 25.0 } (moved to after wait)
#setvisibilitylimit { magnitude 6.5 } (moved to after wait)
wait { duration 5 }
set { name "AmbientLightLevel" value 0.4 }
set { name "FOV" value 25.0 }
setvisibilitylimit { magnitude 6.5 }

# Visit Sun
timerate { rate 1 }
select { object "Sol" }
center { time 3 }
goto { time 10 distance 10 }
#follow {} (moved lower - after wait)
wait { duration 10 }
follow {}

print { text "The Sun, our base point for measuring distance. We're at 7 million km away."
 row -3
 column 5
 duration 5 }
wait { duration 5 }

print { text "Let's zoom in to 2 million km - our base number."
 row -3
 column 5
 duration 5 }
wait { duration 5 }

select { object "Sol" }
#wait { duration 3 } (moved this up and set duration to = print)

changedistance { duration 3 rate -0.5 }
wait { duration 3 }
# (above: changed the wait duration from 5 to 3 [= print])

print { text "We'll observe all of the planets from this distance."
row -3
column 5
duration 5 }
wait { duration 5 }

# Mercury (ADDED: preloadtex and wait commands <---)
preloadtex { object "mercury.*" }
wait { duration 5 }
timerate { rate 1 }
select { object "Mercury" }

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#11by Bob Hegwood » 03.11.2003, 16:40

Christoria,

Sorry I didn't realize that the renderflags were different in Celestia 1.3.1 Pre11. I have a copy of that version on my machine, but it has too many glitches which make using it on my simple non-graphically enhanced Windows XP machine a bit trying. At any rate, I have made some changes to the CEL you wrote, and I'm using it with great satisfaction in Celestia 1.3.0.

Again, thanks for the tour. I just *love* these kinds of scripts, since they can be executed by a complete dummy (i.e. - Me), and can be simply watched for pure entertainment value. 8)

Take care, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

selden
Avatar
selden
Posts: 10086
With us: 15 years
Location: NY, USA

#12by selden » 03.11.2003, 17:03

Bob,

Could you post a list of the problems you're having with pre-11 to the bugs forum, please?

The only problem I've seen you mention is one with the crosshair.
Selden

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

#13by don » 03.11.2003, 17:41

Howdy Bob,

Bob Hegwood wrote:... I have made some changes to the CEL you wrote, and I'm using it with great satisfaction in Celestia 1.3.0.

Would you mind posting your modified script here, within code ... /code tags, so other 1.3.0 users can enjoy it too. :)

Thanks a bunch!

-Don G.

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#14by Bob Hegwood » 04.11.2003, 05:14

selden wrote:Bob,

Could you post a list of the problems you're having with pre-11 to the bugs forum, please?

The only problem I've seen you mention is one with the crosshair.


Selden,

The cross-hair cursor problem is the main one, but I think the rest of my problems are occuring because of the lack of graphical capabilties. As I believe I have mentioned before, my machine has NO graphics hardware, except for the simple Intel 82815 controller which came with the thing. I'm also limited in that my machine has only 256Meg of memory, and THAT causes me some trouble with 1.3.1 Pre11. Stars do not display correctly (Different from the nice fuzzy balls I see using 1.3.0 and YES, I'm aware that stars can be displayed differently in Pre11), and any movement is extremely frustrating since the display keeps freezing, jumping, and catching up.

The cross-hair problem I can probably solve with another cursor, but the rest of the problems I don't think I can cure unless I upgrade my machine with more memory and a good graphics card.

I'll post this message over in the bugs section too.

Thanks, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#15by Bob Hegwood » 04.11.2003, 09:21

don wrote:Howdy Bob,

Would you mind posting your modified script here, within code ... /code tags, so other 1.3.0 users can enjoy it too. :)

Thanks a bunch!

-Don G.

Code and /Code tags? Oh... I see now. Okay, just give me a day or two to finish my meddling with Christoria's script, and I'll post it here.

Thanks, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#16by Bob Hegwood » 04.11.2003, 09:28

Christoria,

I've got another dumb question for you... Why do you keep re-selecting the objects in your script? Is there some reason that I'm unaware of?
You have selected each planet twice in your script, and I just wondered if there was a reason for this? Also, why do you keep setting the timerate value to 1? If it's set to 1 at the beginning of the script, won't it stay that way?

Or, are you assuming that the user will play with the time rate in order to entertain himself while watching the size-comparisons, and you want to re-set it for each planet?

Sorry for the questions...

Always curious, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

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

#17by don » 04.11.2003, 16:05

Thank you Bob!

-Don G.

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#18by Bob Hegwood » 04.11.2003, 17:36

For you, Don: :)

Code: Select all

#--------------------------------------------------------------------
# Display Comparative Planet sizes in a Tour of the Solar System.
# This script was originally authored by Christoria from the Celestia
# Users Forum.
#--------------------------------------------------------------------
#
# Modified by Bob Hegwood on 2 Nov 03 - BobHegwood@earthlink.net -
# to display things in a manner which more consistent with Celestia
# 1.3.0 and to make better views with my 800x600 Windows XP display.

# The purpose of this script is to display some of the interesting
# Solar System objects in comparison to the size of our Sun.
#
#--------------------------------------------------------------------
# Setup the Celestia Environment for 800x600 screen resolution.
#--------------------------------------------------------------------

{
        renderflags {set "stars|planets|galaxies|cloudmaps"}
        renderflags {clear "constellations|orbits|boundaries"}
   set {name "AmbientLightLevel" value 0.4}
   set {name "FOV" value 25.0}
   setvisibilitylimit {magnitude 6.5}
   timerate {rate 1.0}
   print {text "Beginning Solar System Distance Comparison in 5 seconds... Press ESC to end." row -3 column 1 duration 5.0} 

   wait {duration 5.0}

#--------------------------------------------------------------------
# Visit the Sun first.
#--------------------------------------------------------------------

   select {object "Sol"}
   center {time 10.0}
   goto {time 10.0 distance 10.0}
   follow {}
   wait {duration 10.0}
 
   print {text "The Sun, our base point for measuring distance. We're now 7 million km away." row -3 column 1 duration 5.0}
   wait {duration 5.0}
   print {text "Let's zoom in to 2 million km - our base number." row -3 column 1 duration 5.0}
   wait {duration 5.0}
   print {text "We'll observe all of the planets from this distance." row -3 column 1 duration 4.0}
   wait { duration 5.0} 
   changedistance {duration 3.15 rate -0.5}
   wait {duration 5.0}

#--------------------------------------------------------------------
# Visit Mercury.
#--------------------------------------------------------------------

   select {object "Mercury"}
   center {time 10.0}
   print {text "On to Mercury." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8}
   follow {}
   wait {duration 10}
   print {text "Mercury. We are only 19.5 thousand km away." row -3 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "Let's zoom out to 2 million km away, like we just did at the sun." row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6.0 distance 819.672}
   wait {duration 5.0}
   print {text "Whoah! This is the same distance as we were from the sun!" row -3 column 1 duration 5.0}
   wait {duration 8.0}

#--------------------------------------------------------------------
# Visit Venus.
#--------------------------------------------------------------------

   select {object "Venus"}
   center {time 10.0}
   print {text "Let's check out Venus. Watch Mercury go bye bye." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8.0}
   follow {}
   wait {duration 10.0}
   print {text "Here we are - Now just about 48,000 km away." row -3 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "Let's zoom out to 2 million km again." row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6.0 distance 330.469}
   wait {duration 5.0}
   print {text "It's almost gone! Tiny compared to Sol, wouldn't you say?" row -3 column 1 duration 5.0}
   wait {duration 8.0}

#--------------------------------------------------------------------
# Visit Earth.
#--------------------------------------------------------------------

   select {object "Earth"}
   center {time 10.0}
   print {text "Now let's visit the Blue Planet." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8}
   follow {}
   wait {duration 10.0}
   print {text "Beautiful - at 51,000 km..." row -4 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "And from 2 million km, how many earths do you think will fit inside the sun?" row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6.0 distance 313.571}
   wait {duration 5.0}
   print {text "At a radius of about 25,000 miles, just about a million earths could fit into the sun." row -3 column 1 duration 5.0}
   wait {duration 8.0}
   print {text "Time for a bit of Trivia..." row -3 column 1 duration 4.0}
   wait {duration 5.0}
   print {text "Earth weighs about 6,600,000,000,000,000,000,000 (6.6 sextillion) tons." row -3 column 1 duration 5.0}
   wait {duration 8.0}

#--------------------------------------------------------------------
# Visit Mars.
#--------------------------------------------------------------------

   select {object "Mars"}
   center {time 10.0}
   print {text "Now we're off to visit the red planet." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8}
   follow {}
   wait {duration 10.0}
   print {text "At the moment, we're 27,000 km away from Mars." row -4 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "2 million km - shall we?" row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6.0 distance 588.928}
   wait {duration 5.0}
   print {text "Still not seeing very much at this distance." row -3 column 1 duration 5.0}
   wait {duration 8.0}

#--------------------------------------------------------------------
# Visit Jupiter.
#--------------------------------------------------------------------

   select {object "Jupiter"}    
   center {time 10.0}
   print {text "On to the bigger planets. Much bigger. The first is Jupiter." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 7.5}
   follow {}
   wait {duration 10.0}
   print {text "We are 535,000 km away! Remember Mercury at 19.5 thousand km?" row -4 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "How large is this planet at 2 million km? Let's see." row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6.0 distance 28.011}
   wait {duration 5.0}
   print {text "This planet is MUCH bigger. Actually this is the largest planet in our system!" row -3 column 1 duration 5.0}
   wait {duration 8.0}


#--------------------------------------------------------------------
# Visit Saturn.
#--------------------------------------------------------------------

   select {object "Saturn"}
   center {time 10.0}
   print {text "And now the planet with the most notable rings. Saturn." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8}
   follow {}
   wait {duration 10.0}
   print {text "We're 482,000 km away. What a cool planet!" row -4 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "Could watch this site for a while... But, 2 million km coming up." row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6.0 distance 33.151}
   wait {duration 5.0}
   print {text "Continues to look cool. And you can still see it. Saturn is also a large planet!" row -3 column 1 duration 5.0}
   wait {duration 8.0}
   print {text "Time for a bit more trivia?" row -3 column 1 duration 5.0}
   wait {duration 8.0}
   print {text "Saturn is the only planet, that would float in water!" row -3 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "Now... Tell me that ain't cool. Saturn is cool." row -3 column 1 duration 5.0}
   wait {duration 8.0}

#--------------------------------------------------------------------
# Visit Uranus.
#--------------------------------------------------------------------

   select {object "Uranus"}
   center {time 10.0}
   print {text "Time to check out the Planet Uranus." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8}
   follow {}
   wait {duration 10.0}
   print {text "All blue and pretty at 210,000 kilometers." row -4 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "Bet'cha it stays blue at 2 million km." row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6.0 distance 76.335}
   wait {duration 5.0}
   print {text "Still blue. Told ya. Did you notice the planet is tilted sideways?" row -3 column 1 duration 5.0}
   wait {duration 8.0}

#--------------------------------------------------------------------
# Visit Neptune.
#--------------------------------------------------------------------

   select {object "Neptune"}
   center {time 10.0}
   print {text "Okay. Two to go. Here comes Neptune. Isn't this fun?" row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8}
   follow {}
   wait {duration 10.0}
   print {text "198,000 km. The closest we've started with the gas giants." row -4 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "Here we go... Out to 2 million kilometers." row -3 column 1 duration 5.0}
   wait {duration 3}
   goto {time 6.0 distance 80.762}
   wait {duration 5.0}
   print {text "Neptune is about 4 times larger than Earth." row -3 column 1 duration 5.0}
   wait {duration 8.0}

#--------------------------------------------------------------------
# Visit Pluto.
#--------------------------------------------------------------------

   select {object "Pluto"}
   center {time 10}
   print {text "Finally, we'll visit Pluto. A small one as you will see." row -3 column 1 duration 5.0}
   goto {time 10.0 distance 8}
   follow {}
   wait {duration 10.0}
   print {text "Only 9,000 kilometers away. At Mercury, we were 19.5 thousand km." row -4 column 1 duration 5.0}
   wait {duration 10.0}
   print {text "Say bye bye. 2 million km coming up." row -3 column 1 duration 5.0}
   wait {duration 3.0}
   goto {time 6 distance 1759.014}
   wait {duration 5.0}
   print {text "There you have it. Sun = Huge. Pluto = Where'd it go?" row -3 column 1 duration 5.0}
   wait {duration 8.0}
   print {text "There you have it... Our Planets vary greatly in size." row -3 column 1 duration 8.0}
   wait {duration 10.0}
   print {text "However, none compare to the sun. What a magnificent solar system!" row -3 column 1 duration 8.0}
   wait {duration 5.0}

#--------------------------------------------------------------------
# Back to Earth and End the Script.
#--------------------------------------------------------------------
 
   select {object "Earth"}
   print {text "Let's head home to end all of this." row -3 column 1 duration 5.0}
   print {text "And here is our Home Planet... So go home already." row -4 column 1}
   goto {time 10.0 distance 8}
   wait {duration 10.0}
   print {text "End of Script" row -4 column 1 duration 5.0} 
   wait {duration 5.0}

}


A few notes and dumb questions again...

Does Pre11 use a different set of planetary radius values? On 1.3.0, I had to change a number of the distance values in order to arrive at the correct 2 million miles away.

Christoria: You should NOT ask the user to press the "D" key to run the script again, unless you have named it demo.cel. The "D" key causes the execution of the demo script that comes with Celestia. Just four your information.

Thanks, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1

christoria
christoria
Posts: 74
With us: 13 years 10 months

#19by christoria » 05.11.2003, 02:29

Bob - Um... The script was a base model I used. I assumed that was correct to keep selecting the objects because that's the way I got it. I just didn't delete the selections.

The timerate, I was unsure how it acted. In my base script, the timerate increased and decreased a lot, so I just set them all to "1". I'm going to have to write my own from scratch from now on. My next will be the ten brightest stars - saw it on NASA's site. That looked really fun.

I'm unaware of radius differences between the two versions. I used a simple formula to calculate the distance.

And, the "D" key is gone from now on. Thanks. I now know what it does, and not to use it in my own scripts. :lol:

By the way, thanks for the conversion to 1.3.0. That will no doubt be handy for a lot of people.

Thank you,

christoria

Bob Hegwood
Bob Hegwood
Posts: 1048
With us: 13 years 11 months
Location: Germantown, Ohio - USA

#20by Bob Hegwood » 05.11.2003, 06:35

Christoria,

I used the same formula you used, and simply applied it to the radius values I found in the 1.3.0 solarsys.ssc file. If I remember correctly, the formula was simply that Distance=2000000/Radius? I got different results for the distance parameters of Saturn, Uranus, Pluto, and maybe one or two others. So, I'm thinking that perhaps the solarsys.ssc file for Pre11 refers to different planetary dimensions? Is this the case? Does anyone know? Have we more accurate measurements now?

That's the only explanation I can think of. Of course, there are still PLENTY of things I don't know about Celestia, so maybe I'm just passing gas. At any rate, the values I used work in the 1.3.0 script to position the user at the desired 2000000 km.

Thanks for the great script. Is fun to watch, and I love your Trivia. :lol:

Take care, Bob
Bob Hegwood

Windows XP-SP2, 256Meg 1024x768 Resolution

Intel Celeron 1400 MHz CPU

Intel 82815 Graphics Controller

OpenGL Version: 1.1.2 - Build 4.13.01.3196

Celestia 1.4.0 Pre6 FT1


Return to “Scripting”

Who is online (over the past 5 minutes)

Users browsing this forum: 2 guests