help with script to goto constellations

All about writing scripts for Celestia in Lua and the .cel system
Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

help with script to goto constellations

Post #1by elbertdee » 25.03.2009, 19:00

Hello
yep I am a newbie here. I have spent the last 2 days looking for info on writing a script to go to different constellations, but All I can find are example of going to planets.

I would appreciate a little help in how to goto constellations.

Thanks

Elbert TwoPonies

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 11 months

Re: help with script to goto constellations

Post #2by BobHegwood » 25.03.2009, 20:04

elbertdee wrote:Hello
yep I am a newbie here. I have spent the last 2 days looking for info on writing a script to go to different constellations, but All I can find are example of going to planets.

I would appreciate a little help in how to goto constellations.

Thanks

Elbert TwoPonies

Do you mean how do you go to the STARS of a constellation?
Or, do you mean how do you go to a vantage point which is
simply closer to the constellation itself for a different view?

Thanks, Brain-Dead
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #3by elbertdee » 25.03.2009, 20:46

Thanks for the reply
Well either way will work.
I need to figure out how to get a script written that will travel from constellation to constellation
I have tries some scripting and as long as it like goto Sol/Earth it works
So just looking for a way to do a tour .
I have not figured out which command , other than I know I want a wait before traveling on.
But can't get the script to goto something beside a planet.

I would like it to travel to each one so that it can be seen. The whole constellation.

Thanks for any help.

Avatar
LordFerret M
Posts: 737
Joined: 24.08.2006
Age: 68
With us: 18 years 1 month
Location: NJ USA

Re: help with script to goto constellations

Post #4by LordFerret » 26.03.2009, 05:22

Most folks here write scripts in celx, which is a more advanced scripting language than Celestia's default cel script language. You might want to check out the scripting resources at the Celestia Wiki found here.

If you prefer to stick with cel scripting for now, you'll find a cel scripting reference here. This reference is for an older version of Celestia, but the basic script commands still apply (for the most part) to the v1.5.1 version.

I'm not sure if this is what you're looking for in a script, but I wrote up a sample cel script for you. The sample uses Ursa Major for a "tour". Note that when you're in close proximity to a star, the constellation line(s) disappear... there's a reason for this but I can't recall what it is (perhaps others can explain). Ursa Major has 7 main stars - to create a tour which visits each, you need to know each star's identification/name (in this case, I use the HIP numbers).

Code: Select all

{

# sample cel script

# setup - start at earth
   select {object "Sol"}
   goto {time 1}
   wait {duration 1}
   select {object "Sol/Earth"}
   goto {time 1}
   wait {duration 1}

# enable constellations and their labels
   labels {set "constellations"}
   renderflags {set "constellations"}

# we'll use Ursa Major (The Big Dipper) for our tour example
# central star in Ursa Major = HIP 59774
# we'll start there, visit the box corners, then run out the handle of the Dipper
# select the object and center on it
   select {object "HIP 59774"}
   center {time 5}
   wait {duration 5}

# go to the object, take 15 seconds to do so
   goto {time 15}
   wait {duration 15}

# repeat the above process for each star in the Dipper
# take 10 seconds to travel to each,
# with an additional 2 seconds pause before moving on to the next
   select {object "HIP 58001"}
   center {time 5}
   wait {duration 5}
   goto {time 10}
   wait {duration 12}

   select {object "HIP 53910"}
   center {time 5}
   wait {duration 5}
   goto {time 10}
   wait {duration 12}

   select {object "HIP 54061"}
   center {time 5}
   wait {duration 5}
   goto {time 10}
   wait {duration 12}

   # back to the start of the box
   select {object "HIP 59774"}
   center {time 5}
   wait {duration 5}
   goto {time 10}
   wait {duration 12}

   select {object "HIP 62956"}
   center {time 5}
   wait {duration 5}
   goto {time 10}
   wait {duration 12}

   # this the barycenter for this binary
   # go to it a little slower so to see both stars better
   select {object "HIP 65378"}
   center {time 5}
   wait {duration 5}
   goto {time 20}
   wait {duration 22}

   select {object "HIP 67301"}
   center {time 5}
   wait {duration 5}
   goto {time 10}
   wait {duration 12}

# return to earth
   select {object "Sol/Earth"}
   center {time 5}
   wait {duration 5}
   goto {time 15}
   wait {duration 15}

# sample script ends here
   print {text "end of script" row -4 column 1 duration 5}
   wait {duration 5}

# disable constellations and their labels (put things back the way they were)
   renderflags {clear "constellations"}
   labels {clear "constellations"}

}


Hope that helps a little. :D

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #5by elbertdee » 26.03.2009, 05:39

Thank You, Wado, Pilamyia, Wopela

That help a lot. It gave me the princples for what I was wanting. Now I have something to play with.

I don't know why I have trouble with either scripting. Been a programmer for 20+ years.

