Mod crashes on Init Audio

mee100

Chieftain
Joined
Aug 7, 2017
Messages
4
Hello --
This would, in-fact, be the first time that I actually post on this forum (though I have lurked here for years) so I apologize in advance if I make a mistake as I fairly sure I am posting in the correct place.

I have been working on a mod for Civilization IV: Colonization and it has been working for awhile now but upon implementing some sound stuff I cannot get the mod to load without crashing on "Init Audio."

Spoiler init.log :

[244843.078] DBG: CIV Init
[244843.078] VERSION: App: C:\Program Files (x86)\2K Games\Firaxis Games\Sid Meier's Civilization IV Colonization\Colonization.exe
[244843.078] VERSION: Build: Fri Feb 27 19:13:10 2009
[244843.078] VERSION: 1.0.0.1 (121000)
[244843.578] VERSION: Mod Loaded: C:\Users\Inivi_000\Documents\My Games\Sid Meier's Civilization IV Colonization\Mods\Epic Modular Mod\
[244843.578] DBG: FILE Cat Init


Spoiler xml.log :

[244843.828] Loading XML file xml\GameInfo/CIV4PlayerOptionInfos.xml
[244843.843] Load XML file xml\GameInfo/CIV4PlayerOptionInfos.xml SUCCEEDED
[244843.843] SetGlobalClassInfo (Civ4PlayerOptionInfos/PlayerOptionInfos/PlayerOptionInfo)
[244843.843] Loading XML file xml\GameInfo/CIV4GraphicOptionInfos.xml
[244843.843] Load XML file xml\GameInfo/CIV4GraphicOptionInfos.xml SUCCEEDED
[244843.843] SetGlobalClassInfo (Civ4GraphicOptionInfos/GraphicOptionInfos/GraphicOptionInfo)


The most recent addition I had made was to both AudioDefines and 3DAudioScripts wherein I added the following lines of code:

Spoiler AudioDefines :

<SoundData>
<SoundID>SND_CHINA_SELECT</SoundID>
<Filename>Sounds/Units/ChinaSelect</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>
<SoundData>
<SoundID>SND_China_ORDER</SoundID>
<Filename>Sounds/Units/ChinaOrder</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>


And then
Spoiler 3DAudioScripts :

<Script3DSound>
<ScriptID>AS3D_CHINA_SELECT</ScriptID>
<SoundID>SND_CHINA_SELECT</SoundID>
<SoundType>GAME_SPEECH</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>NONE</StartPosition>
<EndPosition>NONE</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>7000</iMinCutoffDistance>
<iMaxCutoffDistance>7000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.5</fMinWetLevel>
<fMaxWetLevel>0.5</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>
</Script3DSound>
<Script3DSound>
<ScriptID>AS3D_CHINA_ORDER</ScriptID>
<SoundID>SND_CHINA_ORDER</SoundID>
<SoundType>GAME_SPEECH</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>NONE</StartPosition>
<EndPosition>NONE</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>7000</iMinCutoffDistance>
<iMaxCutoffDistance>7000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.5</fMinWetLevel>
<fMaxWetLevel>0.5</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>
</Script3DSound>


I attempted to comment both of these out utilizing
Code:
<!--- this --->

But it did not rectify my issue. Am I missing something?

I'd like to thank anyone who responds in advance.
 
Well, fortunately, I managed to figure out what the problem file was through trial and error. It was AudioDefines.xml. Not sure if it was the inclusion of comments that messed it up or if it was the fact that I had put a tag in the wrong location. Trial and error is the best method, apparently.
 
Vanilla loops through all entries in a list, but it has an issue. It loops nodes while what it is really supposed to loop is elements. This means if the last node is a comment, it will continue the loop, skip past the comments and then work on the non-existing (NULL) element at the end, which will crash the game. In other words, it is possible to crash while reading xml files due to comment placement.
 
That is really informative. I did not know that comments could be so destructive. Thank you, sir!
 
Back
Top Bottom