XML cache , possible to change it in game ?

Sto

Should i code today ...
Joined
Dec 15, 2005
Messages
1,144
Location
Marseille (France)
When i play ,would that be possible to return to the desktop ( pressing ALT-TAB ) ,change an XML value and reinitialize the XML value . Or change dinamicaly the value with python ? or reload the XML file where the change is made ?
 
Sto said:
When i play ,would that be possible to return to the desktop ( pressing ALT-TAB ) ,change an XML value and reinitialize the XML value . Or change dinamicaly the value with python ? or reload the XML file where the change is made ?

I know that you can reload the gametext, landscape infos, and art defines in the in-game console. Follow the tutorial located either in this or the tutorials forum for enabling debug mode, then open up the console in-game (by hitting tilde). There, hit "XML.r", then hit tab. You'll go through the various commands that will reload the files, namely:

XML.reloadGameText
Reloads all the TXT_KEY's.

XML.reloadLandscapeInfos
Reloads all of Civ4TerrainSettings.xml

XML.reloadArtDefines
Reloads all the art defines.

I'm not sure if there are any other tricks to get XML files reloaded on the fly.
 
i will search if there are other tricks to get XML files reloaded on the fly . I doubted that that would be possible , so this is a good news .

Thanks , Tcho !
 
Hey Sto, if you want to tinker around with the SDK I found several very useful methods that you might want exposed through python to reload the XML they are:

CvArtFileMgr::Reset() //Reloads the XML & Rebuilds the Maps
CvGameTextMgr::Reset() // Accesses CvXMLLoadUtility to clean global text memory and reload the XML files
CvXMLLoadUtility::ResetLandscapeInfo() // Clean up items for in-game reloading
CvXMLLoadUtility::ResetGlobalEffectInfo() // Clean up items for in-game reloading
 
So if you can find the good function that reload the xml file you want -> you win . And then you can create a python function that call this function with the SDK ... if i ve well understood !?
But i don t know anything with the SDK and C++ . i think i will try to find the function that can reimport xml values for buildings and units if that exists . if yes , i will try to learn how to manage with the SDK . i'm sure your SDK MOD COMPs will be usefull to learn ! :)

Thanks , Tcho !
 
Sto said:
So if you can find the good function that reload the xml file you want -> you win . And then you can create a python function that call this function with the SDK ... if i ve well understood !?
But i don t know anything with the SDK and C++ . i think i will try to find the function that can reimport xml values for buildings and units if that exists . if yes , i will try to learn how to manage with the SDK . i'm sure your SDK MOD COMPs will be usefull to learn ! :)

Thanks , Tcho !

So which XML files do you want to reload? Units, buildings?
 
i search how to reload buildings in a first time .

But i ve just open the SDK and look for a tutorial and documentation for C++ , how to use the SDK ,install the C++ editor etc ... i think that will take time to do that .

my aim is to make some living building ... for an example , turn a world wonder into a national wonder , change the production cost in function of the year . I was thinking that change and reimport the xml file was a good solution And looking at MOD COMP for the trait , the better solution seems to implement a function for each case .

So , i need to learn a lot of things before beginning this project since i have no idea on how to build this. Many thanks for your help :) but sorry i won t be able to understand the following :cry: .

If you have advise for how to make that or the way you may do that , i m all ears opened !

Thanks again !
 
Top Bottom