Modding saved games

What is the world like in 2020? What are the different ways to play? How can I create my own futuristic scenario and country groupings?

Moderators: Balthagor, Legend

catatonic
General
Posts: 1113
Joined: Jun 03 2009
Human: Yes

Modding saved games

Postby catatonic » Jul 08 2009

OK, I've read all of the Wiki and forum info on modding. I think that I have an understanding of the process.

My understanding is that the goal of modding is to produce a customized .SAV file (a cache file) that you can start in the Lobby. If this is true then it is not possible to mod an existing cache file - that is to mod a game in progress. The only "modding" that can be done to a game in progress is to edit the .INI files that are re-read when the saved game is restarted.

Is this correct? I'm amazed that the question "Can you mod a .SAV game?" has not been asked or answered plainly anywhere that I have read. I would think that it would be a FAQ.

Or maybe it is too dumb a question to ask...
"War is merely the continuation of politics [diplomacy] by other means"
General Carl von Clausewitz - 1832

"Defense: De ting dat keeps de cows off de road."
Catatonic - 2012

User avatar
Balthagor
Supreme Ruler
Posts: 19518
Joined: Jun 04 2002
Human: Yes
Location: BattleGoat Studios

Re: Modding saved games

Postby Balthagor » Jul 08 2009

I think this has previously been asked as "can a savegame be used as a cache for modding?"

and the answer is yes, absolutely.
Chris Latour
FortressGames.ca
BattleGoat Studios
chris@battlegoat.com

catatonic
General
Posts: 1113
Joined: Jun 03 2009
Human: Yes

Re: Modding saved games

Postby catatonic » Jul 08 2009

I think this has previously been asked as "can a savegame be used as a cache for modding?"


First of all, I am ecstatic that this can be done. I have wanted to do it about two times per day for the last month, but I never believed that it was possible.

I searched the forum for "+savegame +cache +modding" and did not come up with the "how to" answer that you mentioned. If you or someone could please point me to this I would appreciate it.

But again, this goes counter to my understanding of how modding works. Everything that I have read is couched in terms of creating a new cache file, not about how to modify an existing one. And it always involves deleting the existing "cache" file. My saved game (a cache as you call it) contains many years of my game play information. But it is already "compiled" with the original DEFAULT.UNITS file, etc.

For instance, if I want to mod my .SAV file so that the next time that I restart the game a certain unit's display name is changed. Suppose that I want the "Airborne ECB Engineer" unit to display in the units list as "nnn INF ECB Engineer" instead of "nnn INF Engineer". I would need to edit the existing DEFAULT.UNITS file or supply a new customized MY.UNITS file to the .SCENERIO file.

So how would this work? Would the game program load my current .SAV game file but somehow detect that its scenerio's .UNITS file has changed and then parse and merge in my new customized units text info before starting the game? Would it take a long time re-compiling and produce a new "CACHED - new.sav" file in the /Savegame folder, or would it just grab my new customized UNITS info and immediately restart the game?
"War is merely the continuation of politics [diplomacy] by other means"
General Carl von Clausewitz - 1832

"Defense: De ting dat keeps de cows off de road."
Catatonic - 2012

User avatar
Balthagor
Supreme Ruler
Posts: 19518
Joined: Jun 04 2002
Human: Yes
Location: BattleGoat Studios

Re: Modding saved games

Postby Balthagor » Jul 08 2009

You're misunderstanding what I said...

I did not say you could modify a savegame to use it as a cache file. I said you could use the savegame as the cache file.

Now, if you read through the details of the .scenario file, it does talk about what data files are applied pre-creation (such as equipment) and what files are applied post creation (such as the relations overrides). Anything post, you can use a .scenario that specifies your savegame filename as the cache and just dump your save into the cache folder. That won't however get you things like equipment file changes.

There is rumor that some "pre" files can be re-specified in the "post" section to make alterations, but much of this is untested (read unsupported).

look at the files for Saudi Invasion or African Dragon to get some clues on how this is done. Start in the .scenario.
Chris Latour
FortressGames.ca
BattleGoat Studios
chris@battlegoat.com

User avatar
Ruges
General
Posts: 3406
Joined: Aug 22 2008
Location: Nearby, really I'll see you tonight when your sleeping
Contact:

Re: Modding saved games

Postby Ruges » Jul 08 2009

I am not sure if this would work or not, and if it does work it would mean a long load time. But here is how I think it could be done. I am going to use the Global Crisis Scenario as an example.

Open up the Global Crisis.scenario in the CampainGC folder. In there you will see:

...........

Code: Select all

#ifset 0x01
#include "GlobalCrisis.CVP", "MAPS\"
#include "GlobalCrisis.REGIONINCL", "MAPS\"
#endifset

#ifset 0x02
#include "DEFAULT.UNIT", "MAPS\DATA\"
#include "DEFAULT.PPLX", "MAPS\DATA\"
#include "DEFAULT.TTRX", "MAPS\DATA\"
#include "DEFAULT.TERX", "MAPS\DATA\"
#include "DEFAULT.WMDATA", "MAPS\DATA\"
#include "DEFAULT.NEWSITEMS", "MAPS\DATA\"
#include "AllSourceLoad.INI", "INI\"
#endifset

