Page 1 of 1

Change teams for a scenario via text editor

Posted: Fri May 06, 2016 1:55 pm
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

Re: Change teams for a scenario via text editor

Posted: Fri May 06, 2016 8:38 pm
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)

Re: Change teams for a scenario via text editor

Posted: Wed Jul 20, 2016 7:52 pm
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?

Re: Change teams for a scenario via text editor

Posted: Wed Jul 20, 2016 10:21 pm
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.

Re: Change teams for a scenario via text editor

Posted: Thu Jul 21, 2016 5:48 am
by XYZ
Allright, thanks for the help! Maybe I can tweak it by erasing some buildings etc.

Re: Change teams for a scenario via text editor

Posted: Sun Sep 23, 2018 11:47 am
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).