Entering Lua-commands directly in Celestia
Posted: 29.01.2004, 16:45
Hi,
after Marc Griffith brought up the idea to create a Lua-console to type in commands directly in Celestia, I found out that this is already possible with Celestia 1.3.2pre1 (earlier version didn't have the necessary keyboard-input for scripts).
So I have written a script which reads lines from the keyboard and executes them as Lua-scripts (or more precise as functions) when pressing Enter. You can get the script here:
http://www.h-schmidt.net/celestia/
Currently you can only type, delete (backspace) and execute the current line (Return), but this should be enough to test some Lua-commands. To see the value of something, you have to return it (the line is executed as a function, so if you type "return 1+1", the result will be 2). Variables can be used, so you can save values across different lines.
E.g.
There is no documentation for the new scripting features (like keyboard, mutliviews, etc) yet, so if you have questions, please ask here.
Harald
after Marc Griffith brought up the idea to create a Lua-console to type in commands directly in Celestia, I found out that this is already possible with Celestia 1.3.2pre1 (earlier version didn't have the necessary keyboard-input for scripts).
So I have written a script which reads lines from the keyboard and executes them as Lua-scripts (or more precise as functions) when pressing Enter. You can get the script here:
http://www.h-schmidt.net/celestia/
Currently you can only type, delete (backspace) and execute the current line (Return), but this should be enough to test some Lua-commands. To see the value of something, you have to return it (the line is executed as a function, so if you type "return 1+1", the result will be 2). Variables can be used, so you can save values across different lines.
E.g.
Code: Select all
o = celestia:getobserver()
sol = celestia:find("Sol")
o:goto(sol, 10)
There is no documentation for the new scripting features (like keyboard, mutliviews, etc) yet, so if you have questions, please ask here.
Harald