#ifset 0x02
&&MAP
mapfile "GlobalCrisis"
&&END

#include "GlobalCrisis.OOF", "MAPS\"
#include "GlobalCrisis.OOB", "MAPS\ORBATS\"
#include "AllLoad.INI", "INI\"
#include "Global Crisis.csv"
#endifset

#ifset 0x04
&&SAV
savfile "Global Crisis"
&&END

#endifset

#include "LocalText-RegionsGC.csv", "SCENARIO\", Y
#include "Global Crisis-Text.csv", "SCENARIO\", Y

...........

Change it to:
........

Code: Select all

#ifset 0x01
#include "GlobalCrisis.CVP", "MAPS\"
#include "GlobalCrisis.REGIONINCL", "MAPS\"
#endifset

#ifset 0x02
#include "DEFAULT.PPLX", "MAPS\DATA\"
#include "DEFAULT.TTRX", "MAPS\DATA\"
#include "DEFAULT.TERX", "MAPS\DATA\"
#include "DEFAULT.WMDATA", "MAPS\DATA\"
#include "DEFAULT.NEWSITEMS", "MAPS\DATA\"
#include "AllSourceLoad.INI", "INI\"
#endifset

#ifset 0x02
&&MAP
mapfile "GlobalCrisis"
&&END

#include "GlobalCrisis.OOF", "MAPS\"
#include "GlobalCrisis.OOB", "MAPS\ORBATS\"
#include "AllLoad.INI", "INI\"
#include "Global Crisis.csv"
#endifset

#ifset 0x04
&&SAV
savfile "Global Crisis"
&&END

#endifset

#include "DEFAULT.UNIT", "MAPS\DATA\"
#include "LocalText-RegionsGC.csv", "SCENARIO\", Y
#include "Global Crisis-Text.csv", "SCENARIO\", Y

...........

This should cause the game to load the .units file everytime the game starts. It might need to go under the global crisis.CVS instead of above the localtext.

User avatar
Balthagor
Supreme Ruler
Posts: 19518
Joined: Jun 04 2002
Human: Yes
Location: BattleGoat Studios

Re: Modding saved games

Postby Balthagor » Jul 08 2009

if it worked, first time it loads, you could save that as the .sav you turn into a cache and remove the post cache overrides (to avoid applying them twice).
Chris Latour
FortressGames.ca
BattleGoat Studios
chris@battlegoat.com

catatonic
General
Posts: 1113
Joined: Jun 03 2009
Human: Yes

Re: Modding saved games

Postby catatonic » Jul 09 2009

Hey - it works!

And it didn't take long to load at all.

Thanks guys.

LLAP
"War is merely the continuation of politics [diplomacy] by other means"
General Carl von Clausewitz - 1832

"Defense: De ting dat keeps de cows off de road."
Catatonic - 2012

User avatar
Balthagor
Supreme Ruler
Posts: 19518
Joined: Jun 04 2002
Human: Yes
Location: BattleGoat Studios

Re: Modding saved games

Postby Balthagor » Jul 09 2009

feel free to update the wiki and share the mod!

hint, hint...
Chris Latour
FortressGames.ca
BattleGoat Studios
chris@battlegoat.com

catatonic
General
Posts: 1113
Joined: Jun 03 2009
Human: Yes

Re: Modding saved games

Postby catatonic » Jul 12 2009

So, when you modify a unit and then over-ride it's original specs with a customized .UNIT file, then the game forces you to re-research the unit.

You sly Goats you...

P.S.

I know about the "No Research" setting in the .UNIT file.
Looks like if I publish a mod, it may have to be in "new game" and "saved game" versions.
"War is merely the continuation of politics [diplomacy] by other means"
General Carl von Clausewitz - 1832

"Defense: De ting dat keeps de cows off de road."
Catatonic - 2012

Red Dawn
Captain
Posts: 101
Joined: Sep 22 2007

Re: Modding saved games

Postby Red Dawn » Aug 06 2009

Hi Guys

Can the moding of saved games be used to mod relations between countries? I am at a state of war with virtually every nation and would like to change it so that I am at peace with them?

If so please can someone provide me with a step by step process of how to do it? Sorry but I am a complete newbie when it comes to things like this!

catatonic
General
Posts: 1113
Joined: Jun 03 2009
Human: Yes

Re: Modding saved games

Postby catatonic » Aug 06 2009

Red Dawn wrote:Hi Guys

Can the moding of saved games be used to mod relations between countries? I am at a state of war with virtually every nation and would like to change it so that I am at peace with them?

If so please can someone provide me with a step by step process of how to do it? Sorry but I am a complete newbie when it comes to things like this!


This thread will tell you how to worsen or improve relations:

viewtopic.php?f=47&t=15322&p=92504#p92504
"War is merely the continuation of politics [diplomacy] by other means"
General Carl von Clausewitz - 1832

"Defense: De ting dat keeps de cows off de road."
Catatonic - 2012


Return to “Scenarios, Mods and More - 2020”

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron