View Full Version : Modding -- editing audiodefines files on a Mac


lazarillo
Apr 14, 2008, 11:10 PM
All,

I have found a few little problems that I suspect to be Mac-specific. One that I pain-stakingly found out was that I cannot use non-alpha characters in the XML files (or at least not in the main text info file... I had an ampersand "&" in it and that messed it up -- wow! that took a while to find!).


Anyway, I am now trying to edit the sounds, and I follow to the letter several of the helpful suggestions buried here within fanatics center. But I realized that the problem I am having must be a Mac-specific problem because I had an error even when doing the following:

1) I open up the "audiodefines.xml" file in a text editor (tried textwrangler & text edit apps).
2) I added ONLY COMMENTED lines (started with <!-- and ended with -->)
3) I saved the file.

After doing this, the mod would crash. Hhhmmm... so I did a bit more "studying", and tried the following:

1) I opened up the file and saved it, then ran it.

In this case, it ran. So then I tried the following:

1) I opened it, and added a comment, BUT NO NEW LINE

In this case, it also ran. So, I expect the audiodefines.xml file is DOS vs. Mac vs. unix line return sensitive. I was about to force it to save under different line/carriage returns (I was initially using DOS return), but I realized this would be worthless (at least least a major hassle) since I also want to share the mod with friends who have PCs.

Has anyone with a Mac had a similar problem editing the audiodefines.xml file? This is strange because it is specific just to the audiodefines file. I have already made an entire mod successfully (many xml files), as well as downloaded others' mods. Plus, I can alter the audio2dscripts file. It is just this audiodefines.xml.

Any suggestions? I'd post the file here, but literally all I did was add comments (with a new line).

Thanks!

AlanH
Apr 15, 2008, 04:17 AM
All,

I have found a few little problems that I suspect to be Mac-specific. One that I pain-stakingly found out was that I cannot use non-alpha characters in the XML files (or at least not in the main text info file... I had an ampersand "&" in it and that messed it up -- wow! that took a while to find!).
Various characters have special meanings in XML. You have to use "entity" escapes. Replace '&' with '&amp;', just as you would in HTML.


Anyway, I am now trying to edit the sounds, and I follow to the letter several of the helpful suggestions buried here within fanatics center. But I realized that the problem I am having must be a Mac-specific problem because I had an error even when doing the following:

1) I open up the "audiodefines.xml" file in a text editor (tried textwrangler & text edit apps).
2) I added ONLY COMMENTED lines (started with <!-- and ended with -->)
3) I saved the file.

I did that with the standard AudioDefines.xml file and Civ4 loaded fine. I was only loading it with the HOF Mod, though.

BUT ...
It looks as if the standard game doesn't load AudioDefines.xml, at least on the Mac version.

Does your mod force it to load that file? Check the ~/Documents/Civilization IV/xml.log file to see what loads up. It may also give a clue about what's failing.

What does the OS X Crash Log say when it fails?

lazarillo
Apr 19, 2008, 10:32 AM
Various characters have special meanings in XML. You have to use "entity" escapes. Replace '&' with '&amp;', just as you would in HTML.


I did that with the standard AudioDefines.xml file and Civ4 loaded fine. I was only loading it with the HOF Mod, though.

BUT ...
It looks as if the standard game doesn't load AudioDefines.xml, at least on the Mac version.

Does your mod force it to load that file? Check the ~/Documents/Civilization IV/xml.log file to see what loads up. It may also give a clue about what's failing.

What does the OS X Crash Log say when it fails?

-----------

When I run it without any changes to the audio file, the xml.log file says the following:

=====================================
[84097.219] Loading XML file Assets//XML\GameInfo/CIV4PlayerOptionInfos.xml

[84097.223] Load XML file Assets//XML\GameInfo/CIV4PlayerOptionInfos.xml SUCCEEDED

[84097.223] SetGlobalClassInfo (Civ4PlayerOptionInfos/PlayerOptionInfos/PlayerOptionInfo)

[84097.230] Loading XML file Assets//XML\GameInfo/CIV4GraphicOptionInfos.xml

[84097.233] Load XML file Assets//XML\GameInfo/CIV4GraphicOptionInfos.xml SUCCEEDED

[84097.233] SetGlobalClassInfo (Civ4GraphicOptionInfos/GraphicOptionInfos/GraphicOptionInfo)

========================================

After making changes, it says:

========================================

[84428.454] Loading XML file Assets//XML\GameInfo/CIV4PlayerOptionInfos.xml

[84428.456] Load XML file Assets//XML\GameInfo/CIV4PlayerOptionInfos.xml SUCCEEDED

[84428.456] SetGlobalClassInfo (Civ4PlayerOptionInfos/PlayerOptionInfos/PlayerOptionInfo)

[84428.461] Loading XML file Assets//XML\GameInfo/CIV4GraphicOptionInfos.xml

[84428.463] Load XML file Assets//XML\GameInfo/CIV4GraphicOptionInfos.xml SUCCEEDED

[84428.463] SetGlobalClassInfo (Civ4GraphicOptionInfos/GraphicOptionInfos/GraphicOptionInfo)

========================================

It seems the audio define is not loaded in either case. I am not sure how to check my Mac OS X Crash Log.

Thanks!

AlanH
Apr 19, 2008, 10:56 AM
To look at the Crash report:

When the crash happens, you should get an "Unexpected Quit" type message. You can choose to Send Report in that window, and then you can view the details to see the crash report. You don't have to send it anywhere.

Alternatively, to look at previous crash reports:

Open /Applications/Utilities/Console.
Make sure you can see two columns, with a list of LOG options in the left column.
If not, click "Show Log List" top left.
In the left column, navigate to LOG FILES->~/Library/Logs->CrashReporter->Civilization IV.crash.log
If you are using Warlords, select Civilization IV Warlords.crash.log instead.
The right hand column will then list all the crash events for Civ4.
Scroll to the last one (near the bottom of the page).

Either way, highlight the first 100 lines or so of the report and copy/paste them into a post. Maybe we'll be able to get a clue about what's causing the problem.