[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Using LUA for config files
- From: Ketmar Dark <ketmar@...>
- Date: Thu, 13 Sep 2007 11:34:36 +0300
hello, "Kalle Wikstrand" <firstname.lastname@example.org>.
On Thu, 13 Sep 2007 10:14:39 +0200
"Kalle Wikstrand" <email@example.com> wrote:
> Is there no easy way to do this? Something like
> lua_getfield(pLuaState, Enemy, Hitpoints); would be really nice. And
> what about tables in tables?
you should construct this functions using provided API. Lua API doesn't
try to cover all cases (just like the language itself), but it gives you
enough tools to build exactly what you need.
btw, the simpliest (and the slowest?) solution may be
int hp = lua_tointeger(L, -1);
ps please, don't use this code in serious apps! %-)