Basic Voyager 2 Script - take two

All about writing scripts for Celestia in Lua and the .cel system
Topic author
Paul L

Basic Voyager 2 Script - take two

Post #1by Paul L » 06.08.2003, 03:20

Please let me know if this is wasting everyone's time (ie, not useful). I've cleaned it up a bit and added some text to the flybys.

Problems: despite having it at the beginning of the script, I still need to periodically zero the time rate (back slash) before running it - or Voyager doesn't end up centered.

It's working nicely now (on my computer), but different users may need to tweak the duration numbers in the orbit and wait commands for Voyager and planet to appear more or less in view at the same time.

Paul L.
__________________________________

{

# A simple Voyager 2 script

labels {clear "galaxies|moons|asteroids|constellations|stars|planets|spacecraft" }
renderflags {clear "galaxies|orbits|constellations"}

timerate { rate 0 }

time { jd 2444060.97094 }

select { object "Voyager 2" }
gotolonglat {distance 2 longitude 120 latitude 10 up [0 1 0] time 1}
wait { duration 1.5 }
follow { }
timerate { rate 0 }

print { text "Jupiter - July 1979" origin "center" duration 2 }

timerate {rate 30000.0}
select { object "jupiter" }
lock { }
center { }
wait { duration 14 }

orbit { axis [ 0 1 0 ] rate -40 duration 5 }
wait { duration 1 }

print { text "Saturn - August 1981" origin "center" duration 2 }

time { jd 2444840.72903 }
timerate { rate 20000 }
select { object "saturn" }
lock { }
center { }
wait { duration 14 }

orbit { axis [ 0 1 0 ] rate -40 duration 4.5 }
wait { duration 1 }

print { text "Uranus - January 1986" origin "center" duration 2 }

time { jd 2446453.72903 }
select { object "uranus" }
lock { }
center { }
wait { duration 10 }

orbit { axis [ 0 1 0 ] rate -40 duration 4.5 }
wait { duration 1 }

print { text "Neptune - August 1989" origin "center" duration 2 }

time { jd 2447763.04167 }
timerate { rate 8000 }
select { object "neptune" }
lock { }
center { }
wait { duration 8 }

orbit { axis [ 0 1 0 ] rate 20 duration 1 }

}

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 21 years 8 months
Location: NY, USA

Post #2by selden » 06.08.2003, 03:53

Paul,

It'd help the readability somewhat if you enclosed your scripts in [ code ] and [ /code ] pairs (but without the spaces).
Selden

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 21 years 8 months
Location: NY, USA

Post #3by selden » 06.08.2003, 04:04

It'd also help if you specified the source of the Voyager models and trajectories that your script relies on.
Selden

marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 2 months
Location: Outback Australia

Post #4by marc » 06.08.2003, 04:25

Besides the above two points it looks like it is pretty cool. I know it takes a lot of time to write/test these scripts. Im keen to have a try once the model is specified.

Topic author
Paul L

Model and Trajectories info

Post #5by Paul L » 06.08.2003, 05:18

Model and trajectory info included, and added a departure from Earth.

Thanks for the comments.

Paul L.


{

# A simple Voyager 2 script by P. Luckas

# Uses the trajectory files available from "Jack's Celestia Add-ons" web site and a model produced by Kalaus Gierloff"

labels {clear "galaxies|moons|asteroids|constellations|stars|planets|spacecraft" }
renderflags {clear "galaxies|orbits|constellations"}

timerate { rate 0 }

time { jd 2443376.20833 }

select { object "Voyager 2" }
gotolonglat {distance 2 longitude 40 latitude 20 up [0 1 0] time 1}
wait { duration 1.5 }
follow { }

print { text "Departure from Earth - August 1977" origin "center" duration 3 }

timerate {rate 2500}
select { object "earth" }
lock { }
center { time 5 }
wait { duration 3}
labels {set "moons"}
wait { duration 6 }
labels { clear "moons" }

time { jd 2444060.97094 }
select { object "Voyager 2" }
gotolonglat {distance 2 longitude 120 latitude 10 up [0 1 0] time 5}
wait { duration 5 }
follow { }

print { text "Jupiter - July 1979" origin "center" duration 2 }

timerate {rate 30000}
select { object "jupiter" }
lock { }
center { time 5 }
wait { duration 14 }

orbit { axis [ 0 1 0 ] rate -40 duration 5 }
wait { duration 1 }

print { text "Saturn - August 1981" origin "center" duration 2 }

time { jd 2444840.72903 }
timerate { rate 20000 }
select { object "saturn" }
lock { }
center { time 5 }
wait { duration 14 }

orbit { axis [ 0 1 0 ] rate -40 duration 4.5 }
wait { duration 1 }

print { text "Uranus - January 1986" origin "center" duration 2 }

time { jd 2446453.72903 }
select { object "uranus" }
lock { }
center { time 5 }
wait { duration 10 }

orbit { axis [ 0 1 0 ] rate -40 duration 4.5 }
wait { duration 1 }

print { text "Neptune - August 1989" origin "center" duration 2 }

time { jd 2447763.04167 }
timerate { rate 8000 }
select { object "neptune" }
lock { }
center { time 5 }
wait { duration 8 }

orbit { axis [ 0 1 0 ] rate 20 duration 1 }

}

