LUA PLUG-INS for Celestia 1.6

All Lua-tools for Celestia in one forum.
Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 8 months
Location: Nancy, France

LUA PLUG-INS for Celestia 1.6

Post #1by Vincent » 21.01.2010, 11:31

Hi,

Martin and I are proud to release a set of LUA PLUG-INS FOR CELESTIA 1.6:
> http://gvince.perso.sfr.fr/celestia/lua ... ugins2.zip

This set of plug-ins can be considered as a 'light' version of the Lua Edu Tools.

HOW TO INSTALL THE PLUG-INS ?
1- Unzip and paste the 'lua_plugins' folder in your 'extras' folder.
2- Paste the 'luahookinit.lua' file in your Celestia root folder.
3- Add this line to your celestia.cfg file :

Code: Select all

   Configuration
   {
   LuaHook "luahookinit.lua" # <-- Line to add
   ...


HOW TO USE THE PLUG-INS ?
- The set of plug-ins, the initial state of each plug-in and the key shortcuts
are easily customizable in the 'config.lua' file.
- More information about how to use and customize the plug-ins can be
found in the README.txt file.

COMPASS:
Key shortcut: [Ctrl] + [1]

Image


CELESTIAL COORDINATES:
Key shortcut: [Ctrl] + [2]

Image


KEPLERIAN PARAMETERS:
Key shortcut: [Ctrl] + [3]

Image


PICTURE FRAME:
Key shortcut: [Ctrl] + [4]

Image


HERTZSPRUNG-RUSSELL DIAGRAM:
Key shortcut: [Ctrl] + [5]

Image Image


Enjoy ! :)
Last edited by Vincent on 07.03.2010, 18:30, edited 1 time in total.
@+
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

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

Re: LUA PLUG-INS for Celestia 1.6

Post #2by Fenerit » 21.01.2010, 12:24

Thanks! 8)
Never at rest.
Massimo

Avatar
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 11 months
Location: Paris France

Re: LUA PLUG-INS for Celestia 1.6

Post #3by jogad » 21.01.2010, 17:51

Hi,

Wonderful :D

the Lua plugings bring new opportunities and are really interesting.
I especially appreciate the Keplerian parameters and the HR diagram. Very well done and reallay new.

The picture frame is very nice compared to the lua-tools with its floating window. Unfortunately it seems limited to square images.

My only problem is that I do not want to abandon my beloved lua edu tools
Would it be possible to make plugins that may be used alone or integrated with lua-tools without writing a new version each time?

Cham, Vincent, bravo :!:
Mais pourquoi ne pas inclure un lisez-moi.txt ? :wink:

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 10 months

Re: LUA PLUG-INS for Celestia 1.6

Post #4by BobHegwood » 21.01.2010, 21:49

Thanks very much for producing a LUA tool kit that I can finally use on my Vista system. :D
Have tested (and very much enjoyed) the plug-ins on my home PC. Very, very nice.

Much appreciated by the Brain-Dead here, so thanks again...

Take care, Brain-Dead

EDIT:
Just curious... Is there a way to cycle through the picture frame objects which are
associated with a single planet or moon? In other words, I can only view one PF at
a time. What am I missing here? Again, many thanks.
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 59
With us: 20 years 7 months
Location: Montreal

Re: LUA PLUG-INS for Celestia 1.6

Post #5by Cham » 22.01.2010, 02:49

BobHegwood wrote:Just curious... Is there a way to cycle through the picture frame objects which are
associated with a single planet or moon? In other words, I can only view one PF at
a time. What am I missing here? Again, many thanks.

Bob, you just need to click on the two hotspots of the window : bottom-left and bottom-right corners. It should work, IF you have several pictures in the images/object folder.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 10 months

Re: LUA PLUG-INS for Celestia 1.6

Post #6by BobHegwood » 22.01.2010, 12:14

