Page 1 of 1

Running an empty lua script crashes the game

Posted: Fri Jun 29, 2007 15:26
by Bagheera
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?

Posted: Sat Jun 30, 2007 11:52
by Pompei2
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

Posted: Sat Jun 30, 2007 12:49
by Bagheera
I catch CEGUI excpetions at the highest level. Also, it is not an unhandled exception, as there is some text...