don
Posts: 1709
Joined: 12.07.2003
With us: 20 years 10 months
Location: Colorado, USA (7000 ft)

Re: Basic Voyager 2 Script - take two

Post #6by don » 06.08.2003, 23:59

Paul L wrote:Please let me know if this is wasting everyone's time (ie, not useful). I've cleaned it up a bit and added some text to the flybys.
Howdy Paul,

Thank you for sharing your cool script! :D

Sharing is never a waste of time. Hundreds of people are registered in these forums but you'll only see a small handful of them ever posting a message. So, rest assured that your script will be used by lots of people. :)

Paul L wrote:Problems: despite having it at the beginning of the script, I still need to periodically zero the time rate (back slash) before running it - or Voyager doesn't end up centered.

I'm using version 1.3.1 pre9 and it works fine.

One suggestion: you might want to set timerate back to normal (1) at the end of the script.

For folks who want to get Jack's Voyager xyz file, here is a link to that specific web page, where you can find voyager.zip: http://homepage.eircom.net/~jackcelestia/spacecraft.htm.

Thanks again Paul :!:
-Don G.
My Celestia Scripting Resources page

Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

don
Posts: 1709
Joined: 12.07.2003
With us: 20 years 10 months
Location: Colorado, USA (7000 ft)

Post #7by don » 07.08.2003, 00:03

marc wrote:Im keen to have a try once the model is specified.

Howdy marc,

Not positive, but I don't think the model matters, as long as you actually have one. I'm sure someone will correct me if I'm wrong.

However, to view the script as Paul meant it to be viewed, you will need Jack's voyager.xyz file.
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

JackHiggins
Posts: 1034
Joined: 16.12.2002
With us: 21 years 5 months
Location: People's Republic Of Cork, Ireland

Post #8by JackHiggins » 07.08.2003, 00:06

I should probably chime in here...

For anyone who's wondering why they should use my voyager xyz's instead of others, it's because they have about 3 times the sample rate ( & hence much more accuracy) for all the planet flybys and voyager 1's flyby of titan, compared to any other voyager xyz's that i've seen.

That may sound like shameless self-promotion, but it's not... Really! :D
- Jack Higgins
Jack's Celestia Add-ons
And visit my Celestia Gallery too!

don
Posts: 1709
Joined: 12.07.2003
With us: 20 years 10 months
Location: Colorado, USA (7000 ft)

Post #9by don » 07.08.2003, 00:07

selden wrote:It'd also help if you specified the source of the Voyager models and trajectories that your script relies on.

Howdy Paul,

What Selden means is that after you paste your script code into the forum editor box, select it all, from { to } which will highlight it, then click the Code button above the editor box. This will enclose the code in it's own box and display it in a fixed-point font (like courier), like the example below. This makes it easier to read on-screen.

Hope this helps.

Code: Select all

{
# This is a test

select { object "Sol/Earth" }
goto   { time 3 }
}
-Don G.

My Celestia Scripting Resources page



Avatar: Total Lunar Eclipse from our back yard, Oct 2004. Panasonic FZ1 digital camera (no telescope), 36X digital zoom, 8 second exposure at f6.5.

Topic author
Paul L

Jack's xyz files.

Post #10by Paul L » 07.08.2003, 07:57

FWIW jack, it was your xyz's that inspired me to throw together a script in the first place (in fact, the script is next to useless without them). I did a quick check through the NASA photo archives and was amazed to find several angles and vistas almost exactly as they appear in the simulation.

JackHiggins wrote:I should probably chime in here...

For anyone who's wondering why they should use my voyager xyz's instead of others, it's because they have about 3 times the sample rate ( & hence much more accuracy) for all the planet flybys and voyager 1's flyby of titan, compared to any other voyager xyz's that i've seen.

That may sound like shameless self-promotion, but it's not... Really! :D

Thierry_d

Post #11by Thierry_d » 07.08.2003, 21:21

If someone is looking for it, the model is there...

http://www.bt.homepage.btinternet.co.uk ... oyager.zip

nice script, thx!

:wink:

Thierry_d

Post #12by Thierry_d » 07.08.2003, 21:25

Thierry_d wrote:If someone is looking for it, the model is there...

http://www.bt.homepage.btinternet.co.uk ... oyager.zip

nice script, thx!

:wink:


AND YOU HAVE TO RENAME Voyager.3ds and Voyager.jpg to voyager.3ds and voyager.jpg (case sensitive!) :idea:


Return to “Scripting”