Page 1 of 1

Modding saved games

Posted: Jul 08 2009
by catatonic
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...

Re: Modding saved games

Posted: Jul 08 2009
by Balthagor
I think this has previously been asked as "can a savegame be used as a cache for modding?"

and the answer is yes, absolutely.

Re: Modding saved games

Posted: Jul 08 2009
by catatonic
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?

Re: Modding saved games

Posted: Jul 08 2009
by Balthagor
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.

Re: Modding saved games

Posted: Jul 08 2009
by Ruges
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.

Re: Modding saved games

Posted: Jul 08 2009
by Balthagor
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).

Re: Modding saved games

Posted: Jul 09 2009
by catatonic
Hey - it works!

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

Thanks guys.

LLAP

Re: Modding saved games

Posted: Jul 09 2009
by Balthagor
feel free to update the wiki and share the mod!

hint, hint...

Re: Modding saved games

Posted: Jul 12 2009
by catatonic
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.

Re: Modding saved games

Posted: Aug 06 2009
by Red Dawn
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!

Re: Modding saved games

Posted: Aug 06 2009
by catatonic
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:

http://www.bgforums.com/forums/viewtopi ... 504#p92504