Error after adding a unit

FinlandGamer

Chieftain
Joined
Aug 1, 2011
Messages
66
Location
Vantaa, Finland
After i added a new unit to BTS 3.19 mod, the game won't start. Loader gets all the way to "init XML (uncached)", then it stops and Windows 7 gives me "Civilization IV Has Stopped Working."

Base Game works fine, it's only this mod. I've removed the new unit, but the problem persist.

BTS creates 4 .log's, (Documents\My Games\Beyond the Sword\Logs)
init.log
Spoiler :
Code:
[9681.578] DBG: CIV Init
[9681.578] VERSION: App: E:\User's Files\Games\Civilization IV\Beyond the Sword\Civ4BeyondSword.exe
[9681.578] VERSION: Build: Thu May 14 17:17:10 2009
[9681.578] VERSION: 3.1.9.0 (128100)
[9688.473] VERSION: Mod Loaded: mods\Cold War\
[9688.473] DBG: FILE Cat Init

PythonErr2.log
Spoiler :
Code:
sys.path = ['..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\email', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\encodings', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\build', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\py', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\colourchooser', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\editor', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\floatcanvas', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\masked', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\mixins', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\ogl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\af', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ca', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\cs', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\da', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\de', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\el', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\es', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\eu', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fi', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fr', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hi', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hu', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\id', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\it', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ja', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\lv', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nb', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pt_BR', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ru', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sv', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\tr', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\uk', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_CN', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_TW', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\af\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ca\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\cs\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\da\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\de\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\el\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\es\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\eu\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fi\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fr\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hi\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hu\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\id\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\it\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ja\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\lv\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nb\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pt_BR\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ru\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sv\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\tr\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\uk\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_CN\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_TW\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\py\\tests', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools\\XRCed', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools\\XRCed\\src-images', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM']

sys.modules = {'zipimport': <module 'zipimport' (built-in)>, 'signal': <module 'signal' (built-in)>, '__builtin__': <module '__builtin__' (built-in)>, 'sys': <module 'sys' (built-in)>, '__main__': <module '__main__' (built-in)>, 'exceptions': <module 'exceptions' (built-in)>, 'CvPythonExtensions': <module 'CvPythonExtensions' (built-in)>}

sys.builtin_module_names = ('CvPythonExtensions', '__builtin__', '__main__', '_bisect', '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr', '_codecs_tw', '_csv', '_heapq', '_hotshot', '_locale', '_multibytecodec', '_random', '_sre', '_subprocess', '_symtable', '_weakref', '_winreg', 'array', 'audioop', 'binascii', 'cPickle', 'cStringIO', 'cmath', 'collections', 'datetime', 'errno', 'exceptions', 'gc', 'imageop', 'imp', 'itertools', 'marshal', 'math', 'md5', 'mmap', 'msvcrt', 'nt', 'operator', 'parser', 'regex', 'rgbimg', 'sha', 'signal', 'strop', 'struct', 'sys', 'thread', 'time', 'xxsubtype', 'zipimport')
load_module CvEventInterface
load_module CvUtil
load_module traceback
load_module CvEventManager
load_module CvScreensInterface
load_module CvMainInterface
load_module ScreenInput
load_module CvScreenEnums
load_module time
load_module CvDomesticAdvisor
load_module CvTechChooser
load_module CvForeignAdvisor
load_module math
load_module CvExoticForeignAdvisor
load_module IconGrid
load_module DomPyHelpers
load_module PyHelpers
load_module TechTree
load_module re
load_module CvMilitaryAdvisor
load_module CvFinanceAdvisor
load_module CvReligionScreen
load_module CvCorporationScreen
load_module CvCivicsScreen
load_module string
load_module CvVictoryScreen
load_module CvEspionageAdvisor
load_module CvOptionsScreen
load_module CvReplayScreen
load_module CvHallOfFameScreen
load_module CvDanQuayle
load_module CvGameUtils
load_module CvUnVictoryScreen
load_module CvDawnOfMan
load_module CvTechSplashScreen
load_module CvTopCivs
load_module random
load_module CvInfoScreen
load_module CvIntroMovieScreen
load_module CvVictoryMovieScreen
load_module CvWonderMovieScreen
load_module CvEraMovieScreen
load_module CvSpaceShipScreen
load_module CvPediaMain
load_module CvPediaScreen
load_module CvScreen
load_module CvPediaTech
load_module CvPediaUnit
load_module CvPediaBuilding
load_module CvPediaPromotion
load_module CvPediaUnitChart
load_module CvPediaBonus
load_module CvPediaTerrain
load_module CvPediaFeature
load_module CvPediaImprovement
load_module CvPediaCivic
load_module CvPediaCivilization
load_module CvPediaLeader
load_module CvPediaSpecialist
load_module CvPediaHistory
load_module CvPediaProject
load_module CvPediaReligion
load_module CvPediaCorporation
load_module CvWorldBuilderScreen
load_module Popup
load_module CvWorldBuilderDiplomacyScreen
load_module CvDebugTools
load_module CvDebugInfoScreen
load_module CvMapGeneratorUtil
load_module CvGFCScreen
load_module CvPopupInterface
load_module CvScreenUtilsInterface
load_module CvScreenUtils
init-ing world builder screen
load_module CvWBPopups
load_module CvCameraControls
load_module CvAdvisorUtils
PY:OnInit
load_module CvAppInterface