Cham wrote:Bob, you just need to click on the two hotspots of the window : bottom-left and bottom-right corners. It should work, IF you have several pictures in the images/object folder.

Thanks very much Martin... When I click on the corners of the picture pop-ups
it will cycle through the pictures very nicely.

Absolutely beautiful functions and additions to Celestia with these new tools.
Again, many MANY thanks for these new additions to my favorite program.
Appreciate the work it must have taken you guys to add this capability. :wink:

Take care, Brain-Dead
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 10 months

Re: LUA PLUG-INS for Celestia 1.6

Post #7by BobHegwood » 24.01.2010, 15:43

Martin?

Just a quick question for you...
I have managed to add the picture box images for Io, Callisto, Ganymede, etc.
But, I have absolutely NO idea how to add the comets and asteroids (other than Itokawa)
to the picture box displays.

Can you give me a hint as to how to do this?
I would very much like to be able to add the picture box display for other asteroids and comets,
but I have no idea how the numbering scheme works for either.

Any help would be appreciated. :wink:

Thanks, Brain-Dead
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 59
With us: 20 years 7 months
Location: Montreal

Re: LUA PLUG-INS for Celestia 1.6

Post #8by Cham » 24.01.2010, 15:52

BobHegwood wrote:Just a quick question for you...
I have managed to add the picture box images for Io, Callisto, Ganymede, etc.
But, I have absolutely NO idea how to add the comets and asteroids (other than Itokawa)
to the picture box displays.

OUPS ! I made a mistake with the published pictures collection ! :oops:

I'm using a personalized version of the pictureBox module which assigns the asteroids/comets folders for all asteroids and comets, respectively. This isn't in the published pictureBox module ! :x Sorry for the troubles...

You just need to put the asteroids/comets pictures for each individual object, in a separate folder. For example, create a folder with the name "Halley" and put the pictures you want in it, with the proper name : "Halley_1.jpg", "Halley_2.jpg", etc. Of course, you'll need to add Halley to the list of objects, in the pictureBox.lua file, or by following the steps given by Vincent.

If you want to use the same pictures for ALL the comets at once (like I did), you'll need to mess around in the code itself ! I don't suggest that you do it by yourself unless you know exactly what you're doing, because it could be very messy !

The simplest solution would be to trash the asteroids/comets folders. :|
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 16 years 10 months

Re: LUA PLUG-INS for Celestia 1.6

Post #9by BobHegwood » 25.01.2010, 00:07

Cham wrote:I'm using a personalized version of the pictureBox module which assigns the asteroids/comets folders for all asteroids and comets, respectively. This isn't in the published pictureBox module ! :x Sorry for the troubles...

You just need to put the asteroids/comets pictures for each individual object, in a separate folder. For example, create a folder with the name "Halley" and put the pictures you want in it, with the proper name : "Halley_1.jpg", "Halley_2.jpg", etc. Of course, you'll need to add Halley to the list of objects, in the pictureBox.lua file, or by following the steps given by Vincent.|

Okay, I'll try that. :D
Thanks VERY much for the tips. Much appreciated, and again, Thanks very much for this add-on.
Very nice indeed. :wink:

Take care, Brain-Dead
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

maatkai
Posts: 8
Joined: 14.01.2010
With us: 14 years 7 months

Re: LUA PLUG-INS for Celestia 1.6

Post #10by maatkai » 26.01.2010, 12:25

Hello,

These plugins are great and very useful, but it's pity that they can't be compatible with the LuaEduTools.

I implement lots of addons in LuaEdu, and the Hertzprung-Russell one interests me particularly. Is there a way to add it to LuaEdu?

Cyril

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

Re: LUA PLUG-INS for Celestia 1.6

Post #11by Vincent » 27.01.2010, 18:11

maatkai wrote:I implement lots of addons in LuaEdu, and the Hertzprung-Russell one interests me particularly. Is there a way to add it to LuaEdu?
Hi Cyril,

