Automatic celx scripts generator

All about writing scripts for Celestia in Lua and the .cel system
Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Automatic celx scripts generator

Post #1by jogad » 09.10.2010, 20:09

Hello,

It is difficult to create celx scripts. The study of the scripting language is essential for those who often write scripts or want to create complex scripts.
But if you want to occasionally create a simple script that reproduces a sequence of actions in Celestia, you spend most of your time to learn how to do or to remember the exact syntax of the commands to use.

Moving to the right place with a script is not so easy and look in the right direction is a real headache.

:arrow: I propose a script that records the actions performed in Celestia and produces the corresponding script celx.

It is of course limited to possible actions with the keyboard and the mouse (and joystick).
But some things that were difficult like managing multiple windows, or overflight around a spacecraft to explore its details or to move steadily from one point to another becomes very easy.

You can also add text directly to display in the script.

For simplicity I will call "program" the script that creates a celx script and "script" the script produced by the program (which is actually also a celx script)


Knowledge required to use the program

- You need to know how to run a script
- You must know how to manipulate text files and save them on your computer.

You do not need to know scripting but I bet you will learn anyway, looking at the produced scripts and trying to improve them. :mrgreen:


Installation:

Celxmaker only works with versions 6.1 and higher of Celestia. Earlier versions are not supported.
If you do not have this version you can download it here:
http://cid-0284542f7a16db1f.office.live ... ld5043.exe
(Right click and save target as)

Celxmaker.celx is the program that produces a celx script. It writes the script directly in the Celestia "scripts" directory.
No problem with Windows XP but Vista and Windows 7 do not like it.
:!: To make the program to work as expected, Celestia should not be installed in a subdirectory of "c:\program files" or "c:\program files (x86)".
I advise you for example to install Celestia in "c:\celestia"

Uncompress Celxmaker.zip in the directory "scripts" of Celestia.

To view and edit the script you will need a text editor. If your language is not English, the text editor should be able to handle UTF-8 encoding.


Usage

- Run the script celxmaker.celx from the menu "File-> scripts
- A celestia warning message may appear. You can disable it in the file celestia.cfg
- A message appears on the lower left. Wait until it is no longer displayed.
- Start using Celestia and the script will be built progressively.
- Shift Type Q to stop recording.

That's all! :D

If you set a text editor (edit celxmaker.celx line #6), the script appears in the script editor. You can edit and save it with a new name.

jogad wrote:That's all! :D

Yes but to take full advantage of Celxmaker possibilites, I suggest you read the "celxmaker-readme.txt" file.
Les francophones pourront trouver plus facile de lire le fichier "celxmaker-lisezmoi.txt".
:mrgreen:
Last edited by jogad on 04.03.2011, 11:07, edited 5 times in total.

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

Re: Automatic recording of celx scripts

Post #2by Fenerit » 14.10.2010, 02:09

Thanks, Jo?l.
Never at rest.
Massimo

MiR
Posts: 247
Joined: 01.02.2010
With us: 14 years 3 months
Location: Germany

Re: Automatic recording of celx scripts

Post #3by MiR » 14.10.2010, 12:14

une excellente id?e et un bon, un tr?s bon travail, bravo.
Merci beaucoup

Michael
Last edited by MiR on 15.10.2010, 00:50, edited 1 time in total.

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Re: Automatic recording of celx scripts

Post #4by jogad » 14.10.2010, 20:57

Hello,

Massimo, Michael, you are very welcome :D

But :oops:
I have found some bugs :evil: especially in the multiview management.

I have no much time but I'll have a look at this as soon as possible.
Stay tuned! :mrgreen:

Of course a feedback is good for me.
At this time, the program holds a majority of Celestia's features, but I have probably missed some of them.

Don't hesitate do make suggestions. If something does't work as expected, I accept complaints.
The goal of this script is to make a script that support almost what is possible to do with only Celestia. If something seem to be impossible, there is maybe a solution. :idea:

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

Re: Automatic recording of celx scripts

Post #5by Fenerit » 14.10.2010, 21:55

My scripting approach is very minimal, so I do not know where there are bugs (unless I find them).
Never at rest.
Massimo

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Re: Automatic recording of celx scripts

Post #6by jogad » 16.10.2010, 19:00

Hello,

I've just posted an update.

Here are the modifications:

:arrow: The management of the multiview seems now correct. I hope I have not added too much new bugs.

:arrow: I had forgotten to take into account the alternative surfaces. Done!

Few improvements are added: 8)

