Running an empty lua script crashes the game

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Bagheera
Just popping in
Just popping in
Posts: 9
Joined: Tue Apr 03, 2007 22:03

Running an empty lua script crashes the game

Postby Bagheera » Fri Jun 29, 2007 15:26

I'm currently using CEGUI 5 and Ogre 1.4. I init CEGUI like this:

Code: Select all

   mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
   mCEGUILua = new CEGUI::LuaScriptModule();
   mGUISystem = new CEGUI::System(mGUIRenderer);
   CEGUI::System::getSingleton().setScriptingModule(mCEGUILua);
   CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Informative);
   CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"WindowsLook.scheme");
mGUISystem->getSingleton().executeScriptFile("LuaInit.lua");


Upon running this line:

Code: Select all

mGUISystem->getSingleton().executeScriptFile("LuaInit.lua");


I get this:
Exception: System::executeScriptFile - An exception was thrown during the execution of the script file.

It should be noted that LuaInit.lua is an empty file

It also of course crashes when the file is not empty, but rather filled with simple lua instructions.

Why would this happen?

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Sat Jun 30, 2007 11:52

First, I want to say that an exception is NOT a crash but it is error handling, you need to catch this (try/catch block) and then you can show an error message to the user or do whatever else.

Second, I want to say that I can't help you, I know nothing about lua sorry :P

Bagheera
Just popping in
Just popping in
Posts: 9
Joined: Tue Apr 03, 2007 22:03

Postby Bagheera » Sat Jun 30, 2007 12:49

I catch CEGUI excpetions at the highest level. Also, it is not an unhandled exception, as there is some text...


Return to “Help”

Who is online

Users browsing this forum: No registered users and 17 guests