U can only use function with edit.*** to change such things
http://freeciv.wikia.com/wiki/Lua_reference_manual <-(See those edit.functions)
There is no edit for this.
Its not working bc somethign like this wont work too:
human.gold = 99999999999
It doesnt go outside lua scope.
U would need to use edit.change_gold(human, 999999)
Closest thing I could do with that lua is just change name of next AI after human.
Code: Select all
function set_human_name()
signal.list()
for player in players_iterate() do
if player.is_human then
local extra_gold = math.floor(10 * player:gold())
edit.create_player("Dino", player.Nation_type, nil)
end
end
end
signal.connect("map_generated", "set_human_name")
player.Nation_type is some monster structure - u can only copy it from another player. In theory that script should create extra player with the same nation as you named "Dino". In practise it changes next AI name to "Dino".
U need iterate via all players to find human - players_iterate() - bc u usually are not first, even if u were lucky to be first Im not sure if u woudl have index 0.
I've created simple script to double gold for each human:
Code: Select all
function richmode()
for player in players_iterate() do
if player.is_human then
edit.change_gold(player, player:gold())
end
end
end
signal.connect("turn_started", "richmode")
I tried twith signal map_created and it didnt worked, maybe players have no gold then or even are not created yet ...
U can find some nice lua script in empires ruleset - google it.