Error when using the LuaScriptingModule, suggestions?

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

Butabah
Just popping in
Just popping in
Posts: 6
Joined: Fri Aug 17, 2012 06:22

Error when using the LuaScriptingModule, suggestions?

Postby Butabah » Fri Aug 17, 2012 06:32

Hi there! I'm using freshly compiled code from the website, and am trying to execute some simple Lua.

Version 0.7.7 (Build: Jul 17 2012 Debug Microsoft Windows MSVC++ 10.0 32 bit) ----

Code: Select all

Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
Scripting module is: CEGUI::LuaScriptModule - Official Lua based scripting module for CEGUI ----


Code: Select all

(Error)   CEGUI::ScriptException in file c:\dev\cegui-0.7.7\cegui\src\scriptingmodules\luascriptmodule\ceguilua.cpp(686) : Unable to execute Lua script string: 'CEGUI.System:getSingleton()'

[string "CEGUI.System:getSingleton()"]:1: attempt to index global 'CEGUI' (a nil value)


No other errors before this.

Here is the code that is causing the error (assume OGRE has been completely initialized before this)

Code: Select all

    CEGUI::OgreRenderer& ogreRenderer = CEGUI::OgreRenderer::create();
    CEGUI::OgreImageCodec& ic = ogreRenderer.createOgreImageCodec();
    CEGUI::OgreResourceProvider& rsp  = ogreRenderer.createOgreResourceProvider();
    CEGUI::LuaScriptModule* luaScriptModule = &CEGUI::LuaScriptModule::create();

    CEGUI::System::create(ogreRenderer, &rsp, static_cast<CEGUI::XMLParser*>(0), &ic, luaScriptModule);

    luaScriptModule->executeString("CEGUI.System:getSingleton()");


Executing standard lua code, like 'print('hello, world!')' works.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Error when using the LuaScriptingModule, suggestions?

Postby CrazyEddie » Fri Aug 17, 2012 08:49

This reply was deleted for being clearly wrong. Sorry for that. I will reply again later.

CE

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Error when using the LuaScriptingModule, suggestions?

Postby CrazyEddie » Fri Aug 17, 2012 11:14

Please post the full CEGUI.log.

CE

Butabah
Just popping in
Just popping in
Posts: 6
Joined: Fri Aug 17, 2012 06:22

Re: Error when using the LuaScriptingModule, suggestions?

Postby Butabah » Fri Aug 17, 2012 16:25

Code: Select all

