cotineous loop

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

cotineous loop

Post #1by Guest » 05.06.2004, 02:28

I am new at celestia and wonder if there is a way to have the same script to keep looping indefinitly?
Also, how does celestia determine which key to activate a certain script?
one more, is there a good library of scripts for me to look at to learn trcks and see examples?


Many thanks,

Al

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

Re: cotineous loop

Post #2by don » 05.06.2004, 07:57

Anonymous wrote:I am new at celestia and wonder if there is a way to have the same script to keep looping indefinitly?
Welcome to Celestia Al. :D

There are two scripting languages available in Celestia, Cel and Celx/Lua. Which one are you using?


Anonymous wrote:Also, how does celestia determine which key to activate a certain script?
You use the File / Open Script menu commands to run a script. Or, if you are using Windows (not sure about other OS's), you can double-click a script file and it will run Celestia and then run the script.


Anonymous wrote:one more, is there a good library of scripts for me to look at to learn trcks and see examples?

There are many right here in this forum. Several people also have web pages with scripts on them. Just look through the topics here in this forum. You could also visit Selden's List of Resources for Celestia web site (http://www.lns.cornell.edu/~seb/celestia/) and search for the word script via your browser.

Hope this helps get you going!
-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.

Guest

thanks

Post #3by Guest » 05.06.2004, 13:55

thanks Don,

I really enjoyed your website. I am using .cel files, but did look at the celx and trying to go that route. Is looping possible in either of these languages?

I know that Celestia is written in C++, but I wonder if there is a way of interfacing to it via Visual Basic 6 in which I am very proficeint?

We are about to start buildin a 25000 sq ft space and astronomy center and Celestia is a great program to use as a resource for the thousands of students and general public. The problem is that I need to lock it down and introduce some interactivity.

This is lots of fun!


Al Najjar
Sci-Port Discovery Center
Shreveport, LA

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

Post #4by selden » 05.06.2004, 14:12

Al,

You might want to consider contacting Adam Nieman at NESTA Futurelab. Their kiosk version of Celestia may be close to what you're looking for.

For more information, see http://www.shatters.net/forum/viewtopic.php?p=32810&highlight=neighbourhood#32810
Selden

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

Post #5by selden » 05.06.2004, 14:24

Al,

While Celestia does not incorporate VBA, you can use VB (or any scripting language) to control it. It's a little slow, but if the programming language can send commands to the operating system, Celestia can be invoked with a command of the form

celestia --once --url filename.cel

"--once" causes the command to be sent to the running copy of Celestia. If Celestia is not running, it'll be started.

"--url filename.cel" specifies the name of a script file for Celestia to execute. It could contain a single command that the VB script created, for example.

Does this help?
Selden

Harry
Posts: 559
Joined: 05.09.2003
With us: 21 years 2 months
Location: Germany

Re: thanks

Post #6by Harry » 05.06.2004, 16:14

Anonymous wrote:I am using .cel files, but did look at the celx and trying to go that route. Is looping possible in either of these languages?

CELX can do it, CEL can't (you can enclose a CEL-script in a CELX-script, and then let the CELX script loop the CEL-script ;) )

CEL-script are a list of commands that are executed one after the other, while CELX-scripts use a "real" programming language (which is called Lua

The problem is that I need to lock it down and introduce some interactivity.

What kind of input devices will you use?

Harald

Guest

Post #7by Guest » 05.06.2004, 18:04

thanks to all,

I am interigued by Seldans suggestion of using VB to write scripts. are you suggesting writing .cel files but using VB? Is there a way of generating such scripts from VB6? I am very interested in this and woul love further clarification. Also, is there a resource to read about doing this?

as to interactivity, I am using two mouse and keyboard.

Al

maxim
Posts: 1036
Joined: 13.11.2003
With us: 21 years
Location: N?rnberg, Germany

Post #8by maxim » 05.06.2004, 19:03

As selden proposed, you can use VB (or any other language - just compile an appropriate exe-file) to run Celestia scripts via the library functions for raising os commands.

Of course you could think more further and let your (VB)Code produce script code, write it to a file via an I/O command and then run the script via an OS command function. You could repeat this step as often as you want. The only constraint against this trick is, that Celestia consumes 100% of CPU usage as long as it runs. This will make it very difficult to hold a certain timeline for your 'hybrid' script, because your controller program may craaaawl from one CPU-command to the next.

This was one of the reasons why I did a feature request about this.

As far as I know such a program wasn't done yet.

maxim

Guest

Post #9by Guest » 05.06.2004, 19:53

that pretty much seals it! I am going to spen some time studying Lua and scripts and see if I can do what I need from there. If not, I will dig into C++ and see what I can do.

Can anybody shed some light on where to begin with working with celestia's code in C++ ? How complex is it?

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

Post #10by don » 05.06.2004, 20:55

Hi Al,

Looks like you're getting some great answers!

Selden's suggestion of looking into Adam Nieman's work at NESTA Futurelab with Celestia is a good one. Adam has integrated Internet Explorer, touch-screens, pre-coded scripts, and all kinds of fun things into Celestia, for a public, interactive, kiosk-type setup. Reading through that thread and talking with him might give you some insight and ideas.

As to Celestia's "complexity of C++ code", it probably depends on your knowledge and experience of OOP techniques, C++ in general, and cross-platform development libraries (OpenGL, Lua, etc.). Some find it complex and others don't.

Have fun exploring!
-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.


Return to “Scripting”