Summary: Add server command to run freeciv script
                 Project: Freeciv
            Submitted by: None
            Submitted on: torsdag 2010-03-18 den 15:48 CET
                Category: general
                Severity: 1 - Wish
                Priority: 5 - Normal
                  Status: None
             Assigned to: None
        Originator Email: ulrik.sverd...@gmail.com
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None
         Planned Release: 



This is a wishlist/idea bug.

Add a server command that interprets a string of lua script directly in the
current game. (This requires hack access since you may for example give
victory immediately or so.)

Proposed command:

/lua <script>

The string given is directly interpreted. A single line of lua script may be
setting a variable or even defining a function. Defined variables or
functions are persistent. As normal, if you define a function of the same
name as a previous function (or callback) you override that function.


/lua print(find.player(1).name)

/lua create_base(find.tile(40,46), "Ruins", nil)

/lua default_hut_enter_callback = function(unit) return not
unleash_barbarians(unit.tile) end

This script access may make it drastically easier for tasks like longturn's
inserting of players: It can be mostly implemented as a script function in
the ruleset and activated via a '/lua createplayer()'  command.

Is it feasible? Of course no one is encouraged to major programming during a
game, but it might be useful like the longturn example I gave, as well as for
editing or experimenting.


File Attachments:

Date: torsdag 2010-03-18 den 15:48 CET  Name: lua_command.diff  Size: 3 kB  
By: None
Proof of concept implementation


Reply to this item at:


  Meddelandet skickades via/av Gna!

Freeciv-dev mailing list

Reply via email to