Set the default AI players

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Post Reply
baltazar
Posts: 1
Joined: Mon Mar 05, 2018 12:46 pm

Set the default AI players

Post by baltazar »

Hi. I'm playing with AI from time to time and I'm getting tired with having to set the nations and AI difficulty levels manually each time I start new game. Is it possible to save the AI players list I preset, so that they appear automatically when I click "Start New Game"? I'm not talking about the number, but AI difficulty (per AI), nations, leaders' names and colors.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Set the default AI players

Post by cazfi »

I don't think you can get the colors set, but for leader names and nations derived from them you could write a set of "create" and difficulty setting server commands to a file and run that with "/read <file>" when ever you want that set of AI players created.
e.g: ai_players.serv:

Code: Select all

create Hammurabi
hard Hammurabi
To client chatline:

Code: Select all

/read ai_players.serv
User avatar
Arbogast
Elite
Posts: 412
Joined: Tue Jul 16, 2013 9:09 am
Location: France

Re: Set the default AI players

Post by Arbogast »

Hey, that's a good tip.
I agree wholly with baltazar's comments. Now my question of course:
Cazfi: Could you expand a bit on how to go about it? From your "Code" example, you need to include the AI difficulty, but how do add the nations? More AIs?
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Set the default AI players

Post by Alien Valkyrie »

I don't think setting the nation is possible via commands. Setting the color, however, is:

Code: Select all

set plrcolormode PLR_SET

create AnAIPlayer
playercolor AnAiPlayer ff0000
~ AVL
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Set the default AI players

Post by cazfi »

'Create' command sets the nation based on player's name. 'Hammurabi' is leader of Babylonians.
User avatar
Arbogast
Elite
Posts: 412
Joined: Tue Jul 16, 2013 9:09 am
Location: France

Re: Set the default AI players

Post by Arbogast »

(DUH!) :oops:
What I meant is how to write the list, let's say 7 AI players with 'normal' difficulty and their respective nations and colors.
I figure that using a text editor to write said list, naming it, copying it to chat line with the /read command should do it. That's what I do with the 'my_settings-2.6.0.serv' file, since it has all those inner commands (like 'metapatches' 'cmdlevel', etc.) are already written.
My question is what is the syntax to be used?
I hope I'm making sense...
Post Reply