The Hertzprung-Russell Diagram will be part of the next release of the Lua Edu Tools.
Meanwhile, the following steps will help you to add it to the current version :
    1- Unzip the 'HR_diagram.zip' package below to your 'lua_edu_tools/' dir.
    2- Add these two lines to your 'config.lua' file :
    toolset =
    {
    "timeBox",
    ...
    "distanceBox",
    "magnificationBox",
    "HRBox",
    "virtualPadBox",
    "compassBox",
    }
    enable_info = false
    enable_coordinates = false
    enable_magnification = false
    enable_HR = false
    enable_virtual_pad = false
    enable_compass = false
    2- Add the following line to your 'utils/toolBox.lua' file :
    boxheight =
    {
    timeBoxH = 98,
    ...
    distanceBoxH = 20,
    magnificationBoxH = 20,
    HRBoxH = 20,
    virtualPadBoxH = 20,
    compassBoxH = 20,
    }

That should do it :)
@+
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

maatkai
Posts: 8
Joined: 14.01.2010
With us: 14 years 7 months

Re: LUA PLUG-INS for Celestia 1.6

Post #12by maatkai » 27.01.2010, 21:38

It works like a charm!

Thank you SO much! :D

Avatar
fsgregs
Posts: 1307
Joined: 07.10.2002
With us: 21 years 11 months
Location: Manassas, VA

Re: LUA PLUG-INS for Celestia 1.6

Post #13by fsgregs » 24.02.2010, 22:59

Vincent:

Very nice HR diagram. It will be useful in my class. Thank you.

Frank

Avatar
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 11 months
Location: Paris France

Re: LUA PLUG-INS for Celestia 1.6

Post #14by jogad » 04.03.2010, 20:20

Hello,

I noticed a small bug with lua plugins.

This has already been discussed about the addon Ephemeris of Fenerit but I think it is a general problem with the lua plugins.

It is manifested by the inability to move objects in the addon with the mouse or selecting objects with the mouse in Celestia. In some rare cases it can cause Celestia to crash.
This bug (or these bugs) occurs rarely and is difficult to reproduce.

