lua-users home
lua-l archive

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


hello, "Kalle Wikstrand" <kallewikstrand@hotmail.com>.

On Thu, 13 Sep 2007 11:54:14 +0200
"Kalle Wikstrand" <kallewikstrand@hotmail.com> wrote:

> interested in using config files. When you say slow... how slow do
> you mean? If we are only going to read the config files at game
> startup would it still be an issue?
hm. it's a bad coding style after all. but if you reading the files
only at startup time... then just don't care about speed at all. %-)
the modern game startup time is minutes and you can't make it THAT slow
with Lua anyway. %-)

but i suggest to take a look at PiL. you'll find some code there. using
Lua parser/compiler just to get some values is a "no-no". %-)

but you can implement it in this way and rewrite latter if you'll find
it slow/buggy.

btw, don't forget to check for errors. i omited such checks. write a
simple wraper function -- something like GetConfigVar (luastate, name),
so you can change it later withoud much headache.