• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Styrbiorn

Vexillophilite
6 Badges
Nov 2, 2001
4.807
5.262
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Rome Gold
  • Sengoku
  • 500k Club
This little guide gives you a little help in debugging this project. I presuppose autosave is set to yearly so we have a fresh save file to use to track the error. First you should test to load the save file. Some errors are found by the compiler when loading the game, and notifies with an error message. This is most often _not_ the case though. The most frequent causes of CtD:s we can find by modding are these:

Events. Events may cause CtD of various different reasons. Teh solution is obviously to make sure the events are correct (there are other ways guides to that sp I won't include it). If you don't know which event it is that causes the CtD, do like this: open the save file and find the event part (after the history). It looks something like this:
Code:
sleepevent = { 17182 15297 15645...<cut>..18980 } event = "db\events\aon\major_ade.txt" event = "db\...
Rearrange this so each event inclusion is on a single line and comment it away (the # sign will make that particular event file not included), so it look like this:
Code:
sleepevent = { 17182 15297 15645...<cut>..18980 } [color=green]
#event = "db\events\aon\major_ade.txt" 
#event = "db\events\aon\major_arg.txt" 
#event = "db\...
[/color]
Now the not so funny part, by only implementing one or a few event files at a time, you can find the file causing the error. This is also a way of figuring out if it's events or not that causes the Ctd - if every event file is commented and it still crashes, you can be sure the error is not in the events.

An error that is hard to find is if an event has the command wakemonarch which = ID, but instead of a monarch's ID a leader's ID is used. This error is not found when the game compiles the event files. Instead the leader is actually awaken as a monarch. This do not make the game crash immidiately, which makes things harder. However if you reload the save file, the compiler will note that a leader is used as a monarch and note it with a message.

ID conflicts between leaders and/or monarchs will cause problems, and are hard to find. As of now, we don't have a parser to check this (rumor says it's on the way though:)) so we have to do this manually. A way to do this is to load the game and the surrender ASAP. If there are any ID conflicts in the loaded monarch and leaders files, the regular end screen will not stay, instead the program CtDs. This trick worked in 1.05, although I don't know if it works for later patches.


Rebels. Rebels are to be suspected when you can't find anything wrong in the save file and you have made sure no events are causing the CtDs (by doing as described above). Especially the case when the game crashes on the _first_ of the same month over and over again how many times you reload it. To find out if a rebel is causing the problem, you can reload the save file and see if there is an area that is prone to declare itseld independent. If so, open the revolt.txt file in the DB folder, find that revolter and comment it away, like this:

Code:
FRA = {
	date = { day = 1 month = january year = 1419 }
	expirydate = { day = 31 month = december year = 1914 }
	minimum = { 385 376 383 384 386 408 409 410 411 412 413 419 420 }
	extra = { }
	capital = 385
	group = latin
	ai = "aon_France.ai"
	}
[COLOR=green]
#ANN = {
#	date = { day = 1 month = january year = 1830 }
#	expirydate = { day = 31 month = december year = 1850 }
#	minimum = { 41 }
#	extra = { 28 }
#	capital = 41
#	group = orthodox
#	}#rio Grande[/COLOR]
AQU = {
	date = { day = 1 month = january year = 1419 }
	expirydate = { day = 31 month = december year = 1914 }
	minimum = { 563 }
	extra = {  }
	capital = 563
	group = muslim
        ai = "aon_india.ai"
	}

Then reload and see if the game crashes or not. If not, you can be sure this revolter is the problem. The reason that a rebel can crash the game is the files that are loaded when a revolter joins the game, ie the flag and shield files, the monarch file and the leader file. Some of these has an error. Try to find it, correct it and reload to see if it works with the revolter (ie first remove the comment signs - the '#'s).

Another error is scenario file errors, like when several countries are set to control the same province - that error is not found by the compiler, but when the province changes hands we will have a CtD. I don't think we have any more errors like these, but I listed it anyway. (Using the Scenario editor and load the project may find errors like these).


There are probably more errors and ways to find them, so please do post if you know anything about such things.
 
Last edited:
A single letter on the wrong spot might ruin the game totally. These are hard to find often put there by mistake, especially vulnerable files are the monarch- & leader-files and revolt.txt...

I once accidentily put an unfinished leader in the leader-file resulting in that I had to scan through all leader files... the same thing happend to me in the revolt.txt --> the game freezes when loading...

Code:
[color=white]EIR = {
	date = { day = 1 month = january year = 1400 }
	expirydate = { day = 31 month = december year = 1800 }
	minimum = { 234 }
	extra = { 235 231 233 243 246 250[/color][color=red]S[/color][color=white] }
	capital = 234
	group = latin
	}[/color]

However, all of these error are pre-scenario-errors (the game will never reach the first menu)