Update of patch #3495 (project freeciv):
Status: Ready For Test = Done
Assigned to:None = cazfi
Open/Closed:Open = Closed
Update of patch #3495 (project freeciv):
Status: In Progress = Ready For Test
Planned Release: = 2.5.0
___
Follow-up Comment #16:
Attached patch
Follow-up Comment #15, patch #3495 (project freeciv):
This last point is actually why I think this must be implemented in ruleset
C-code. Server must be aware of the fact that city will be founded to starting
location before it assigns those locations.
I agree.
Update of patch #3495 (project freeciv):
Category:None = general
Status:None = In Progress
___
Follow-up Comment #12:
No Problem -
Follow-up Comment #13, patch #3495 (project freeciv):
Should it be inserted into tolua_game.pkg?
Yes, it should be inserted into tolua_game.pkg and api_game_find.c
___
Reply to this item at:
http://gna.org/patch/?3495
Follow-up Comment #4, patch #3495 (project freeciv):
I think the player attribute should not be changed at this point as player is
the information that is needed to create a city. A nation must not exist on
the map. What about a new lua function
player get_player(Nation_Type pnation) which
Follow-up Comment #5, patch #3495 (project freeciv):
It should even work using lua. Below an (untested) function:
[code]
function search_player_with_nation(nation_str)
for player in players_iterate() do
local plr_nation_str = player.nation:rule_name()
if (nation_str == plr_nation_str)
Follow-up Comment #6, patch #3495 (project freeciv):
According to http://freeciv.wikia.com/wiki/Lua_reference_manual#find this
would be (if it is working) the missing function:
Player find.leader (nation_name)
Similar the function:
Player find.player (player_name)
Could be
Follow-up Comment #7, patch #3495 (project freeciv):
According to http://freeciv.wikia.com/wiki/Lua_reference_manual#find this
would be (if it is working) the missing function: Player find.leader
(nation_name)
It's not working.
Original (working)
local owner = find.player(0)
Test (not working)
Follow-up Comment #8, patch #3495 (project freeciv):
Sorry about the confusion; I mean the function in comment #5 would be the
currently missing function find.leader(nation_name) implemented in lua. The
function find.player(player_name) could be implemented similar. I can't test
it at the moment
Follow-up Comment #9, patch #3495 (project freeciv):
Sorry about the confusion; I mean the function in comment #5 would be the
currently missing function find.leader(nation_name) implemented in lua. The
function find.player(player_name) could be implemented similar. I can't test
it at the moment
Follow-up Comment #10, patch #3495 (project freeciv):
Now I test the (untested) function, but... Where should I insert? Function
turn_cb(turn, year) or function city_nation_swedish()?
The function should be inserted on its own (separate function). After that you
could change your function as
Follow-up Comment #11, patch #3495 (project freeciv):
The function should be inserted on its own (separate function). After that
you could change your function as follows.
Congratulations! Working! You missed only:
[...]
if (nation_str == plr_nation_str)
*then* return player
end
[...]
without
Follow-up Comment #3, patch #3495 (project freeciv):
From server/scripting/api_server_edit.c:
void api_edit_create_city(lua_State *L, Player *pplayer, Tile *ptile,
const char *name)
Is it possible add ''Nation_Type *pnation'' at the API? If it's not possible
maybe
Follow-up Comment #2, patch #3495 (project freeciv):
I used to insert in script.lua a function.
Or in a scenario files between:
[script]
code=$
$
but it's not simply for novice. I have a scenario (Europe 350*350 - S_3) where
I generate 617 cities at the start. The problem are nations!
If I use
URL:
http://gna.org/patch/?3495
Summary: Starting with first city placed
Project: Freeciv
Submitted by: cazfi
Submitted on: Thu 09 Aug 2012 10:32:46 PM EEST
Category: None
Priority: 5 - Normal
Follow-up Comment #1, patch #3495 (project freeciv):
I used to insert in script.lua a function.
function city_nation_swedish()
local owner = find.player(0)
local Stockholm = find.tile(208,93)
create_city(owner, Stockholm, 'Stockholm')
end
function turn_cb(turn, year)
if
17 matches
Mail list logo