Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] (PR#18260) Configuration files in LUA
Home

[Freeciv-Dev] (PR#18260) Configuration files in LUA

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#18260) Configuration files in LUA
From: "Jerome Plut" <Jerome.Plut@xxxxxx>
Date: Mon, 3 Jul 2006 12:46:37 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=18260 >

Hi,

here is a patch that changes the configuration file so that they use
LUA instead of the traditional ruleset syntax.

Advantages of these are:
 (a) it is a Turing-complete language, so that you can modularize and
 factorize a lot of code;
 (b) it will (let's hope) allow the end-user to write more easily some
 mods entirely in LUA, given the fact that she is granted access to
 a lot of game variables;
 (c) same as (b), but for the AI.

Inconvenients:
 (d) Obviously, this completely breaks ruleset compatibility. I've
 translated the default ruleset as an example (and all the nations!)
 in the attached file, and can provide my Perl scripts to help anyone
 who has some ruleset to translate.
 (e) (Temporary) This does not change the ruleset parser being used
 for reading savegames.
 (f) (Less easy to change...) This does not change the ruleset parser
 being used for reading tilespecs.

As a first application of (a), I've included a nice way of
automatically adding the nation incompatibilities due to semblable
flags, so that it ensures that it is an equivalence relationship; see
data/default/nations.lua.

This patch seems to work (works fine for me), but certainly you will
experience problems running it; let me know so that I can fix it.

-- 
        Jérôme Plût

Attachment: luaconf.diff.gz
Description: application/gunzip


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#18260) Configuration files in LUA, Jerome Plut <=