• In anticipation of the possible announcement of Civilization 7, we have decided to already create the Civ7 forum. For more info please check the forum here .

Quick C++ or possibly python question.

Popcornlord

Steampunk Mechanic
Joined
Oct 18, 2007
Messages
787
What file tells the computer how to load save files? I'm trying to mod in space for the Star Wars Mod (which is not easy!) and I think I'm going to have to mess around with save files. So can a experienced modder please tell me how? Thanks!
 
As far as I know, that would be in C++. I've tried looking everywhere (I think) and can't find anything in python. The only things I could find where "onPreSave" and "onSaveGame" in CvEventManager.py. They both have thier uses, but don't allow you to change how or when a file is loaded.
 
I don't think there's anything about loading and saving files in CvInfos. I've checked it and it's just XML.
 
Looks like saving and loading save files is controlled by the engine (i.e. outside SDK). For example savegame function is defined in CvDLLEngineIFaceBase.h which gives a list of functions from the engine. But it seems like the savegame function is actually executed from CvGame.cpp. Although, I'm not very good at reading C++ so it's hard to understand where the function comes from originally.
 
Take a look at all those read and write functions in CvInfos.cpp

Matze

Matze is right. Look for read and write functions that use pStream. These are reading and writing to the save game.

EDIT: If a specific info doesn't read or write to the pStream then this is because that game object doesn't save anything. I think CvImprovementInfo is an example of this.
 
Top Bottom