URL:
<http://gna.org/bugs/?15644>
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: [email protected]
Open/Closed: Open
Release:
Discussion Lock: Any
Operating System: None
Planned Release:
_______________________________________________________
Details:
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.
Examples:
/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
<http://gna.org/bugs/download.php?file_id=8560>
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?15644>
_______________________________________________
Meddelandet skickades via/av Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev