Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12706) Events framework
Home

[Freeciv-Dev] Re: (PR#12706) Events framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12706) Events framework
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Mon, 4 Apr 2005 18:27:42 -0700
Reply-to: bugs@xxxxxxxxxxx

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

On Mon, 4 Apr 2005, Per I. Mathisen wrote:

> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12706 >
>
> On Sun, 3 Apr 2005, Vasco Alexandre da Silva Costa wrote:
> > Here is a small Lua toy that you may find interesting. Basically it
> > allows running Lua commands via the civserver console. I also made a
> > couple of custom Freeciv functions that will be acessible from Lua.
>
> The design is amazingly simple. And no new dependencies. I am all for
> this :)
>
> Nitpicks:
> - eventshand.c|h should be eventhand.c|h
> - forgot an #include to eventshand.h in stdinhand.c
>
> We should include lua in cvs in utility/lua/, IMHO, and make it use our
> build system.
>
> What should be our battle plan for this?

I propose we do ASAP:

* Commit lua to utility/lua/, plus the configure bits to build and link it
  to freeciv.
* Commit the patch I proposed, with the fixes for your nitpicks but with
  the custom lib functions from eventshand.c removed.

Later on:

* Design and implement custom Freeciv lib for Lua, loosely based on the
  Civilization ToT event system info we got from that mod community, plus
  considering suggestions and comments from them for which actions they
  want to be able to do (there should be a dozen possible actions, tops).
* Commit that.
* Add event support. At first it could be as lame as this:

  The places where the events are triggered get to call this little C function:
  emit_event(E_HUT);

  This function executes all the Lua callbacks for that event type on the
  spot.

  On the Lua side, your code would be something like this:

  function hutCallback()
    -- do some stuff.
  end

  signalConnect(EHut, hutCallback)

TODO:
  How the heck are we going to markup Lua strings and handle I18N?
  Suggestions appreciated.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa





[Prev in Thread] Current Thread [Next in Thread]