Script generator

All about writing scripts for Celestia in Lua and the .cel system
Topic author
surket
Posts: 15
Joined: 25.01.2011
With us: 13 years 9 months

Script generator

Post #1by surket » 04.02.2011, 22:07

Is there a program that can convert cel://.... links to .cel files?

Thanks,

Ben

Avatar
Marco Klunder
Posts: 181
Joined: 20.02.2008
Age: 62
With us: 16 years 8 months
Location: The Netherlands

Re: Script generator

Post #2by Marco Klunder » 05.02.2011, 11:32

Hello surket,

I don't fully understand your question about a "program" to convert CEL-links to .cel files (scripts), but probably the next will help you:

Within Celestia, you can use the [Ctrl] + [C] key combination, to save the current (active) URL.
Next, you can go tho a text editor, like Notepad++ and paste the URL within the text file by usinge the [Ctrl] + [V] key combination or the mouse paste functionality. This way, the CEL-URL is placed within a file.
To use the URL within a .cel script file, you will have to program a CEL script that uses the URL. This is documented at: http://en.wikibooks.org/wiki/Celestia/Celx_Scripting/CELX_Lua_Methods/CEL_command_seturl

It is also possible to use URL-links within a .CELX script file.
For this, you need some celx programming experience and you need Celestia v1.6.1, which is not general available yet.
The Celestia development team is however quite busy at the moment, to release this new Celestia release quite soon.
Using celx methods it is even possible to automatically obtain an URL link, without using the above mentioned key combinations.
Probably this also meets your question about a "program" to convert CEL-links to .cel files.
To obtain a CEL-link, you can use the celestia:geturl() method, documented at: http://en.wikibooks.org/wiki/Celestia/Celx_Scripting/CELX_Lua_Methods/Celx_celestia#geturl.
To set een URL within a .celx-file you can use the celestia:seturl() method, documented at: http://en.wikibooks.org/wiki/Celestia/Celx_Scripting/CELX_Lua_Methods/Celx_celestia#seturl.

Hopefully this will help you further.

Marco
Marco Klunder
email: marco.klunder@xs4all.nl
Windows10 PD 3.0 GHz, 2 GB of RAM, Nvidia GeForce 6700 XL
Celestia161 / SVN + Lua Edu Tools v1.2 Beta9, Celestia160-ED and Celestia1621

Topic author
surket
Posts: 15
Joined: 25.01.2011
With us: 13 years 9 months

Re: Script generator

Post #3by surket » 05.02.2011, 12:33

Thank you for your detailed reply, Marco. One of the wonderful things about Celestia forums is the presence of so many helpful members and moderators.

I didn't know about the use of URLs within .cel files. Thanks you for teaching me that.

My original question about converting cel-URLs to normal script commands was prompted by the fact that it is much harder to understand the details contained within the URL. If you want to tweak the parameters for a slightly different "snapshot" then the script commands are so much easier. What I mean by "program" is simply an interpreter/parser that could go through the URL string and generate a sequence of cel or celx commands that would do the same thing.

I am very new to Celestia and have been using it for a couple of weeks. I am amazed by what it can do and its ease of use and speed. I would love to see the following features in future versions:

- to issue single commands (e.g. setting FOV) directly (and not via a script file).

- to run a script by stepping through its commands. At the moment we can only run the whole file or pause it at a random point. This would be great for studying other people's script files and also for debugging/fine tuning your won script.

Many thanks again for your help.

Ben

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Re: Script generator

Post #4by Fenerit » 05.02.2011, 13:54

surket wrote:My original question about converting cel-URLs to normal script commands was prompted by the fact that it is much harder to understand the details contained within the URL. If you want to tweak the parameters for a slightly different "snapshot" then the script commands are so much easier. What I mean by "program" is simply an interpreter/parser that could go through the URL string and generate a sequence of cel or celx commands that would do the same thing.

Hi! Maybe can be a bit out of topic, but as for a "script generator" you must consider to take a look here:
http://www.shatters.net/forum/viewtopic.php?f=9&t=16165
Jogad has developed an automatic script makers of scripts. Your actions in Celestia will be recorded into another script, ready to repeats you actions.

surket wrote:I am very new to Celestia and have been using it for a couple of weeks. I am amazed by what it can do and its ease of use and speed. I would love to see the following features in future versions:

- to issue single commands (e.g. setting FOV) directly (and not via a script file).

For a toolkit integrated with Celestia which has the FOV command as a slide on screen, take a look here:
http://www.shatters.net/forum/viewtopic.php?f=11&t=13162
Notice that is a long thread; the last version of the tools is at the first link (for 1.6.1 SVN, not for the "official"; however this version is close to be ready as "offcial"), then the remains is the story of its develop. I suggest to read it all, for its exaustiveness.

EDIT LATER:
Sorry, there are also the versions for the "official" one. Now , I do not recall well, but it should be all the beta versions prior 8.
Never at rest.
Massimo

Avatar
Marco Klunder
Posts: 181
Joined: 20.02.2008
Age: 62
With us: 16 years 8 months
Location: The Netherlands

Re: Script generator

Post #5by Marco Klunder » 05.02.2011, 16:27

Hello Ben,

surket wrote:My original question about converting cel-URLs to normal script commands was prompted by the fact that it is much harder to understand the details contained within the URL. If you want to tweak the parameters for a slightly different "snapshot" then the script commands are so much easier. What I mean by "program" is simply an interpreter/parser that could go through the URL string and generate a sequence of cel or celx commands that would do the same thing.

Now I understand what you mean by converting program :!:
As far as I know, there is not really such a kind of "disassembling" tool yet.
You indeed need to know what each position in the URL means en then you can convert it in CEL command or CELX methods automatically.

Well, me myself do not exactly know the decoding of all individual URL positions, but the knowledge reaches about to 90% ...
I have decoded once before an URL for Frank Gregorio, which is documented on top of the second page of the following thread: http://www.shatters.net/forum/viewtopic.php?f=9&t=15718

By comparing the script and and the URL, you may learn some meanings of positions by yourself :wink:
The script at least documents ALL celx methods for a CELX script file, that are involved with the URL parameters.
When you want to adjust specific parameters after a celestia:seturl() method with a previously saved URL, you can probably use this as an example.

Unfortunately, I can not help you with your wish to implement command lines within Celestia, that is something for the development team.

As Fenerit also mentions, The LUA_EDU_TOOLS are also a very good alternative.
Vincent wrote:Please note that v1.2beta8 requires Celestia 1.6.1.
A pre-compiled Windows executable (revision 4996) is available here:
http://gvince.perso.sfr.fr/celestia/dev ... 61_SVN.zip
The LUA_EDU_TOOLS v1.2 Beta 9 can also be downloaded from http://gvince.perso.sfr.fr/celestia/lua/

Marco
Marco Klunder
email: marco.klunder@xs4all.nl
Windows10 PD 3.0 GHz, 2 GB of RAM, Nvidia GeForce 6700 XL
Celestia161 / SVN + Lua Edu Tools v1.2 Beta9, Celestia160-ED and Celestia1621


Return to “Scripting”