Thanks Again
Elbert

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 11 months

Re: help with script to goto constellations

Post #6by BobHegwood » 26.03.2009, 18:44

See the Motherlode add-on located at:
http://www.celestiamotherlode.net/catal ... don_id=989

This does almost exactly what you want to do, and you can view the CELX code
to determine how it is done all by yourself. :wink:

By the way, I was a programmer for about 25 years, and I STILL have trouble with
CELX. Methinks it is just age. :)
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #7by elbertdee » 26.03.2009, 18:57

Thanks
Ill take a look

I am redoing the Constellations so that hey are Lakota and Dine not Greek.Im about 1/3 done with the constellation file.

Once it is all set up and the timing is correct Ill output an avi file and can then edit add sound and effects to.

So as the different star stories are told The movie can go to them. Also a quick round to the different places so they know where things are. I will probably add some Pawnee constellations as well.
Let me know if you want Credit for your help.

Yep it maybe the age. I work with a bunch of 25-32 year olds and well I just sit back and Grin sometimes.

Thanks again.

Avatar
LordFerret M
Posts: 737
Joined: 24.08.2006
Age: 68
With us: 18 years 1 month
Location: NJ USA

Re: help with script to goto constellations

Post #8by LordFerret » 26.03.2009, 23:14

You are of Sioux or Navajo nation, if I may ask (I'm just curious)? I'd very much like to see your finished work, it sounds very interesting. I hope you will post a link when you are finished. No credit needed here, I'm glad to have been of help... credit Celestia and its creators instead. :D

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #9by elbertdee » 27.03.2009, 01:45

I am actually Cherokee and Comanche.
I have been a storyteller for about 30+ years.
The Lakota and Navajo(Dine) information is more readily obtainable than some of the other and Plains culture and Southwest are more predominate in the majority peoples minds.
Depending on How ambitious I get will depend.
I am trying to keep to under 30 minutes. Then it qualifies as a short. If it goes over that is cool. I have a good Cherokee nephew that kn ows a good bit of store lore on the Cherokee side, so I may use his brain as well.
I am Cherokee and Comanche by blood. The other half is mixed European.
I was adopted by a Cheyenne man John TwoPonies, when I was in my 20s and I hang with a lot of Lakota .
I did not know I had any native blood till I was in my 30s. But I have been walking down a good red road since I was in my 20s.

Did you take a look at the one I completed on Stories
http://www.dreamtalesgraphics.info

This will be about the Stars how indigenous people use them and a few stories. So I will be using a good bit of Star traveling and constellations and doing composites of simple animation in the sky for the stories.

I will probably have more questions as I go.

The celx script was of help and I played some, but for now the cel script I started will be good . It just goes around from Constellation to constellation. I will have to get the timing to work with the script. Since There will be voice narration the labels are not needed.

Thanks Again
Elbert

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 11 months

Re: help with script to goto constellations

Post #10by BobHegwood » 27.03.2009, 15:06

elbertdee wrote:Let me know if you want Credit for your help.

No credit for me... Didn't DO anything. :wink:

elbertdee wrote:Yep it maybe the age. I work with a bunch of 25-32 year olds and well I just sit back and Grin sometimes.

Thanks again.

I try to stay away from 25-32 year-olds. They just piss me off nowadays.
But, then again, I am simply a Brain-Dead old geezer too. 8)
Glad you're getting it working now.

Thanks, Brain-Dead
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 8 months
Location: Montreal

Re: help with script to goto constellations

Post #11by Cham » 27.03.2009, 15:19

BobHegwood wrote:I try to stay away from 25-32 year-olds. They just piss me off nowadays.

Why 24 to 32 ? Why not 23 to 33 ? Or even 0 to 99 ? :P
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #12by elbertdee » 27.03.2009, 16:00

Sorry
the offer for credit was for Lord Ferret
He had helped me get a script done so I can use some footage in the DVD

Well after programming for about 27 years , young new sharp industrious young programmers can be amusing.
The others I work with are from age 25-32 so at 68 they are young.

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 6 months
Location: Hamburg, Germany

Re: help with script to goto constellations

Post #13by t00fri » 27.03.2009, 17:28

BobHegwood wrote:
elbertdee wrote:Let me know if you want Credit for your help.

No credit for me... Didn't DO anything. :wink:

elbertdee wrote:Yep it maybe the age. I work with a bunch of 25-32 year olds and well I just sit back and Grin sometimes.

Thanks again.

I try to stay away from 25-32 year-olds. They just piss me off nowadays.
But, then again, I am simply a Brain-Dead old geezer too. 8)
Glad you're getting it working now.

Thanks, Brain-Dead

Bob,

but I know you've got a lovely daughter. She might be in that age window, right? ;-)

cheers,
Fridger
Image

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #14by elbertdee » 27.03.2009, 19:27

