lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I had a look at http://www.bgchronicles.com/ and I found the 
> "Baldur's Gate Script Compiler" that contains some documentation 
> and also mentions Lua as well as TecGraf.
> 
> I find it interesting to know that Lua has been used by different game
> companies, that shows it can be put to good use in games. 
> Does anybody know any other game that uses Lua & what versions 
> are used? 

We use Lua 3.1 internally for some tools and will possibly use it in
the future as the base of our animatics system.

For our tools, we use Lua as:

a) Configuration.  Everything from paths to component definitions
   are defined on the lua side.  For instance

   Components = {
       SimpleComponent1 = {
           CLSID = "SimpleComponent1",
           Implementation = "SimpleComponent.dll",
           Defaults = {
             SomeDefault = 1,
             SomeDefault2 = 2
           }
       },

       SimpleComponent2 = {
           CLSID = "SimpleComponent2",
           Implementation = "SimpleComponent2.dll",
       },   

       ComplexComponent = {
           CLSID = "ComplexComponent",
           Aggregates = {
               "SimpleComponent1",
               "SimpleComponent2"
           }
       }
    };

    So from the C++, we can do:

    daCoCreateObject( "ComplexComponent", &complex );


b) UI resource layout.  i.e.

   AlphaPropPage = uiBoxLayout{ 
                      uiDropDownList{
                          Label = "Supported Compare Functions",
                          Data = BuildSupportedAlphaCompareTable
                      }
                   }

    And then from C++ code, we call:

    daCoCreateObject( "DALibs_Dialog", &modaldlg );
    modaldlg->CreateFromResource( "AlphaPropPage" );
    modaldlg->DoModal();

c)  We also have a tool that loads data files and visits every 
    node in some internal data structures, calling Lua code at
    every node.  It is a simple tool, but useful for collecting
    information about different models (like average triangles per
    material, etc...)


Currently, nothing we are using for Lua will ship with any of our
games, but will be used in the production of the games.

Paul