Script Doctor, help! I know it's imple but…

All about writing scripts for Celestia in Lua and the .cel system
Topic author
MonsieurMeus
Posts: 3
Joined: 26.01.2007
With us: 17 years 10 months
Location: Marseille / France

Script Doctor, help! I know it's imple but?€¦

Post #1by MonsieurMeus » 26.01.2007, 23:16

Hi evreyone!

I'm quiet new in wrting scripts so I'm biginning with something very simple. I spend a lot of time in readins forum and testing scripts to understand how it works but I can't do what I'd like to. Coud somebody help me?
The idea is simple: we're watching the earth (orbit around) go to Hubble, look the machine and then go down to Marseilles/France as close as possible. Easy isn't it? I'm always having "jumps" or can't fin Hubble anymore or can't get closer. It's getting late here and I tried and tried, when I find something, something else is going wrong?€¦ Could somebody help me?
thanks in advance

sam

{
# INITIALIZATION
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.30 }

set { name "FOV" value 30.0 }

timerate { rate 1000.0 }

time { utc "2007-06-21T06:00:00.0000" }

# ------------------
# Earth
# ------------------

# Select the Earth

select { object "Sol/Earth" }
track {time 5 }
follow {time 5 }

goto{
time 5
distance 15
upframe "chase"
}

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

timerate { rate 100.0 }

gotolonglat { time 20
distance 5
longitude 5.22580
latitude 43.174 }


print { text "Now Tracking Earth."
row -3
column 25
duration 3 }
wait { duration 10 }


# ------------------
# Hubble
# ------------------

# Select Hubble

select { object "Hubble" }


goto { time 20
distance 7
upframe "chase"
}
center {time 5}


wait {duration 10}
changedistance {duration 11 rate -3}

wait {duration 10}



# ------------------
# Earth / Marseille
# ------------------

# Select the Cours Ju...

select { object "Sol/Earth" }
track {time 10 }

goto{
time 5
distance 5
upframe "chase"
}
gotolonglat { time 20
distance 2
longitude 5.22580
latitude 43.174 }
track {time 5 }
follow {time 5 }

print { text "Now Tracking Marseilles"
row -3
column 25
duration 3 }
wait { duration 20 }


print { text "The script is finished."
row -3
column 25
duration 5 }
wait { duration 5 }

}

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 27.01.2007, 12:35

1. to select Hubble you must use its full path:

Code: Select all

"Sol/Earth/Hubble"


2. Your script needs many more wait commands. You must specify

Code: Select all

wait {duration ... } # replace ... with an appropriate number of seconds
after an operation so that it has time to finish. Then you can tell Celestia to do something different. If it is not told to wait, Celestia will immediately start obeying the next command before the previous command has finished. Sometimes that will be what you want, but often it is not.
Selden

Topic author
MonsieurMeus
Posts: 3
Joined: 26.01.2007
With us: 17 years 10 months
Location: Marseille / France

usefull but another problem: track

Post #3by MonsieurMeus » 27.01.2007, 15:25

Hi!
Thanks for your help! Looks much better now! But a problem still remains. I always have "jumps" when I'm passing from one track { } to antother track { } untrack is not working in my script (Celstia 1.4.1), is there something else to have more smooth changement of orientation? maybe not using track? any idea?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #4by selden » 27.01.2007, 15:39

center { time ...}
follow {}

might work better for you.
Selden

Topic author
MonsieurMeus
Posts: 3
Joined: 26.01.2007
With us: 17 years 10 months
Location: Marseille / France

Hurra!

Post #5by MonsieurMeus » 27.01.2007, 15:54

Thanks so much! Your help is a delivrance for me! I Love you!

have a wonderful day!

sam

Avatar
Adirondack M
Posts: 528
Joined: 01.03.2004
With us: 20 years 8 months

Post #6by Adirondack » 29.01.2007, 11:12

RTFM! :wink:

http://www.celestiamotherlode.net/catalog/documentation.html -> SSC Scripting Guide

Adirondack
We all live under the same sky, but we do not have the same horizon. (K. Adenauer)
The horizon of some people is a circle with the radius zero - and they call it their point of view. (A. Einstein)


Return to “Scripting”