I come back to this subject :oops: because I am currently developing an addon with the lua plugins and it seems that the problems increase with each new addon. :(

I found a fairly wild method to reproduce the bug and try to locate the problem.
I use lua plugins with celestia SVN version 4936.
The settings of enable_plugin in config.lua do not matter. The bug occurs even if all parameters are set to false.

- Open Celestia in a normal window which does not occupy the whole screen.
Do not touch anything.
The Earth is selected in the middle of the screen
- Grab the right edge of the Celestia window and resize it quickly from right to left and from left to right for about ten seconds.

With my system, if I click on the the sky background, the earth remains selected. Sometimes I can select a star but in this case I can not select the Earth again with the mouse.

I found a way to minimize this effect, which works quite well on my system. I hope it doesn't make things worse on other systems.

As an example here is the change I made in pictureBox.lua

Code: Select all

----------------------------------------------
- Set up and Draw the boxes
----------------------------------------------
PictureBox = CXBox: new ()
    : init (0, 0, 0, 0)
    : clickable (true)
    : movable (false)
    : attach (screenbox, width, height, 0, 0);

pictureBox.Customdraw = function(this)
    width, height = celestia:getscreendimension();
    if newwidth ~= width or newheight ~= height then
        newwidth = width;
        newheight = height;
        pictureFrameLB, pictureFrameBB, pictureFrameRB, pictureFrameTB = getPictureBounds();
        pictureFrame:attach(screenBox, pictureFrameLB, pictureFrameBB, pictureFrameRB, pictureFrameTB)
    else
       local sel = celestia:getselection();
        if not getPictureCandidate(sel) and pictureFrame.Visible then
            pictureFrame.Visible = false;
        end
        if getPictureCandidate(sel) and display_picture and not pictureFrame.Visible then
            pictureFrame.Visible = true;
        end
    end
end

I added a line
: clickable (true)
In the definition of PictureBox
and I moved the code that detects the resizing of the Celestia's window from "pictureFrame.Customdraw" to "pictureBox.Customdraw".

I made similar changes in corodinateBox.lua, KeplerParamBox.lua and HRBox.lua

On my system the improvement is very significant. :D But that does not solve all problems. :twisted:
The problem of selection in celestia is almost solved but the problem of fixed objects persists even if there is an improvement.

I have no better use for CompassBox. So I remove it from my lua plugins.
There seems to be strange things with this plugin.
This is particularly surprising because the version in edu_lua_tools works perfectly.

But I am sure that Vincent will have a solution. :mrgreen:

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 59
With us: 20 years 7 months
Location: Montreal

Re: LUA PLUG-INS for Celestia 1.6

Post #15by Cham » 04.03.2010, 22:16

I confirm the problem, which is occuring ONLY if Celestia isn't in the full screen mode. But I strongly suspect the bug isn't in the LUA Plugins. It's a problem with Celestia itself (and may be related to OS X), since I experienced it with an official version of Celestia installed on OS X Snow Leopard, WITHOUT the LUA plug-ins installed !
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

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

Re: LUA PLUG-INS for Celestia 1.6

Post #16by Vincent » 05.03.2010, 08:40

jogad wrote:It is manifested by the inability to move objects in the addon with the mouse or selecting objects with the mouse in Celestia.
Hi Jo?l,

Thanks for reporting this bug. I can indeed reproduce it on my system.
it should be fixed by adding the following single line to the renderoverlay
function in the lua_plugins.lua file (~ line 208):

Code: Select all

        for k,v in ipairs(plugins) do
            if pcall( function() require (v) end ) then
                require(v);
                _G[v]:attach(screenBox, sx, sy, 0, 0);     -- <-- Line to add
            end
        end


Edit:
In KeplerParamBox.lua, paramBox should be also renamed into KeplerParamBox (2 occurences):

Code: Select all

KeplerParamBox = CXBox:new()

...

KeplerParamBox.Customdraw =
@+
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

Avatar
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 11 months
Location: Paris France

Re: LUA PLUG-INS for Celestia 1.6

Post #17by jogad » 05.03.2010, 16:25

Hello Vincent,

Sorry :( This is worse than before
No need of my surper-test "de la mort qui tue". The screen is frozen for the mouse as soon as Celestia is launched.

:idea: But perhaps the version available for downloading is different from your's. On my lua_plugins.lua file, the line is added line #199 instead of #208

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

Re: LUA PLUG-INS for Celestia 1.6

Post #18by Vincent » 05.03.2010, 17:51

jogad wrote: :idea: But perhaps the version available for downloading is different from your's. On my lua_plugins.lua file, the line is added line #199 instead of #208
Jo?l,

You're right, I've made quite a few changes since last release...

Please, try this revised package:
http://gvince.perso.sfr.fr/celestia/lua ... ugins2.zip
@+
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

Avatar
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 11 months
Location: Paris France

Re: LUA PLUG-INS for Celestia 1.6

Post #19by jogad » 05.03.2010, 21:40

That seem to work very well with the standard plugins :)

But now I have a big problem :(

The plugin that I am curently developping doesn't work anymore :twisted:
Instead I get this error
erreur.png

What happened?

Avatar
jogad
Posts: 458
Joined: 17.09.2008
With us: 15 years 11 months
Location: Paris France

Re: LUA PLUG-INS for Celestia 1.6

Post #20by jogad » 06.03.2010, 07:44

Hello

My problem is solved :D. I had to rename a box (same thing than KeplerParamBox).

The result is much more stable than before your change :D :D :D
Please updade your download link.

Vincent, thank you very much. Your are a magician :blue:


Return to “Lua-Tools”