Modify "techlevel" server command

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Modify "techlevel" server command

Post by MikeDuk »

It currently works like this:

Code: Select all

/set techlevel N
It sets the tech level to N for all players.

The proposed change is:

Code: Select all

/set techlevel N <player-name>
where <player-name> is optional. If the player name is not given, it sets the same N level for all players. If a player name is given, it sets the level only for that player.

Therefore, I could do:

Code: Select all

/set techlevel 10 AI*2
/set techlevel 10 AI*3
/set techlevel 10 AI*4
/set techlevel 10 AI*5
/set techlevel 10 AI*6
/set techlevel 15 AI*7              //make AI*7 stronger than the rest of AIs
/set techlevel 0 MikeDuk
and all of them could have a head start and that would be a challenge.


Shorter, if a second command can override a previous one:

Code: Select all

/set techlevel 10               // 10 for all
/set techlevel 15 AI*7          //overrides techlevel for AI*7
/set techlevel 0 MikeDuk        //overrides techlevel for MikeDuk

It is a different way to configure AIs (hard, easy, cheating, etc.).
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Modify "techlevel" server command

Post by cazfi »

You can give players techs with lua once the game has been started.

Tested the following in the server console (to give one random tech to player id 0 -> first player)

Code: Select all

> lua cmd edit.give_tech(find.player(0), nil, 0, true, 'Start tech')
MikeDuk
Posts: 40
Joined: Tue Aug 31, 2021 3:58 pm

Re: Modify "techlevel" server command

Post by MikeDuk »

Thanks, cazfi.

But we don't have access to the server console at Freecivweb.org or Tactics and Triumph, so I don't think we can execute LUA scripts there.

Code: Select all

/lua
/lua: You are not allowed to use this command.

/cmd
/cmdlevel: You are not allowed to use this command.
nef
Elite
Posts: 324
Joined: Mon Jun 25, 2018 5:01 pm

Re: Modify "techlevel" server command

Post by nef »

> lua cmd edit.give_tech(find.player(0), nil, 0, true, 'Start tech')
There is an oversight in this tolua function: there is no "nocost" option. "freecost" is not free if tech_cost_style = "Civ I|II". the reason being that future research will cost more. This spoils the Civ I & II style of handing out free techs. Presumably this free handout was completely misunderstood when the server option was invented. (What is the point of free techs, free gold, free units being handed out to everyone. All of these are individual handouts in Civ I & II. I can do gold and units in Lua but not techs because "nocost" is missing.)

Of course this fc idea of free universal handouts has now grown legs of its own. civ2civ3 is well on its way to being a scenario starting, as it does, with a veritable army of units. (Where is going to end: free cities next, and after that - free buildings? Oh and don`t forget free gardening while you`re about it.)
Post Reply