Bob
Yes I have 1 daughter and she is barely in that age range. However she is not a programmer and I don't work with her.
I am trying not to take the question in anyway but good.

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 11 months

Re: help with script to goto constellations

Post #15by BobHegwood » 28.03.2009, 00:06

t00fri wrote:Bob,

but I know you've got a lovely daughter. She might be in that age window, right? ;-)

cheers,
Fridger

She is now a police officer here in Ohio. She is also married to a police officer too.
And, she and her husband both piss me off. Go figure. Hee, hee. :lol:

Sorry Selden... Back to topic. :wink:
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
LordFerret M
Posts: 737
Joined: 24.08.2006
Age: 68
With us: 18 years 1 month
Location: NJ USA

Re: help with script to goto constellations

Post #16by LordFerret » 28.03.2009, 01:51

Bob, that actually equates to a good thing - no parking tickets for you! :wink: :lol:

Elbert, I'll visit the site, thanks for the link. I think your effort is interesting. I am intrigued by the fact that so often tales and legends of peoples past and places afar ring a note of commonality in content... the relation seemingly reinforcing a truth buried in the stories told. Equally intriguing is when science and technology lay open new discoveries which shed light on the origins of such stories. I look forward to your finished work. By the way, rumor has it from my cousin that Cherokee blood is in the family (my mother's side of the family). Most of my cousin's family (her husband and his family included) are from and still reside in Tennessee (Smoky Mtns., Blue Ridge). I'll have to coax her into doing some genealogy research. :wink:

You mention script timing for voice. With cel scripts this can be a pain and at best difficult (as you already know). For a future such project, I would suggest then to attempt a celx script. While not perfect, celx does include a "requestsystemaccess()" hook which could be utilized to play, say for example, .wav files you've pre-recorded. I've never tried it myself (yet), but I'm sure someone here can help shed some light with this.

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #17by elbertdee » 28.03.2009, 02:30

thanks

I have the first script done and several 0of the Lakota Constellations done.
Learning about FOV etc.
I will already have the voice. So it is a matter of getting the Constellation tour timeing such that I lay the viuce down on seperate track a well as the musical score.

I am having a little trouble with the journey to 1 of the constellations
The tour goes fine then skips 1 constellation. It goes to 3 before going to Bears Lodge
I have a wait of time 8 after each one, but the 1 won't go
I have one Selected an centered on HIP 56176 that is the middle of the Bears lodge which is above Orions belt

Code: Select all

# the bears lodge
    select { object "HIP 56176" }
    set {name "fov" value 80}
    center { time 3 }
    wait { time 8 }



Code: Select all

"Bear's Lodge"
[
["Kappa Gem" "Delta Gem" "Zeta Gem" "Epsilon Gem" "Tau Gem" "Alpha Gem"]
]


Thanks

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #18by elbertdee » 28.03.2009, 02:31

Sorry the top of the Bear's lodge is one leg of the race track

"Race Track"
[
[ "Beta Aur" "Alpha Aur" "Eta Tau" "Beta Ori" "Alpha CMa" "Alpha CMi" "Kappa Gem" "Beta Gem" "Alpha Gem" "Beta Aur"]
]

Avatar
LordFerret M
Posts: 737
Joined: 24.08.2006
Age: 68
With us: 18 years 1 month
Location: NJ USA

Re: help with script to goto constellations

Post #19by LordFerret » 28.03.2009, 02:40

elbertdee wrote:thanks

I have the first script done and several 0of the Lakota Constellations done.
Learning about FOV etc.
I will already have the voice. So it is a matter of getting the Constellation tour timeing such that I lay the viuce down on seperate track a well as the musical score.

I am having a little trouble with the journey to 1 of the constellations
The tour goes fine then skips 1 constellation. It goes to 3 before going to Bears Lodge
I have a wait of time 8 after each one, but the 1 won't go
I have one Selected an centered on HIP 56176 that is the middle of the Bears lodge which is above Orions belt

Code: Select all

# the bears lodge
    select { object "HIP 56176" }
    set {name "fov" value 80}
    center { time 3 }
    wait { time 8 }



Code: Select all

"Bear's Lodge"
[
["Kappa Gem" "Delta Gem" "Zeta Gem" "Epsilon Gem" "Tau Gem" "Alpha Gem"]
]


Thanks
The problem is in the wait statement, the parameter required is "duration" - not "time".

# the bears lodge
select { object "HIP 56176" }
set {name "fov" value 80}
center { time 3 }
wait { duration 8 }

Topic author
elbertdee
Posts: 15
Joined: 25.03.2009
With us: 15 years 6 months

Re: help with script to goto constellations

Post #20by elbertdee » 28.03.2009, 02:51

Thanks

Not sure why out of 8 ones I typed that one wrong.
It works now.


as for the celx, it reminds me to much of C which I don't like C# yes but C na


Thanks
I will have more questions


Return to “Scripting”