inferno
unread,Sep 2, 2008, 6:59:24 PM9/2/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Falling Sand Games Development
The basic steps:
1. Set up Lua for your compiler (I suggest Dev-C++ because it is very
easy to get it via devpak).
2. Set up an init function. lua_State *L = lua_open(); and
luaL_openlibs(L);, followed by lua_register(L,int func(lua_State *L));
to connect Lua functions to C functions. Then use
luaL_dofile("filename"); to run the default config file.
More advanced management:
Always (ALWAYS) use lua_checkstack(L,values) before manipulating Lua
at all. Also, I suggest that, at the end of each game loop, use
lua_pop(L,values) with a lua_checkstack() to make sure you have Lua
stackspace. Example:
if (lua_checkstack(L,10) == 0)
lua_pop(L,10);
More to come.