17/08/2012 02:30:02 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17/08/2012 02:30:02 (Std)    +                     Crazy Eddie's GUI System - Event log                    +
17/08/2012 02:30:02 (Std)    +                          (http://www.cegui.org.uk/)                         +
17/08/2012 02:30:02 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

17/08/2012 02:30:02 (Std)    CEGUI::Logger singleton created. (0061E0C0)
17/08/2012 02:30:02 (Std)    
17/08/2012 02:30:02 (Std)    ********************************************************************************
17/08/2012 02:30:02 (Std)    * Important:                                                                   *
17/08/2012 02:30:02 (Std)    *     To get support at the CEGUI forums, you must post _at least_ the section *
17/08/2012 02:30:02 (Std)    *     of this log file indicated below.  Failure to do this will result in no  *
17/08/2012 02:30:02 (Std)    *     support being given; please do not waste our time.                       *
17/08/2012 02:30:02 (Std)    ********************************************************************************
17/08/2012 02:30:02 (Std)    ********************************************************************************
17/08/2012 02:30:02 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
17/08/2012 02:30:02 (Std)    ********************************************************************************
17/08/2012 02:30:02 (Std)    ---- Version 0.7.7 (Build: Jul 17 2012 Debug Microsoft Windows MSVC++ 10.0 32 bit) ----
17/08/2012 02:30:02 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
17/08/2012 02:30:02 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
17/08/2012 02:30:02 (Std)    ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
17/08/2012 02:30:02 (Std)    ---- Scripting module is: CEGUI::LuaScriptModule - Official Lua based scripting module for CEGUI ----
17/08/2012 02:30:02 (Std)    ********************************************************************************
17/08/2012 02:30:02 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
17/08/2012 02:30:02 (Std)    ********************************************************************************
17/08/2012 02:30:02 (Std)    
17/08/2012 02:30:02 (Std)    ---- Begining CEGUI System initialisation ----
17/08/2012 02:30:02 (Std)    CEGUI::ImagesetManager singleton created (0061DFB8)
17/08/2012 02:30:02 (Std)    CEGUI::FontManager singleton created. (0061E788)
17/08/2012 02:30:02 (Std)    CEGUI::WindowFactoryManager singleton created
17/08/2012 02:30:02 (Std)    CEGUI::WindowManager singleton created (0061E3F8)
17/08/2012 02:30:02 (Std)    CEGUI::SchemeManager singleton created. (0061F558)
17/08/2012 02:30:02 (Std)    CEGUI::MouseCursor singleton created. (00618008)
17/08/2012 02:30:02 (Std)    CEGUI::GlobalEventSet singleton created. (00608BC0)
17/08/2012 02:30:02 (Std)    CEGUI::AnimationManager singleton created (0061ECC8)
17/08/2012 02:30:02 (Std)    CEGUI::WidgetLookManager singleton created. (0060D220)
17/08/2012 02:30:02 (Std)    CEGUI::WindowRendererManager singleton created (0060D260)
17/08/2012 02:30:02 (Std)    CEGUI::RenderEffectManager singleton created (00607F30)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'DefaultWindow' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'DefaultWindow' windows added. (0061F9F8)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'DragContainer' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'DragContainer' windows added. (0061FAC0)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'ScrolledContainer' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'ScrolledContainer' windows added. (00624AD0)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'ClippedContainer' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'ClippedContainer' windows added. (00624B98)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Checkbox' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Checkbox' windows added. (00624C60)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/PushButton' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/PushButton' windows added. (00626DE0)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/RadioButton' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/RadioButton' windows added. (00626EA8)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Combobox' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Combobox' windows added. (00626F70)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/ComboDropList' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/ComboDropList' windows added. (00627038)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Editbox' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Editbox' windows added. (00627100)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/FrameWindow' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/FrameWindow' windows added. (006271C8)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/ItemEntry' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/ItemEntry' windows added. (00627290)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Listbox' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Listbox' windows added. (00627358)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/ListHeader' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/ListHeader' windows added. (00627420)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/ListHeaderSegment' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/ListHeaderSegment' windows added. (006274E8)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Menubar' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Menubar' windows added. (00627688)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/PopupMenu' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/PopupMenu' windows added. (00627750)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/MenuItem' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/MenuItem' windows added. (00627818)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/MultiColumnList' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/MultiColumnList' windows added. (006278E0)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/MultiLineEditbox' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/MultiLineEditbox' windows added. (006279A8)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/ProgressBar' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/ProgressBar' windows added. (00627A70)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/ScrollablePane' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/ScrollablePane' windows added. (00627B38)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Scrollbar' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Scrollbar' windows added. (00627C00)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Slider' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Slider' windows added. (00627CC8)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Spinner' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Spinner' windows added. (00627D90)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/TabButton' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/TabButton' windows added. (00627E58)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/TabControl' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/TabControl' windows added. (00627F20)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Thumb' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Thumb' windows added. (00627FE8)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Titlebar' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Titlebar' windows added. (00628178)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Tooltip' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Tooltip' windows added. (006280B0)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/ItemListbox' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/ItemListbox' windows added. (00628240)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/GroupBox' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/GroupBox' windows added. (00628308)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'CEGUI/Tree' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'CEGUI/Tree' windows added. (006283D0)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'HorizontalLayoutContainer' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'HorizontalLayoutContainer' windows added. (00628560)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'VerticalLayoutContainer' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'VerticalLayoutContainer' windows added. (00628498)
17/08/2012 02:30:02 (Std)    Created WindowFactory for 'GridLayoutContainer' windows.
17/08/2012 02:30:02 (Std)    WindowFactory for 'GridLayoutContainer' windows added. (00628628)
17/08/2012 02:30:02 (Std)    Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
17/08/2012 02:30:02 (Std)    CEGUI::System singleton created. (0061DC40)
17/08/2012 02:30:02 (Std)    ---- CEGUI System initialisation completed ----
17/08/2012 02:30:02 (Std)    
17/08/2012 02:30:02 (Std)    ---- Creating Lua bindings ----
17/08/2012 02:30:02 (Error)   CEGUI::ScriptException in file c:\dev\cegui-0.7.7\cegui\src\scriptingmodules\luascriptmodule\ceguilua.cpp(686) : Unable to execute Lua script string: 'CEGUI.System:getSingleton()'

[string "CEGUI.System:getSingleton()"]:1: attempt to index global 'CEGUI' (a nil value)



full log.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Error when using the LuaScriptingModule, suggestions?

Postby CrazyEddie » Sat Aug 18, 2012 00:12

The log looks as if everything is correct, and the bindings were initialised. I tested similar code - that brings up a minimal CEGUI system and executes the same script string you've used here and it worked ok for me. The main differences between what you're doing and my test is that I used the Null renderer and that I run GNU/Linux and not MS Windows (though neither of these points should make a difference to the script module working or not).

I can't really explain what is going on from the information given - clearly something is amiss. What version of lua are you using? Is it the one out of the CEGUI dependency pack? If you build the CEGUI samples, does Demo8 function ok?

CE.

Butabah
Just popping in
Just popping in
Posts: 6
Joined: Fri Aug 17, 2012 06:22

Re: Error when using the LuaScriptingModule, suggestions?

Postby Butabah » Sat Aug 18, 2012 03:59

Hey CE! It's working now, it was an issue with confliction Lua libs.

I simply removed all Lua from my computer (not an easy task because Windows is fantastic with where you can place static\dyn libs, and DLLs)

Reinstalled the CEGUI Dependency's Lua and works perfectly.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 37 guests