[Freeciv-Dev] [patch #1574] add a player to a running game

2013-02-01 Thread Helen
Follow-up Comment #20, patch #1574 (project freeciv):

Yes; At the moment I get the list of tried tiles and from time to time the
message 'unit / city to close'. Perhaps the reason why another try is needed
should also be printed for the other tiles.

Should the number of tries limited to some maximal value? Late in the game
cities could be nearly everythere.
http://dsfasdfdsf.com


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-25 Thread Matthias Pfafferodt

Update of patch #1574 (project freeciv):

  Status:  Ready For Test => Done   
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-18 Thread Matthias Pfafferodt

Update of patch #1574 (project freeciv):

  Status: In Progress => Ready For Test 


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-17 Thread Matthias Pfafferodt

Follow-up Comment #18, patch #1574 (project freeciv):

> What kind of hint do you mean for debugging? A simple message when a "bad
terrain" tile is tried?

Yes; At the moment I get the list of tried tiles and from time to time the
message 'unit / city to close'. Perhaps the reason why another try is needed
should also be printed for the other tiles.

Should the number of tries limited to some maximal value? Late in the game
cities could be nearly everythere.

___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-17 Thread Ulrik Sverdrup

Follow-up Comment #17, patch #1574 (project freeciv):

What kind of hint do you mean for debugging? A simple message when a "bad
terrain" tile is tried?

___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-17 Thread Matthias Pfafferodt

Follow-up Comment #16, patch #1574 (project freeciv):

updated patch; changes:

* do not return the player at all (see patch #1616)

comments to the newcomers.sav file (file #8974):

* the new player has only basic techs
* there is no check if the game was started; in pregame (!game_was_started())
the lua newcomer command will result in an error
* for debugging a hint 'bad terrain' would help

(file #8999)
___

Additional Item Attachment:

File name: 20100417-05-trunk-add-a-player-to-a-running-game.patch Size:16 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-14 Thread Ulrik Sverdrup

Follow-up Comment #15, patch #1574 (project freeciv):

This version of newcomers.sav works anyway. This version tries to create
settlers and attack units to match the currently alive nations.. something
similar to the newcomers code.

(file #8974)
___

Additional Item Attachment:

File name: newcomers.sav  Size:8 KB


___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-14 Thread Ulrik Sverdrup

Follow-up Comment #14, patch #1574 (project freeciv):

create_player returns NULL, because the player-creating commands (newcomer
and pregame) only take struct player *, not struct player ** arguments that
are needed to be able to "write the pointer back" to the caller.

___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-14 Thread Matthias Pfafferodt

Follow-up Comment #13, patch #1574 (project freeciv):

> I have not had success in applying the latest patch to try it :-(

I added the current version of the patch. The order of applying the patches
is:

* patch #1613: cleanup stdinhand.c:handle_stdin_input()
* patch #1615: cleanup player name check
* (this patch)
* patch #1616: add create_player lua function

patch #1616 seems to work but I'm not sure if it is correct as trying to add
a new player results in an error using the newcomer.sav file

(file #8970)
___

Additional Item Attachment:

File name: 20100414-05-trunk-add-a-player-to-a-running-game.patch Size:16 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-14 Thread Ulrik Sverdrup

Follow-up Comment #12, patch #1574 (project freeciv):

Attaching a later version of the newcomers scenario file. This version uses
some new functions, just to check that there are no tiles or units close
where we put the newcomer.

I have other patches for create_unit_full and some other things needed for
water players. And we must add some accessor to check if a player has techs
as well, so we can give techs like they are given in the original newcomer
function.

I have not had success in applying the latest patch to try it :-(

(file #8963)
___

Additional Item Attachment:

File name: newcomers.sav  Size:6 KB


___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-12 Thread Ulrik Sverdrup

Follow-up Comment #11, patch #1574 (project freeciv):

The script api can use nations as object, so the argument can be 
(Nation_Type *). That allows nil as empty value.

In the api you find nations with 

n = find.nation_type("Greek")

so a typical use would be (when non-nil)

player = create_player("Rufus", find.nation_type("Greek"))

___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-12 Thread Matthias Pfafferodt

Follow-up Comment #10, patch #1574 (project freeciv):

I think the interface could be

create_player(, )

with both arguments as string. Is it possible to set  to nil to
get a NULL pointer in freeciv? This way it would be possible to define a
nation but also a random nation can be set.

___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-11 Thread Ulrik Sverdrup

Follow-up Comment #9, patch #1574 (project freeciv):

I wonder if it should be possible to choose the nation for the player to be
created. It would make sense for scenario scripts. nil/NULL would be "random
nation" (that part works very well by the way, seems to pick nations of the
same category as the existing nations for example).

___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-11 Thread Matthias Pfafferodt

Update of patch #1574 (project freeciv):

  Depends on: => patch #1613


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-11 Thread Matthias Pfafferodt

Update of patch #1574 (project freeciv):

  Depends on: => patch #1615


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-11 Thread Matthias Pfafferodt

Follow-up Comment #8, patch #1574 (project freeciv):

reworked patch: add a player to a running game

* clear player knowledge (see player_map_free() and server_remove_player())

(file #8912)
___

Additional Item Attachment:

File name: 20100411-05-trunk-add-a-player-to-a-running-game.patch Size:16 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-10 Thread Ulrik Sverdrup

Follow-up Comment #7, patch #1574 (project freeciv):

Here is how to add a function to the API. It's called 'create_player' in the
API (rhymes well with create_unit, create_base, etc).

All is needs is that the wrapper function api_actions_create_player in
server/scripting/api_actions.h can find & call a function. In this diff, it
needs a function called 'create_newcomer_player' from plrhand.h (?) that will
return the player just created if successful, else return NULL. (The API's
Player is the same as struct player)

(file #8899)
___

Additional Item Attachment:

File name: newcomer_api.diff  Size:1 KB


___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-10 Thread Matthias Pfafferodt

Follow-up Comment #6, patch #1574 (project freeciv):

new version of the patch (code cleanup)

> Another option is to not make a /create command (while game is running),
but just make it a Lua script action, we make create_player(..) that calls
the player creation code you have written. That way, there is no way to
create "empty" players by default..

I think this is the best way to go. Changing the patch, I had to create two
functions - one for pregame and one for newcomers. Furthermore, this will
prevent empty player and also this is only usefull in connection to the lua
code.

What do you need to call C code from lua? A function name?

(file #8898)
___

Additional Item Attachment:

File name: 20100408-02-trunk-add-a-player-to-a-running-game.patch Size:13 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-08 Thread Ulrik Sverdrup

Follow-up Comment #5, patch #1574 (project freeciv):

Yes, it seems to work very well with this version.

I can fix a couple of issues in the scenario, but it's just for
demonstration/simple testing purposes. Now I'm working on making more stuff
accessible -- right now we can't even check (efficiently) if there is a city
on the tile we want to use or not. I'm soon ready to post some patches for
lots of new Lua API stuff.

Now we have some design issues. A /create command that creates a player
without units is not so useful. How do we do to make this function/command
useful by default?

One option would be to make a 'created_player' script event. Instead of using
a /lua newcomer(...) etc function, the ruleset can simply react to the
'created_player' event and do the set-up there. The default ruleset can give
the player just the default startunits.

Another option is to not make a /create command (while game is running), but
just make it a Lua script action, we make create_player(..) that calls the
player creation code you have written. That way, there is no way to create
"empty" players by default..

___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-07 Thread Matthias Pfafferodt

Follow-up Comment #4, patch #1574 (project freeciv):

updated patch; the players knowledge about the map is cleared; no errors
anymore and it is working!

about the lua code:

* no gold (additional functions needed as you said in patch #1494)
* the newcomer() function can be called multiple times ;-)

(file #8855)
___

Additional Item Attachment:

File name: 20100405-02-trunk-add-a-player-to-a-running-game.diff Size:16 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-07 Thread Ulrik Sverdrup

Follow-up Comment #3, patch #1574 (project freeciv):

Nice, the code looks pretty simple actually.

I find the same map inconsistency when "reviving" a player (creating a new
player in a dead player's slot). Looking at the map editor, it seems the
server thinks the player can see the whole map, while the client sees only
tiles around the units. So borders show up from all over the map, but
middle-clicking in a dark area crashes the client. The original code (see my
C port) has some code to clear the revived player's map. We probably need to
do this.

Also, new players are created with AI mode ON before the game started, they
can probably be created as AI players if the game is running as well.

I'm attaching a scenario that has a lua function the most basic newcomer
initialization possible. Use like this:

(in running game)

  /create NewPlayer
  /lua newcomer("NewPlayer")

'newcomer' will find a random map spot and create basic starting units.

(file #8851)
___

Additional Item Attachment:

File name: newcomers.sav  Size:5 KB


___

Reply to this item at:

  

___
  Meddelandet skickades via/av Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-02 Thread Matthias Pfafferodt

Follow-up Comment #2, patch #1574 (project freeciv):

Found the first bug. The no player has no knowledge about the map. So the
unit placed by the editor results in error messages like:


1: build_tile_data() tile (40,32) has no terrain!


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-04-02 Thread Matthias Pfafferodt

Update of patch #1574 (project freeciv):

  Status:None => In Progress
 Assigned to:None => syntron

___

Follow-up Comment #1:

updated version of the patch; changes:

* no modification of score.(c|h)
* reset diplomatic state

How to test the patch:

1. create a game with 30 aiplayers
2. start the game
3. kill an AI player
4. create a new player
   - new1 + new2 will use the 2 remaining slots (barbarians)
   - new3 will replace the dead AI player
5. switch to edit mode and create a unit (settler) for new3
6. set new3 to AI mode (/aitoggle new3)
7. a new player is in the game

step 5 & 6 should be done by lua

I did some tests but I think there are still bugs hidden in the new code ...

(file #8772)
___

Additional Item Attachment:

File name: 20100402-trunk-add-a-player-to-a-running-game.diff Size:12 KB


___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #1574] add a player to a running game

2010-03-31 Thread Matthias Pfafferodt

URL:
  

 Summary: add a player to a running game
 Project: Freeciv
Submitted by: syntron
Submitted on: Mittwoch 31.03.2010 um 23:54
Category: general
Priority: 3 - Low
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: 2.3.0

___

Details:

first try to implement the newplayer command from longturn. this patch does
only creates the player without any units or cities. I tried to (re)use as
much code as possible; also the 'create' is used to add the new player.
Please comment!



___

File Attachments:


---
Date: Mittwoch 31.03.2010 um 23:54  Name:
20100331-trunk-add-a-player-to-a-running-game.diff  Size: 11kB   By: syntron



___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev