civchecker - avoid crashes in your mod

That is right, civchecker has no capability to look inside fpk files. I have made a list of the contents of the "standard" BTS fpk files and that is automatically used within civchecker. If you are a mod author and you have created an fpk file, the easiest thing is to run civchecker on the original files without the fpk. If you are not the author of a mod, but still you feel a need to check the files, you can use pakbuild to unpack them all.
 
tx for the program very useful

I tried it on Rise of Mankind mod (as you may know many of us are getting crazy to try to get a fix for the mod's continuos CTDs) and the results were similar to what Commander bello reported. Now the question is, once the program has shown me the errors, what am I supposed to do? No instructions are given on which stepto take next....
 
I am sure you have read the documentation that comes with it. The key report from the tool is like "symbol XYZ is used on line 123 of file abc.xml". If you are not familiar with the mod code, you may not know how to proceed. But either, the place where the symbol is used, should be removed, or in some other place, a definition of the symbol should be added. Unless you understand about the civ XML in general, and the mod code in particular, you may not be able to use the results to actually fix anything.

I'm not familiar with RoM in particular. Is it actively maintained? Perhaps if the original developer or somebody else familiar with the code, were to look through the civcheck.txt file, they might learn something. I don't think an outsider could do too much.
 
The file Terrain_Peak.dds, a button mentioned in the Civ4TerrainInfos.xml file.... does it exist somewhere or has it ever existed?
 
Good question. Sadly, in the 3.17 patch, there are bunch of files mentioned which don't exist. I guess Firaxis should use civchecker!
 
davidallen, while using civchecker I noticed that it does not play well with extra characters in directory names, for instance, I have a directory that is Art/Units/[naval] for naval art. civchecker reports the files as missing although they are there and in the proper directories.

Other than this small error, this program is a huge time saver. Thanks for your work put into it!!!

Cheers,
ripple01
 
Please help me to understand what you mean by "extra" characters. Do you mean that the directory name is aaa/[bbb]/ccc but in the xml file you have aaa/bbb/ccc ? Or do you mean that both the directory name and the name in the xml are aaa/[bbb]/ccc but it seems civchecker does not like square brackets?
 
do you mean that both the directory name and the name in the xml are aaa/[bbb]/ccc but it seems civchecker does not like square brackets?

Yes, this is what I meant. It says the files are missing, but they are there. I surmise that somehow the brackets are throwing it off.

Cheers,
ripple01
 
I ran civchecker on one of the WW2 mods, I see the usual missing files, but also I see what appears to be an error on every line of globaldefines.xml. Below is one example

UndefinedSymbol: ADVANCED_START_CITY_PLACEMENT_MAX_RANGE
Used: bts backup_before_dresden_0.21/globaldefines.xml at line 1606


What is the info telling me in the second line? What is used?

Thanks for your help. I am getting a CTD every game and the log files don't provide any clues.
 
I ran civchecker on one of the WW2 mods, I see the usual missing files, but also I see what appears to be an error on every line of globaldefines.xml. Below is one example

UndefinedSymbol: ADVANCED_START_CITY_PLACEMENT_MAX_RANGE
Used: bts backup_before_dresden_0.21/globaldefines.xml at line 1606


What is the info telling me in the second line? What is used?

The assumption is that if a symbol is used, it must be defined somewhere, or else some undefined behavior may occur. The message names a symbol which has this problem. When you debug this problem, you need to know where the symbol is used. The definition is missing from somewhere, but of course we do not know where it *should* have been defined.

Please go to that line of that file, and you will see that this symbol is used. However, it is never defined anywhere. So, please think where it *should* be defined, and look to see why there is no definition. Very often it could be due to a spelling or punctuation error. Is that more clear?
 
Is that more clear?

Unfortunately, no. Thanks for helping me though.

Where is the "bts backup_before_dresden_0.21/globaldefines.xml" reference coming from? There is no folder by that name? The globaldefines.xml file is in the XML folder.

It appears that EVERY line of the globaldefines.xml file is marked as an undefined symbol. My earlier example is just one instance, there are hundreds in the civcheck.txt file.
 
Where is the "bts backup_before_dresden_0.21/globaldefines.xml" reference coming from? There is no folder by that name? The globaldefines.xml file is in the XML folder.

I am sure you have edited the civcheck.cfg file to set up the file paths. If you read the comments in that file, "bts" is a shorthand for a directory name. When the game reads all the xml files, it uses a search path. First it looks in one directory, then it looks in another directory, then in a third directory. In this case, "bts" means that it is getting the file from the BTS installation directory. It may be that you expected some other globaldefines file to be loaded, but the one which is loaded is from the installation. If you have not read the documentation, I think that may help explain the idea of search paths also.
 
Just posting this in case it helps anyone in the future.

When editing the config file, make sure you use a /foward slash/ rather than the \black slash\ when setting your directory structure. Windows by default uses the blackslash, for example:

set install_dir "D:\Civilization 4\"

If you run CivCheck with the black slashes, it will not return any errors but it will also not work properly. I ran into this problem because I copy/pasted my directory structure from explorer. You need to replace the back slashes with forward slashes, like so:

set install_dir "D:/Civilization 4/"

Then it will work properly.

And, thanks for making this program.
 
Im not sure this thread is actual anymore... but Ill try anyway=)

I have many of my art files in directories like;

[BTS install dir]/Mods/DazL's Earth/Assets/Modules/Custom Civilizations/Zulu/Flavor/Worker

I notice that all references to my art files are considered missing/false, but the files are there.

Is there a way around this without renaming the directories (to not contain spaces or a ' ) ?.

Or maybe somebody can point me to another tool that doesnt have this 'bug' ?

Thanks in advance,
DazL
 
All of the BTS install directories contain spaces, so I doubt that this is the problem. An earlier poster has pointed out that you should be sure to use either "/" or "\\" as the separator when you enter the pathnames. The example civchecker.config does this. Are you sure the exact spelling of the path is correct? For example, can you see that it is loading your xml files from the indicated directory?

Once you confirm that the xml files are picked up, if you still have a problem with the tick character we can try that. I have not seen other mods using it. An earlier poster mentioned a problem with square brackets, which is possible because those are treated specially in the "tcl" programming language that civchecker is written in.
 
Thanks for the response=)

I think i set the directories correct, this is how the first area of my config looks like;

# The installation path is probably right. Change it if you installed
# the game somewhere else.
set install_dir "E:/Civ IV"

# If you have files in your local CustomAssets you want checked,
# uncomment the next line and make sure the path is correct. For
# non-English language installations, you will need to change "my documents"
# to the right name also.
# add_directory custom "c:/documents and settings/jena/my documents/my games/beyond the sword/customassets"

# If you want to run this on a mod, uncomment the next line and make
# sure the path points to your mod.
# add_directory charlemagne "$install_dir/beyond the sword/mods/charlemagne/assets"
add_directory fury "$install_dir/Beyond the Sword/Mods/DazL's Earth/Assets"

# If you don't have BTS or warlords, comment out the corresponding lines
add_directory bts "$install_dir/beyond the sword/assets"
add_directory warlords "$install_dir/warlords/assets"
add_directory vanilla "$install_dir/assets"


The XML themselves are found and read by the Civ checker. Here is an example of a piece of XML which results in a message about missing files, although the files are present (the .nif and .kfm).

<BonusArtInfo>
<Type>ART_DEF_BONUS_RUBBER</Type>
<fScale>1.0</fScale>
<fInterfaceScale>1.25</fInterfaceScale>
<NIF>Modules/Custom Resources/Rubber/silk.nif</NIF>
<KFM>Modules/Custom Resources/Rubber/silk.kfm</KFM>
<SHADERNIF>Modules/Custom Resources/Rubber/silk.nif</SHADERNIF>
<Button>, ,Art/Buttons/Dazl_LH_Res_Buttons.dds,7,2</Button>
<FontButtonIndex>49</FontButtonIndex>
</BonusArtInfo>
 
So the file with this exact name exists:

E:/Civ IV/Beyond the Sword/Mods/DazL's Earth/Assets/Modules/Custom Resources/Rubber/silk.nif

And it is not inside an fpk file, is that correct?

Civchecker cannot read inside fpks. If it's reading your xml files then it is clearly not a problem with the tick character or spaces. Does this art show up in the game?
 
Yes that's correct. I copied / pasted that into my explorer just to make sure, and it directed to the silk.nif indeed.
 
I did not expect that. The only thing different between what you have done, and what I know others have done successfully, is that you have a space in the "suffix" part of the path, ie, "Custom Resources". Could you try an experiment? Temporarily rename the directory "Custom Resources" to "CustomResources" (remove the space), and then change one or two of your xml references to match. Now does civchecker find the file? Then the problem is the spaces near the end. That would be easy to fix.

If that is not the problem, could you try this on some published mod which does not have these spaces, and does not have an fpk file? It is less likely, but possible, that civchecker is not working correctly on your machine at all.
 
I guess somehow its not working at all on my machine (xp32 up to date).

First I tried another mod in the BTS/mods folders (Afterworld). I changed my .config to match that.

I got the same results, a whole lot of lines like

FileRead: fury E:/Civ IV/Beyond the Sword/Mods/Afterworld/Assets/xml/Art/CIV4ArtDefines_Improvement.xml
MissingArt: Art/Structures/Improvements/ExtractionFacility/ExtractionFacility.nif

Then I renamed my mod folder into DazL and changed the one directory to 'customresources' instead of 'custom resources' and also adjusted 2 entries in the xml. Changed the modname in the .config again and ran it. They still turned up on the list as missing.

MissingArt: Modules/CustomResources/Tobacco/Tobacco.nif
Used: fury art/civ4artdefines_bonus.xml at line 473
MissingArt: Modules/CustomResources/Tobacco/Tobacco.nif
Used: fury art/civ4artdefines_bonus.xml at line 475
MissingArt: Modules/Custom Resources/Tin/copper.nif
Used: fury art/civ4artdefines_bonus.xml at line 483
MissingArt: Modules/Custom Resources/Tin/copper.kfm
Used: fury art/civ4artdefines_bonus.xml at line 484

If the afterworld mod is working for you then it must be my setup indeed. Ill try to get it running on my Vista partition (dont have civ installed there yet), see if it works there=)
 
Back
Top Bottom