Lua Edu Tools : content and layout...

Discuss Celestia's features, adaptations and Addons for use in educational environments
Topic author
Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 8 months
Location: Nancy, France

Lua Edu Tools : content and layout...

Post #1by Vincent » 19.11.2006, 16:35

Hi,

As you may know, the Celestia 1.5.0 prerelease should be available quite soon...
So, it would be nice to release a first version of the Lua Edu Tools as well.
Then, since we currently have 2 versions of the Lua Edu Tools, I think it's time interested users discussed about the version that should be developped in priority, and about the content and the layout of this version.

As a reminder, here are the two current suggestions :
- version 1 : ( see: http://celestiaproject.net/forum/viewtopic.php?t=10352 )
Image

- version 2 : ( see: http://celestiaproject.net/forum/viewtopic.php?t=10387 )
Image


I'm nearly done with both versions, and the Time window is now working as expected :
- The standard Time display is automatically disabled and replaced with the Lua Tools Time.
- The user's Time Zone is automatically detected. No need to set it each time Celestia is run.
- I've also added a "Set Time" button. Just select one element in the Date, Time, and Time Zone, and then, use the < > buttons to set it to the desired value...
Image

-------------------------------------------------------------------------------------
Now, please feel free to post your feedback and suggestions here...
-------------------------------------------------------------------------------------
@+
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
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 7 months
Location: United Kingdom

Post #2by Joe » 19.11.2006, 19:15

I had only tried with the first version and it is great. If I know where to get the second version I would love to use it. Version 2 seems has all the features of version 1, it is more appealing to ordinary users. I am for version 2.
Joe
8O

Sui Ota
Posts: 75
Joined: 05.10.2005
With us: 18 years 11 months
Location: Saitama, Japan

Post #3by Sui Ota » 19.11.2006, 20:22

I think both version are good, but there seems to be less flexibility of changing window size in version 2... :?
-Suι

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

Post #4by Vincent » 21.11.2006, 20:53

Joe wrote:If I know where to get the second version I would love to use it.
The CVS code now integrates all the required changes to run the current Lua edu tools. I'll put a link to the second version very soon.

Sui Ota wrote:I think both version are good, but there seems to be less flexibility of changing window size in version 2... :?

The boxes and the buttons size is now independant from the screen size. So, there should be no problem while changing the screen configuration, even while running the tools. Their position will also remain the same.

Just a shot showing the current advancement of the second version :
Image
@+
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

Sui Ota
Posts: 75
Joined: 05.10.2005
With us: 18 years 11 months
Location: Saitama, Japan

Post #5by Sui Ota » 21.11.2006, 23:49

Vincent wrote:
Sui Ota wrote:I think both version are good, but there seems to be less flexibility of changing window size in version 2... :?
The boxes and the buttons size is now independant from the screen size. So, there should be no problem while changing the screen configuration, even while running the tools. Their position will also remain the same.

OK, I feel relieved. I'm looking forward to the next version :D
-Suι

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 7 months
Location: United Kingdom

Post #6by Joe » 23.11.2006, 09:32

Vincent wrote:The CVS code now integrates all the required changes to run the current Lua edu tools. I'll put a link to the second version very soon


That is very exciting. I managed to build a Win32 executable out of the very latest CVS source, but the Lua hooks to the Lua Edu Tool seem to be disabled.
Joe

8O

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

Post #7by Vincent » 23.11.2006, 11:56

Here's a link to download the (uncompleted yet) second version :
> http://vincent.gian.club.fr/celestia/lua_tools2.zip
Just unzip and paste the 'edu_test_2' folder in your 'extras' folder.

For those who haven't already installed the Lua Tools, here are some preliminary steps :
1- Paste the 'luahookinit.lua' file directly in your Celestia root folder.
2- Add this line to your celestia.cfg file :

Code: Select all

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

Please keep in mind that only one single version of the Lua Tools must be present at a time in the 'extras' folder.

Here's a link to download the current 1.5pre CVS version (23/11/06):
> Windows : http://vincent.gian.club.fr/celestia/ce ... 1.5pre.exe
> Mac OS-X : http://nho.ohn.free.fr/celestia/CelestiaLUA.app.zip (Thanks to ElChristou and Dirkpitt)

Important : All the needed files to run a Celestia 1.5.0 version must be present on your system.
You can have some information about how to get them here : http://www.celestiaproject.net/forum/viewtopic.php?t=10234

***************************************************************************************
As soon as the official 1.5pre version is released, the Lua Tools will be simply distributed as addons,
i.e., as a folder to paste in the 'extras' folder...
***************************************************************************************
@+
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

Sui Ota
Posts: 75
Joined: 05.10.2005
With us: 18 years 11 months
Location: Saitama, Japan

Post #8by Sui Ota » 24.11.2006, 05:13

OK, I tested new Lua Tools.
Appearance is better than former version :D

Some problems:
1.
The rendering is strange out of 1970~2038.
Some messages and buttons related Lua Tools are not shown, atmosphere and the object itself is assigned to different position each other, irregular star labelings...

2.
In the Set Time mode, while selecting timezone("UTC" or "GMT+X"), the value of former selection changes with overlay < or > button, though the timezone string turned into red. It is a little hard to use. Is this intentional...?

3.
Likewise, in the Set Time mode, the vertical position of "hour, minute" and "second, timezone" is different depending on the font texture. :?
Image

4.
In XX.lua(XX is the language code), some sentences should not be divided, because the order of words depends on languages, like postmodification or premodification.
(In fact, a serious problem is not happened for now, but...)

like

Code: Select all

-- obsModeBox
   ["Goto Sun"] = "Aller au Soleil";
   ["Goto Selection"] = "Aller ?  la S?©lection";
   ["Follow Selection"] = "Suivre la S?©lection";
   ["Sync Orbit"] = "Orbite Synchrone";
   ["Track Selection"] = "Pister la S?©lection";
   Untrack = "Ne plus pister";
   Follow = "Suivre";
   Track = "Pister";
   Untrack = "Ne plus pister";
   Chase = "Chasser";
   Lock = "Bloquer";

(French terms are made by analogy and copy-and-paste, I'm not familier with French.)

5.
The value of "Distance to Earth" of Measure is different from the one of "Distance: " in the top-left of the window, on the Earth. This is caused by using 9466411000000.842 as a km-per-ly, not 9460730472580.8.

from format.lua

Code: Select all

      if km > 1000000000000 then
          value = km/9466411000000.842;
         units = _("ly");      
      elseif km >= 100000000 then
         value = km/149600000;


from src/celengine/astro.h

Code: Select all

#define KM_PER_LY     9460730472580.8
// Old incorrect value; will be required for cel:// URL compatibility
//#define KM_PER_LY     9466411842000.000
#define KM_PER_AU     149597870.7


6.
It is a bit inconvenient that speed and FPS are not displayed when the tool's function is enabled. I often check FPS, especially in case of using less power machine, so... :(

And just a question:
How do I change the order of day/month/year in this version? The variable of date_format did not worked.
-Suι

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

Post #9by Vincent » 24.11.2006, 11:50

Sui Ota wrote:1.The rendering is strange out of 1970~2038.
Some messages and buttons related Lua Tools are not shown, atmosphere and the object itself is assigned to different position each other, irregular star labelings...
This is an important issue due to the lua os.date function for which the epoch is "00:00:00 UTC - 1 Jan 1970"...
I think we'll have to use the internal Celestia time functions (as Christophe suggested to me) instead of the Lua functions...
That means that I'll have to change my whole code for the time setting box. :(

2.In the Set Time mode, while selecting timezone("UTC" or "GMT+X"), the value of former selection changes with overlay < or > button, though the timezone string turned into red. It is a little hard to use. Is this intentional...?
Fixed.

3.Likewise, in the Set Time mode, the vertical position of "hour, minute" and "second, timezone" is different depending on the font texture. :?
Fixed.

4.In XX.lua(XX is the language code), some sentences should not be divided, because the order of words depends on languages, like postmodification or premodification.
(In fact, a serious problem is not happened for now, but...)
Done.

5.The value of "Distance to Earth" of Measure is different from the one of "Distance: " in the top-left of the window, on the Earth. This is caused by using 9466411000000.842 as a km-per-ly, not 9460730472580.8.
Fixed

6.It is a bit inconvenient that speed and FPS are not displayed when the tool's function is enabled. I often check FPS, especially in case of using less power machine, so... :(
Fixed.

And just a question:
How do I change the order of day/month/year in this version? The variable of date_format did not worked.

I had disabled this option while I was working on the time setting box.
I'll make it available again when the problem with the timeBox is solved...

I've updated the lua_tools2.zip file :
http://vincent.gian.club.fr/celestia/lua_tools2.zip

And as usual, thanks a lot for this very comprehensive bug report ! :)
@+
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

Sui Ota
Posts: 75
Joined: 05.10.2005
With us: 18 years 11 months
Location: Saitama, Japan

Post #10by Sui Ota » 24.11.2006, 22:59

Yeah, some problems are solved, I comfirmed.
Remainings were so difficult problems, OK... :)
Thank you for the reflection of my report! :D
-Suι

Avatar
Joe
Posts: 162
Joined: 29.02.2004
With us: 20 years 7 months
Location: United Kingdom

Post #11by Joe » 25.11.2006, 13:09

I made a downloadable for Win32 users--including a celestia.exe built from the very latest CVS (25th Nov. at 12:00am UK time :wink: ) and Vincent's new Lua_Edu_Tools2. It is for those who wish to try Lua_Edu_Tools2. You can download it from

Latest CVS Build with Lua_Edu_Tools2

Just unzip the files to celestia directory.
Joe

8O

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

Post #12by Vincent » 25.11.2006, 16:22

Sui Ota wrote:Some problems:
1.
The rendering is strange out of 1970~2038.
Some messages and buttons related Lua Tools are not shown, atmosphere and the object itself is assigned to different position each other, irregular star labelings...
OK, I've fixed the 'os.date' function issue, without resorting to the Celestia internal time functions. :)
Actually, this is not a Lua specific limitation. Indeed, even in the Celestia standard simulation time, local time is only available/displayed from the 01/01/1970 to the 18/01/2038... Out of this period, the time format automatically switches to UTC, since no timezone data is available. So, I have simply reproduced this behaviour for the Lua Time display.

The lua_tools2.zip file has been updated :
http://vincent.gian.club.fr/celestia/lua_tools2.zip

I'll enable users to choose again between the little/middle/big endian time formats very soon...
[EDIT] Done. [/EDIT]

Joe wrote:I made a downloadable for Win32 users--including a celestia.exe built from the very latest CVS (25th Nov. at 12:00am UK time :wink: ) and Vincent's new Lua_Edu_Tools2. It is for those who wish to try Lua_Edu_Tools2. You can download it from

Latest CVS Build with Lua_Edu_Tools2

Just unzip the files to celestia directory.

Joe,

Application packages for Windows and Mac OS-X (23/11/06 CVS version) were already available.
Have a look a few posts above... :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

Avatar
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #13by selden » 26.11.2006, 22:33

Vince and/or Hank,

I'm finally getting around to trying out the Lua Tools, (v2, with Celestia built from CVS this morning)

Problem 1:

The text in the "Fatal Error" popup can't be copied and pasted. That needs to be made possible.

Problem 2:

After carefully following the instructions in lua_edu_readme.txt, Celestia generates the following "Fatal Error" popup message when it starts:
[string "luahookinit.lua"]: 3: module 'edu_test' not found:
no field package preload['edu_test']
no file '.\edu_test.lua'
no file 'C:\Program Files\Celestia\lua\edu_test.lua'
... and many more. Essentially it looks everywhere possible *except* in \extras\ and its subdirectories.

p.s.
Problem 3:

After renaming the directory Celestia\extras\edu_test_2\
to be
Celestia\lua\
Celestia generates an error popup saying it can't find celutil
It's looking in many places, but not in subdirectories of \lua\

This goes on and on with the other lua files: essentially it seems that they all need to be in the same directory, not in the subdirectories included in the Zip archive.

Presumably I'm doing something wrong, but what?

p.p.s
After putting all of the .lua scripts in Celesta\lua\, I get the Fatal Error popup
C:\Program Files\Celestia\lua\locale.lua:1:attempt to index global 'os' (a nil value)

*sigh*

p.p.p.s.

I downloaded your version of "celestia_1.5pre.exe" for Windows.

When I use the FireFox download manager's "Open" url, it generates an error popup saying "Fatal Error: error reading configuration file", not saying *which* configuration file. Presumably this is because its default directory isn't correct.

When I double click on celestia_1.5pre.exe, which is in C:\Program Files\Celestia\, it puts up the splash logo and then crashes, displaying the standard Windows "Celestia has encountered a problem" popup. The splash logo only displays the initial message "loading data files", so Celestia hasn't gotten very far.

n.b. I built my copy of Celestia including Lua v5.1 support, if that makes any difference. It shouldn't: my understanding is that v5.1 is the version that is going to be in the official prerelease. Also, I'm running Windows XP SP2 with all the latest patches and compiled Celestia using Visual Studio 2003 Academic, which is the same as the Professional version plus some student/teacher communication modules.

And a final post scriptum:
I commented out the "luahook" statement in cdlestia.cfg and my copy of Celestia is back to normal. Vincent's version still crashes.
Selden

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

Post #14by Vincent » 27.11.2006, 11:42

Selden,

I've tested the Lua Tools this morning on several PC in my school and they work perfectly both with the celestia_1.5pre.exe file that I provided and with Celestia built from CVS (27/11 7h00 UTC).

The 'edu_test_2' folder must be placed in the 'extras' folder, and there shouldn't be any 'lua' folder...

If you have more than one single folder in the 'ExtrasDirectories' definition of your celestia.cfg file, please try with only :

Code: Select all

  ExtrasDirectories  [ "extras" ]


I'll have a deeper look at the "Lua v5.1 support" question when I'm back from work...
@+
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
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #15by selden » 27.11.2006, 12:16

celestia.cfg lists only one extras directory.

I downloaded both your version of Celestia.exe and the Lua edu 2 zip file again, just in case they had been damaged.

Symptoms are unchanged :(

System description:
1GB 3.4MHz P4-550, WinXP Pro SP2
128MB GF 6600GT, ForceWare v91.47
Celestia from CVS
Selden

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

Post #16by Vincent » 27.11.2006, 16:51

Selden,

Here's what Chris wrote in a recent mail adressed to the mailing list :
I found some bugs in Lua 5.1 support and fixed them. The ScriptSystemAccessPolicy was being effectively disregarded so I corrected that. I actually was unable to run any scripts at all when I built against 5.1. Lua 5.1 has a much cleaner way to detect when a thread has completed that we had to switch to in order to work around the problem. I modified the Windows makefiles to automatically build against Lua 5.1 if the directory lua-5.1 is present in the include directory.


I'm going to try with Celestia built against Lua 5.1 myself, and I'll let you know if I get the same errors as yours... In the meanwhile, maybe you can try to rename/move the 'lua-5.1' folder from your 'inc' folder and the lua5.1.lib file from your 'lib' folder so that these files are not detected during compilation...
@+
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
selden
Developer
Posts: 10190
Joined: 04.09.2002
With us: 22 years
Location: NY, USA

Post #17by selden » 27.11.2006, 17:20

Vincent,

Unfortunately, simply removing the folder causes fatal compilation errors. I don't recall the details, though.
Selden

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

Post #18by Vincent » 27.11.2006, 17:40

With the new version of winlibs that includes the Lua 5.1 library and the lua5.1.dll, I get the following compilation error (using Microsoft Visual C++ Toolkit 2003):

celx.obj : error LNK2019: unresolved external symbol _lua_newtable referenced in
function "void __cdecl CreateClassMetatable(struct lua_State *,int)" (?CreateCl
assMetatable@@YAXPAUlua_State@@H@Z)
cel_engine.lib(scriptorbit.obj) : error LNK2001: unresolved external symbol _lua
_newtable
cel_engine.lib(scriptrotation.obj) : error LNK2001: unresolved external symbol _
lua_newtable
celx.obj : error LNK2019: unresolved external symbol _lua_open referenced in fun
ction "public: __thiscall LuaState::LuaState(void)" (??0LuaState@@QAE@XZ)
celx.obj : error LNK2019: unresolved external symbol _lua_tostring referenced in
function "bool __cdecl istype(struct lua_State *,int,int)" (?istype@@YA_NPAUlua
_State@@HH@Z)
cel_engine.lib(scriptorbit.obj) : error LNK2001: unresolved external symbol _lua
_tostring
cel_engine.lib(scriptrotation.obj) : error LNK2001: unresolved external symbol _
lua_tostring
.\Release\celestia.exe : fatal error LNK1120: 3 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual C++ Toolkit 2003\
bin\nmake.exe"' : return code '0x2'
Stop.
@+
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

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 8 months
Location: Seattle, Washington, USA

Post #19by chris » 27.11.2006, 17:47

I've found two bugs in Celestia's Lua 5.1 support. The path for the packages has a different name in Lua 5.1, and an extra call is required to load the OS library. After making these two changes, I'm able to use Vincent's edu tools. I've committed the fixes to CVS.

--Chris

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

Post #20by Vincent » 27.11.2006, 20:32

OK,

I managed to compile Celestia against Lua 5.1 after making a new CVS Checkout (No more compilation error, LUA_VER=0x050100 ) :)
And I confirm that the Lua Tools are working great.

Thanks.
@+
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


Return to “Celestia in Education”