:arrow: The procedure flyto() has been improved to provide a better orbiting movement around a reference object.
To better differentiate the two variants of this procedure, the script refers to two procedures:
- stepto() which allows a direct step from one point to another
- orbitto() which travels from one point to another by a portion of orbit curve.

:arrow: It was previously impossible to consider the reference marks (planetographic grid, display of various axes and vectors) because there is no instruction to detect their status in Celestia. I just bypassed the problem to use them.

:arrow: You can now add comments directly in the created script.

:arrow: There is a mode which does not automatically records movements. This allows for example to use the "videogame mode" to perform a simple move and then jump directly to that location. Or make a jump that puts you directly in the proper orientation.

:arrow: A history log was added. You can return to a previously visited location in the script.

I think the ability to insert text directly into the script was good.
But putting the text to the right place on the screen required to correct the script. It's not very difficult but finding the right setting for the command celestia:print() is time and patience consuming.
:arrow: It is now possible to place the text directly to the right place while recording the script. Text may have multiple lines.

:arrow: Finally the produced script code is a little shorter in order to be more readable and allow for easier modifications.
:mrgreen:

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

Re: Automatic recording of celx scripts

Post #7by Fenerit » 17.10.2010, 23:37

Yup! 8)
Never at rest.
Massimo

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Re: Automatic recording of celx scripts

Post #8by jogad » 24.12.2010, 08:16

Minor update v1_3

- Bug fix: I thought it was a good idea to type the text in the select window of Celestia but it was sometimes a cause of problems.
There is now a new way to enter the text to be printed in the script.

Two little improvements:
- Celxmaker can handle the color of the text to be displayed on the screen
predefined colors are white, yellow, orange, red, magenta, blue, cyan, green and black.

- You can merge the variation of the field of vue (FOV) in the functions that perform a smooth transition from a point to another.
This is not automatic yet, and you have to tweak the produced script by hand.

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Re: Automatic recording of celx scripts

Post #9by jogad » 09.01.2011, 11:40

New version

:arrow: The most important change is the ability to build interactively b-spline curves to have a smooth trajectory between several path points. This improvement is an idea of Massimo. You can see an example of what this feature does in the "post your videos" post of the "celestia users" forum. :wink:

:arrow: It was difficult to get an accurate position with respect to small objects that were part of a larger model. In addition to the standard travel forward and backward, I've added the ability to move laterally and vertically.
This is a cool feature and very useful even if you don't have to make a script.

:arrow: And lastly, no need to tweak anymore the speed whith the computer dependant variable framerate. This is now fully automatic.

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

Re: Automatic recording of celx scripts

Post #10by Fenerit » 09.01.2011, 13:53

Ehil?????... :D Star battle is near. Mercy, Jo?l.
Never at rest.
Massimo

MiR
Posts: 247
Joined: 01.02.2010
With us: 14 years 3 months
Location: Germany

Re: Automatic recording of celx scripts

Post #11by MiR » 11.01.2011, 06:02

Hi Jo?l,

Your celxmaker automatic script generator is even a brilliant achievement. Actually a little sensation! :o
A fantastic enhancement like Vincent's Lua-Edu-Tools, Fridger's Texture Tools or the new (upcoming) star renderings. :D

Now we should think about a Celestia presentation clip, a little movie about the program features or something.

Good job done here

Michael

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Re: Automatic recording of celx scripts

Post #12by jogad » 11.01.2011, 16:34

Hello,

Massimo, Michael, thank you very much, guys :D
Although Michael's compliments are a bit exaggerated, your support is very precious :D

@ Massimo who said "Mercy Jo?l", I will be lenient: Graci?, Massimo :lol:

:oops: I think it is the worse joke in this forum with words that sound similarly but have another meaning in different languages.
English "mercy" <---> French "merci"
French "graci?" <---> Italiano "grazie"
Do not beat me! :oops:

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 4 months
Location: Nancy, France

Re: Automatic recording of celx scripts

Post #13by Vincent » 11.01.2011, 17:40

Hi Jo?l,

I too think that your celx maker is a great tool.
Thanks to you, nobody can complain anymore about celx scripting being too difficult... :wink:
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

MiR
Posts: 247
Joined: 01.02.2010
With us: 14 years 3 months
Location: Germany

Re: Automatic recording of celx scripts

Post #14by MiR » 11.01.2011, 21:01

jogad wrote: Although Michael's compliments are a bit exaggerated...
Ah oui, ils sont fous, ces allemands... :wink:

Michael :)

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

Re: Automatic recording of celx scripts

Post #15by Fenerit » 11.01.2011, 22:39

jogad wrote:Hello,

