Page 1 of 1
cotineous loop
Posted: 05.06.2004, 02:28
by Guest
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
Re: cotineous loop
Posted: 05.06.2004, 07:57
by don
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.
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!
thanks
Posted: 05.06.2004, 13:55
by Guest
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
Posted: 05.06.2004, 14:12
by selden
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
Posted: 05.06.2004, 14:24
by selden
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?
Re: thanks
Posted: 05.06.2004, 16:14
by Harry
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
LuaThe problem is that I need to lock it down and introduce some interactivity.
What kind of input devices will you use?
Harald
Posted: 05.06.2004, 18:04
by Guest
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
Posted: 05.06.2004, 19:03
by maxim
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
Posted: 05.06.2004, 19:53
by Guest
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?
Posted: 05.06.2004, 20:55
by don
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!