lua-users home
lua-l archive

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


> >(including my own ;).  Who'd've thought that learning Lua 
> would turn out
> >to be a marketable skill in the games industry?!  Thanks for 
> the info.
> 
>    No doubt! Out of curiosity, what are most games developers 
> using Lua for? 

I use Lua in scripts called from the main C++ code at specific
times: whenever events are triggered (someone making an action
triggers a Lua chunk, someone dying triggers a Lua chunk, etc)
and at regular time intervals to compute a character's AI. The
Lua chunks involved have a default (the default chunk can just
do nothing at all) that can be overriden for a specific entity
(a character, but also objects (when they are taken...) spells
(when they are cast....), map locations (when they are entered
by a character...), etc. This way I have a set of standard
behaviors (for example, for characters, a fighter always seeking
fights, a peasant working and fleeing when attacked, etc...) and
I still can assign a specific behavior to any important character
in the game.
The main benefit from this is that all these behaviors (this is
what actually 'makes' a game) can be stored in data files, thus
changed at will without recompiling the code, allows for more
modularity (add-ons, sequels....).

Vincent Penquerc'h

"4 GB ought to be enough for anybody."