Great info mate! Will be sure to implement some error checks.
From: Ketmar Dark <firstname.lastname@example.org>
Reply-To: Lua list <email@example.com>
Subject: Re: Using LUA for config files
Date: Thu, 13 Sep 2007 13:43:45 +0300
>hello, "Kalle Wikstrand" <firstname.lastname@example.org>.
>On Thu, 13 Sep 2007 11:54:14 +0200
>"Kalle Wikstrand" <email@example.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
>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.