Change teams for a scenario via text editor

Do you want to help out with Freeciv development? Then check out this forum.
User avatar
XYZ
Hardened
Posts: 235
Joined: Fri Jan 31, 2014 12:00 pm

Change teams for a scenario via text editor

Postby XYZ » Fri May 06, 2016 1:55 pm

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: 1484
Joined: Tue Jan 29, 2013 6:54 pm

Re: Change teams for a scenario via text editor

Postby cazfi » Fri May 06, 2016 8:38 pm

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)

User avatar
XYZ
Hardened
Posts: 235
Joined: Fri Jan 31, 2014 12:00 pm

Re: Change teams for a scenario via text editor

Postby XYZ » Wed Jul 20, 2016 7:52 pm

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: 450
Joined: Wed Jan 30, 2013 12:15 am

Re: Change teams for a scenario via text editor

Postby JTN » Wed Jul 20, 2016 10:21 pm

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.

User avatar
XYZ
Hardened
Posts: 235
Joined: Fri Jan 31, 2014 12:00 pm

Re: Change teams for a scenario via text editor

Postby XYZ » Thu Jul 21, 2016 5:48 am

Allright, thanks for the help! Maybe I can tweak it by erasing some buildings etc.