View Full Version : BUG XML Files


ruff_hi
Apr 17, 2008, 09:28 PM
We've started to make use of the XML files to hold the location of our art files as well as some text for translation (and hints!). Do we need to bury our enteries into the existing XML files or can we create our own versions and just leave it up to the game to find them?

If we can do the second - we should. Then we don't have to worry about treating on any XML toes when the game gets patched.

EmperorFool
Apr 17, 2008, 11:42 PM
The game seems to load all XML files in the XML directory tree. I agree that it will be best if we only add new XML files. The only reason we'd have to replace a file is if we wanted to change the text for a particular entry which I'm keen not to do.

Looking into the XML files we have, I see one issue. I don't know if the <HintInfo>s will be merged from multiple files. I'll try separating them out and see if it works.

NikNaks
Apr 18, 2008, 03:47 AM
The text files can be split, but art can't unless you go modular.

alerum68
Apr 19, 2008, 11:04 PM
EF can you commit your local copy of the new BUG xml file to play around with?

EmperorFool
Apr 20, 2008, 03:50 AM
I've committed all my changes, including the hints split out into their own XML files (I still haven't seen one of the new hints come up, so maybe this won't work) and deleting our CIV4GameText_BTS.xml (where the hints were stored, but had other things we missed from 3.13).

alerum68
Apr 20, 2008, 09:35 AM
Cool.:) I had to run it about 20 times until I saw my first modified hint, but IIRC, when you make a code breaker with it, it will just CTD on load.

EmperorFool
Apr 20, 2008, 09:47 AM
Excellent. I wasn't too worried about it crashing, only ignoring the new hints entirely like it does new art XML files. Now that you've seen one, I'm content they will all work. Thanks for testing it.

This means that the only overridden XML file is CIV4ArtDefines_Interface.xml. We'll need to check to see if that file is modified in future patches as we do with all the Python files.

alerum68
Apr 20, 2008, 09:51 AM
No, I haven't seen one this time, talking about when I first put it together. I haven't updated my svn dir yet, but as long a the Civ4Hints.xml file is there, it will call up all the hints. BTW - When did you start playing around with XML? Damn, now you know how easy it is.:p

edit: Oops... the Civ4Hints.xml file was deleted. It won't call up any new hints with that gone.
edit 2: Ahhh... I see you created a new BUGHints.xml file... just took a look and it's defined properly. It should load up perfectly.

EmperorFool
Apr 20, 2008, 09:58 AM
Third time's a charm. ;) Yes, I split out the new hints into their own file. This works just fine with the CIV4GameText XML files; I'm hoping it will work for the hints as well. That's why I need to see a new hint come up on-screen.

Oh, I know how to test more easily. Make a copy of the BtS CIV4Hints.xml file, copy it to your CustomAssets, and delete all the stock hints. When you start the game, you'll either see one of the new hints or no hints. :)

ruff_hi
Apr 20, 2008, 10:30 AM
Oh, I know how to test more easily. Make a copy of the BtS CIV4Hints.xml file, copy it to your CustomAssets, and delete all the stock hints. When you start the game, you'll either see one of the new hints or no hints. :)I was just about to post this as a suggestion - man, you and I are on the same page at the moment.

EmperorFool
Apr 20, 2008, 11:24 AM
I've tried it (had to leave one hint in because it tanks with an empty list of hints as per the DTD), and it just keeps showing that one hint again and again. Sooo, they cannot be split out, but I can at least make it easier to maintain. I'll commit the fix shortly.

Edit: Done. I also changed the XML keys so they won't clash if any more hints are added by Firaxis.

alerum68
Apr 20, 2008, 06:19 PM
Edit: Nevermind, fixed both issues.

Question though... Were you not able to make use of the BUGHints.xml file?

EmperorFool
Apr 20, 2008, 08:04 PM
That's correct. Without modular XML loading, certain types of XML files are not loaded just because they are present. Any game text XML file is loaded, but art infos and apparently game infos are not. I had to put the hints back into the original hints XML file.