lua-users home
lua-l archive

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

They (we) fire up a C program that calls a Lua script. I usually have the game engine (C) call a bootstrap.lua file as the first thing it does. This then sets up the engine/game as appropriate.

On 19 January 2011 10:38, Marc Balmer <> wrote:
> In general, when game programmers use C and Lua, to they fire up a C program
> that calls a Lua script, or do they fire up a Lua script that calls a C
> program, or are both commonly done?

I am not a game programmer, but I fire up a program written in C which
then creates a Lua state, looks in a certain directory for scripts, and
if found, executes them.  These scripts can then register various
callbacks with the main program.