resmgr.log, but it's empty.

and xml.log
Spoiler :
Code:
[9690.142] Loading XML file xml\GameInfo/CIV4PlayerOptionInfos.xml
[9690.220] Load XML file xml\GameInfo/CIV4PlayerOptionInfos.xml SUCCEEDED
[9690.220] SetGlobalClassInfo (Civ4PlayerOptionInfos/PlayerOptionInfos/PlayerOptionInfo)
[9690.220] Loading XML file xml\GameInfo/CIV4GraphicOptionInfos.xml
[9690.236] Load XML file xml\GameInfo/CIV4GraphicOptionInfos.xml SUCCEEDED
[9690.236] SetGlobalClassInfo (Civ4GraphicOptionInfos/GraphicOptionInfos/GraphicOptionInfo)

Any idea what's the problem?
 
The problem shouldn't persist if everything is back to default.

The most likely case: You added the unit in the Units\UnitInfos.xml, but what you put there as ART_DEF_XYZ entry doesn't match what you put into XML\Art\ArtDefines_units.xml.

....and in case you have no idea what I'm talking about, then you should read this tutorial.
 
I've added 150+ units to my mod, so i am familiar with the process of adding units.
And i wonder could i have accidently removed a reference to a certain .xml file, that is causing the error.

I've attached XML files of my files, if someone wants to take a look.
 
This is odd, simply adding a unit does not normally create a crash like this. Did you do anything else prior to the crash? or was it working, then added unit, then it crashed?
2.)Which files did you alter prior to the crash? was it just unitinfos, unitclassinfos, artdefines_unit?
3.)why is CIV4UnitSchema.xml in the units folder, have altered anything in it?
4.) What unit did you add, and where in the unitinfos.xml at the beginning, end or near some similar units (to help me narrow my search).
 
1. Game worked perfectly before adding T-62.

2. CIV4UnitInfos.xml, CIV4CivilizationInfos.xml, CIV4GameText_Objects_BTS.xml, CIV4ArtDefines_Unit.xml

3. CIV4UnitSchema.xml was used for Dale's Combat Mod v1.9, but i've removed it about a month ago. I've seem to forgot to delede that file. I've added many units after deleting DCM, and they all have worked.

4. I copied Modern Armor's entry, and edited it for the T-62 (But i removed entries out of all edited .xml's, when the problem started.) I pasted the modified Modern Armor entry under the original entry.

I created a new mod, and added T-62 there, game started up all fine. So it's not the model.
 
The crash is caused by SpecialUnitInfos.xml,
Code:
 <SpecialUnitInfo>
			<Type>SPECIALUNIT_FOOTSOLDIER</Type>
			<Description>Marines, Paratroopers, Infantry, Artillery and AT Infantry</Description>
			<bValid>1</bValid>
                        <bCityLoad>0</bCityLoad>
                        <CarrierUnitAIs/>
			<ProductionTraits/>
		</SpecialUnitInfo>

When this code is removed it goes through to XML load error SPECIALUNIT_FOOTSOLDIER not found but the crash to desktop is caused by the code above.
 
Means you still have units with SPECIALUNIT_FOOTSOLDIER still in UnitInfos.xml
 
Means you still have units with SPECIALUNIT_FOOTSOLDIER still in UnitInfos.xml
I removed that code from SpecialUnitInfos.xml, and i got XML load error "SPECIALUNIT_FOOTSOLDIER not found", but i still crashed to desktop.

Ah yes, it still crashes to desktop if SPECIALUNIT_FOOTSOLDIER is removed from unitinfos.xml, Played around with it a bit more today and the xml files are in a bad way.
There's no quick fix that I can see.
I'd say UnitInfos.xml is corrupted, (probably caused by the first crash)
I would replace it with the backup (or if no backup redo it) and try to get just the UnitInfos.xml UnitClassInfos.xml, ArtDefines_Unit.xml to load, and add the rest later.
 
There's no quick fix that I can see.

My last backup is about seventy units ago, and i've already started the mod from scatch. For a while i've wanted to rebuild the mod with Advanced Diplomacy. This time i'll make more regular backups.

But well, thanks for trying.
 
Top Bottom