Civ 4 won't load XML files but won't tell why.

Sithguy

Chieftain
Joined
Dec 10, 2007
Messages
8
Ok so I have been attempting to mod recently but when Civ 4 loads the mod it gives me an error stating that it can't open two of my XML files and that's all it says. The clue I have to why its not working is I can't view them properly in Internet Explorer, compared to other mods I've been looking and do work that can be viewed in Internet Explorer. I get this error when I attempt to open them with IE:

Error opening input file: 'JohnAdams_CIV4CivilizationsSchema.xml'. Reference to undeclared element: '{x-schema:JohnAdams_CI...

I searched for this problem and people said IE was not for editing, which I know, but after I edit the files in notepad and then attempt to open them in IE, it gives me that error, which did not occur when I tried it with other's mods files that worked when loaded.

Any help would be greatly appreciated
-Sithguy
 
what location is the file at?

I would put it at....


C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods

(for vanilla)

C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods

(for BTS)


But when you put a file in the mod... you also need to put a subdirectory (a folder) as well...


so C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\JohnAdams\Assets\Modules\JohnAdam\

and then put the stuff in there... as an example.
 
The location of the folder is that:

C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\American Presidents\Assets\Modules\Custom Leaderheads\John Adams

Also I can open the files in XML notepad but they still can't be viewed in IE.
 
The files are xml files. I tried renaming them to and back to xml but nothing changed. Thanks for the suggestion though.
 
Make sure both files are in the same folder and that the file name for the schema matches what you have in the schema tag in the other XML file including any extra spaces. If that's not the problem, make sure you don't have any syntax errors in your modified XML file where the schema is defined. It should be something like: <Civ4LeaderHeadInfos xmlns="x-schema:CIV4CivilizationsSchema.xml"> make sure you have both <>'s and ""'s in place, that's a common error.
 
I tried that and maybe I'm missing something. Here are the files and statements involved.

JohnAdams_CIV4CivilizationsSchema.xml - schema file

JohnAdams_CIV4LeaderHeadInfos.xml statement is
<Civ4LeaderHeadInfos xmlns="x-schema:JohnAdams_CIV4CivilizationsSchema.xml">

JohnAdams_CIV4CivilizationInfos.xml statement is
<Civ4CivilizationInfos xmlns="x-schema:JohnAdams_CIV4CivilizationsSchema.xml">

I don't see anything wrong. I followed all the above instructions, what am I missing?
 
Wait!?! The Schemas aren't supposed to be in the mod folder?

I put all the files in the same folder, is there something wrong?
 
Here is a suggestion.

When I first started to learn how to mod, after reading all I could... (keep in mind this just been a few weeks ago) I cannabilzed an existing mod. In this case, if your looking just to add a civilization or a leader - look for a modular civilization... study it and go from there.

I basically found a few civilizations MODs and looked at what they did and went from there. Once you more or less master modular civilizations. You can start a complete scenario. And since the civs you made are modular you can include (or not). I am trying to do a MOD scanrio with new civilizations and new leaders and new units and wonders and techs and buildings for myself. Who knows maybe I will post it, if its "okay." Never-the-less, since the civs I created are modular I can also add them in the regular game as well. However, since I started making new techs and new units, I had to create two seperate folders (subdirectories). One for the unaltered modular civilizations and the other for the new scenario. Just a suggestion.
 
Wait!?! The Schemas aren't supposed to be in the mod folder?

I put all the files in the same folder, is there something wrong?
That isn't true in your case since you're using modular XML, with modular XML the schema file needs to be in the same folder or the game wouldn't know where to find it.
 
Here is a suggestion.

When I first started to learn how to mod, after reading all I could... (keep in mind this just been a few weeks ago) I cannabilzed an existing mod. In this case, if your looking just to add a civilization or a leader - look for a modular civilization... study it and go from there.

I basically found a few civilizations MODs and looked at what they did and went from there. Once you more or less master modular civilizations. You can start a complete scenario. And since the civs you made are modular you can include (or not). I am trying to do a MOD scanrio with new civilizations and new leaders and new units and wonders and techs and buildings for myself. Who knows maybe I will post it, if its "okay." Never-the-less, since the civs I created are modular I can also add them in the regular game as well. However, since I started making new techs and new units, I had to create two seperate folders (subdirectories). One for the unaltered modular civilizations and the other for the new scenario. Just a suggestion.

I did that. I looked at two mods, one that was specifically a Modular Leaderhead mod. My format is the same. I even copied and pasted the line in questions from a working mod to mine and then added the schema and it still didn't work. This is really confusing. I've followed all the above instructions and it still does load the xml file.
 
Ok, go here and download Open Komodo (it's free). That will give you a decent editor that will highlight syntax errors for you, it works with XML out of the box and Python (if you decide to go further) with another free download added in. It also has handy features like line & column number so when you get an error while loading Civ 4 you can find it easily.
 
Ok. I tried something. I investigated the schema file. I copied it from another mod file and renamed it and everything and it works. Turns it it was the schema file all along and the one I was using was incomplete.

Thanks for all the help!
 
the bad thing about modding... is everything needs to be exact... one typo... one missing letter or case...

WHAM

10 hours of work to find something that took you 1 sec to make and 1 extra sec to make sure it was right but after 5 hours it all looks the same! ha
 
Thats why I use editors with syntax checking, saves me many hours of searching for that elusive missplaced / or something equally crazy. :)
 
How do you get that software? The download page navigation is very poor - there is no data about where you need to click to get the correct file.

EDIT: Just looked at the wiki (which only works for FIREFOX, not IE7. This looks like an open source project, which means that you need to download a bunch of source files, install in zillion applications, and then do a complicated build process that only hard-core programmers understand. This is why I HATE open source.
 
Erm... No idea, when I grabbed it for myself there was a binary, now the download directory is empty. No source code for me or anything special, just a download and install, if it wasn't 27MB I would upload it :)
 
Back
Top Bottom