Change teams for a scenario via text editor

Do you want to help out with Freeciv development? Then check out this forum.
Post Reply
XYZ
Elite
Posts: 432
Joined: Fri Jan 31, 2014 12:00 pm

Change teams for a scenario via text editor

Post by XYZ »

Hi,

I've modified entirely the WW1 scenario and am trying to emulate the Great War. Unfortunately the Ai isn't really known for being a good role player as he withdraws vision to team mates and brokers a cease-fire as soon as he gets a chance to.
Since I can't put teams together via the client I tried to do it via text editor: I switched the team numbers corresponding to the teams I wanted but when I recompress the file doesn't work no more. Is it even possible or am I doing a mistake when recompressing it? (the file is smaller afterwards...)

Ferdi
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: Change teams for a scenario via text editor

Post by cazfi »

You can test it without compressing it again. You should run server separately to get any error messages directly from it. This also helps with the problem I've been encountering a couple of times (and have been trying to fix/improve a bit in upcoming releases) that you have rather poor control on what file actually gets loaded when you select a scenario to load (if you have multiple versions of the same scenario around, it might pick up completely different version from what you want)

Can't you arrange teams on pre-game? (Yeah, it might be too late since you have already once started the game and it's not completely new game). I recently changed teams on some scenario file, and it was a bit more complicated than switching team numbers around (that just broke consistency of the data). This was with S2_6, with "research" sections being arranged per-team, though. (In S2_5 and earlier, research information is part of each player, even if they are in the same team with shared research)
XYZ
Elite
Posts: 432
Joined: Fri Jan 31, 2014 12:00 pm

Re: Change teams for a scenario via text editor

Post by XYZ »

Related questions: how do I change the ruleset of a scenario? I tried it manually with the text editor without recompressing but it won't work. I asked panther if we could organize an online match with the Spanish Civil War scenario (default ruleset) but he required it to be with civ2civ3. Any ideas? Or anyone who can do it?
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Change teams for a scenario via text editor

Post by JTN »

It can be as simple as changing the "rulesetdir" line -- that's what we did in patch #6589 to migrate shipping scenarios to civ2civ3 in preparation for 3.0.
But it won't work if the savefile mentions objects that don't exist in the new ruleset, for instance a building in a city; or if the savefile has some situation that would be illegal in the new ruleset. The server treats scenarios as savefiles, and doesn't have any way to cope gracefully with savefile data that doesn't match its supposed ruleset.
classic and civ2civ3 are usually close enough that you can get away with it -- very similar building sets, etc -- but not always.
If you encounter something that would be illegal, hopefully you get a useful enough error message and can use the editor to avoid the situation before changing the ruleset, but in the worst case you could end up having to edit other bits of the scenario by hand.

We are working, slowly, on the ability to have scenarios that aren't tied to rulesets (subject to the above constraints). But don't hold your breath.
XYZ
Elite
Posts: 432
Joined: Fri Jan 31, 2014 12:00 pm

Re: Change teams for a scenario via text editor

Post by XYZ »

Allright, thanks for the help! Maybe I can tweak it by erasing some buildings etc.
Wahazar
Elite
Posts: 362
Joined: Mon Jul 02, 2018 1:49 pm

Re: Change teams for a scenario via text editor

Post by Wahazar »

Let me hang on this topic.
How to properly define teams for AI to force them to stay in alliance?
Lets focus on the new game in singleplayer mode.
I tried to just shuffle AI to same team before start, but it didn' t work properly (no alliance) and causes some errors later (savegame inconsistency).
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
Post Reply