lua-users home
lua-l archive

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


On 2012-09-13 8:36 AM, "Petri Häkkinen" <petrih3@gmail.com> wrote:
>
> Hi all,
>
> Some time ago I wrote about the usage of Lua in the game Legend of Grimrock. Now we are just about to release a level editor which has also been written using Lua and uses Lua as a scripting language for user made content. I thought this could be interesting to other Lua developers since the documentation we have written about the scripting interface shows some of the innards of the engine and how it is structured.
>
> The editor has a built-in Lua code editor and it has already proven to be a nice playground for people who have almost no previous programming experience.
>
> The documentation can be found at: www.grimrock.net/modding.
> Scripting Reference and Asset Definition Reference are probably most relevant.
>
> --Petri
>
>

I've been slowly working on a game engine using Lua and I agree, it makes things so simple. It's efficient enough that I can just make everything a script and/or table, which in turn makes it easy to do anything I want without hacking the engine. Maybe for this level I want to just keep the previous song playing, but in another I want to start this song from the beginning even if it's already playing, and here I want to pick one depending on game progress and player health and phase of the moon... all I need is a "play song" function and I can call it under whatever crazy condition I like. The engine doesn't need to be aware of it at all.

I suppose any "every resource is code" system has these advantages,and my levels, characters, graphics etc could just as well be Python scripts or QBASIC or C, but Lua really shines here because it's compiled at runtime and easy to write (=easy user mods, patches, debugging etc) and yet small and fast enough to actually use in a game.