Massimo, Michael, thank you very much, guys :D
Although Michael's compliments are a bit exaggerated, your support is very precious :D

@ Massimo who said "Mercy Jo?l", I will be lenient: Graci?, Massimo :lol:

:oops: I think it is the worse joke in this forum with words that sound similarly but have another meaning in different languages.
English "mercy" <---> French "merci"
French "graci?" <---> Italiano "grazie"
Do not beat me! :oops:

:oops: Sorry Jo?l for the "y" instead of "i" :D BTW, "merci" <---> "grazie" [thanks] "graci?" <---> "grazia" [grace, clemency, goodwill] these words doesn't have plurals, respectively. :mrgreen:
Never at rest.
Massimo

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Re: Automatic recording of celx scripts

Post #16by jogad » 12.01.2011, 07:03

Hi,

MiR wrote:Ah oui, ils sont fous, ces allemands... :wink:
...et parigoths t?tes de veaux

Fenerit wrote: "graci?" <---> "grazia" [grace, clemency, goodwill]
in fact "graci?" is from verb "gracier" that means to reprieve. "Graci?" ? piuttosto "graziato". This makes a little more sense to my poor joke.

This shows how wrong I was trying to be humorous. :oops:
It is always difficult for me to know what my readers understand...
We could easily end up talking about ice cream. :wink:

MiR
Posts: 247
Joined: 01.02.2010
With us: 14 years 3 months
Location: Germany

Re: Automatic recording of celx scripts

Post #17by MiR » 12.01.2011, 07:46

MiR wrote:Ah oui, ils sont fous, ces allemands... :wink:

To avoid misunderstandings; I just quoted a famous Gaul, called Ob?lix. The european answer to Superman :wink:

jogad wrote:...et parigoths t?tes de veaux
Les parisiennes...?? Oh, now I understand why I enjoy myself so much in Paris... I'm one :D

jogad wrote:It is always difficult for me to know what my readers understand...
yes, I agree. I feel the same. But we must keep on trying :!: :)

Michael

Avatar
Topic author
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 7 months
Location: Paris France

Re: Automatic recording of celx scripts

Post #18by jogad » 12.01.2011, 20:23

MiR wrote:Ah oui, ils sont fous, ces allemands... :wink:
jogad wrote:...et parigoths t?tes de veaux
Les parisiennes...?? Oh, now I understand why I enjoy myself so much in Paris... I'm one :D
Oh! :roll:

If there is someone crazy here, that's me.
I knew that only French people (and yet not everybody) could understand but I still could not resist. :oops:
And now I owe you an explanation. :P

This is a joke about the generalization of characters to a group of people like "germans are.. parisians are.." and I have mixed two in one.

Parigot (no "h" after "t") is how country people in France call the Parisians to make fun of them.
And "Parigots t?tes de veaux" (plural) is one of the most popular expression.
tetedeveau.jpg
Parigot "calf's head" is not very nice for the Parisians. :(
But personally I live very well with this. :mrgreen:

Now because of the Germans and Obelix, I have replaced the "gots" of parigots by "goths" (same pronunciation: "go". In French you can add a considerable number of letters that do not sound). Goths are Germanic tribes in the time of Asterix and Obelix.
The parigoths would therefore be the wild Germanic tribes living around Paris. :lol:

Last advice for those who want to visit Paris. This is not the first thing to say if you want to have friends in Paris. :wink:

MiR
Posts: 247
Joined: 01.02.2010
With us: 14 years 3 months
Location: Germany

Re: Automatic recording of celx scripts

Post #19by MiR » 13.01.2011, 09:36

Hi Jo?l,

You see; even "bad" words sounds good for german ears in your language. :)

...But, wait a minute... I know this guy from somewhere...

Hm, where did I've seen this stupid-tired looking face before...? :?: :roll:

Oh, I know now... That's the guy I see every morning in my mirror - only the toothbrush is missing.

Michael :wink:

Dave M
Posts: 9
Joined: 24.02.2011
With us: 13 years 2 months

Re: Automatic recording of celx scripts

Post #20by Dave M » 03.03.2011, 22:00

I've downloaded this script generator and it works perfectly except for it crashes Celestia any time I try to modify the script file. I've been able to create a perfectly smooth path the way I want it, the only problem is the movement is much faster than I want it. The readme says to put speed = X before the dotravel() instruction but I'm not sure if I have to include any symbols with the text like { or "" around the number values....or what number value would be a slow speed. I tried just putting speed = 1 dotravel() and it just crashes Celestia everytime. Can anyone help me slow down this smooth path script ?

Thanks


Return to “Scripting”