Fix for crashes when using Varietas Delectat

Leoreth

KEL
Retired Moderator
Joined
Aug 23, 2009
Messages
38,559
Location
Faraway Town
I found a bug in the VD module that can lead to a crash (whenever Italy is on the map). I'm currently in the process of updating the DoC installers to fix it. If you already have VD installed (no matter which way), you can download the attached file instead and unpack it into your DoC folder.

I also looked into the issue with too long files that some people ran into when installing DoC. As it turned out, those files were completely unnecessary for the module to function because they are already contained in an FPK file. So no need to worry if that happened to you. I will remove them from subsequent releases.
 

Attachments

Thanks!
I never ran into any game-crashing errors, but it's good to know it's fixed.
 
Out of curiosity, I downloaded the patch. I see it is about a (VD_Italian_)CIV4UnitArtStyleTypeInfos.

I see that you are using this way of commenting out an unused entry:
Spoiler :
Code:
				<!--StyleUnit>
					<UnitType>UNIT_TANK_DESTROYER</UnitType>
--- cut ---
				</StyleUnit-->
Is this style proven to be better than the simple
Spoiler :
Code:
				<!--
				<StyleUnit>
					<UnitType>UNIT_TANK_DESTROYER</UnitType>
--- cut ---
				</StyleUnit>
				-->
?

Recently, I discovered in my mod that this simple way of commenting out in my UnitArtStyleTypeInfos file was preventing the following uncommented entry to be read by the game.

I saw the same behaviour in a CivilizationInfos file. Since, I deleted the unused entries in the file (although putting them all at the end would be enough I think).

Just wondering. :coffee:
 
I think comments are very user unfriendly in XML, there's always a lot to type. Using the pre-existing pointy brackets always seemed logical to me because you usually want to remove an entire entry or element, and I kind of inferred this is the reason that comments are how they are.

I've never run into parser problems with this (can't even imagine how it would tell the difference), but if it's a source of errors I will keep it in mind for later.
 
Tested with both styles of commenting out:

same result, the parser does not make a difference but unfortunately it means that it stops reading the entries when it finds a comment. In other words, all subsequent non-commented entries are simply ignored. Same behaviour was happening in the CivilizationInfos file.

This reminds me of a note by Afforess saying that we should avoid comments in XML nested tags (sub-tags). Comments in-between <Type> and <StyleUnits> are probably OK but not in-between <StyleUnit> tags. "Real" comments or entries commented out give the same unfortunate result.

Tested on my mod and it's non-modular but I suppose that it doesn't make a difference.
 
Tested with both styles of commenting out:

same result, the parser does not make a difference but unfortunately it means that it stops reading the entries when it finds a comment. In other words, all subsequent non-commented entries are simply ignored. Same behaviour was happening in the CivilizationInfos file.
Wait, do you mean that if I have
Code:
<!--Text>Some text</Text-->

<Text>Next text</Text>
The "Next text" entry will be ignored? I'm using this comment type often to disable things in XML files and never ran into this problem.
 
I also insert comments in XML. In Text files, if it's done line by line, it's OK.

Some files are particularly itchy about comments though. I tried to give an example about how the parser does not like to have comments in-between "nested tags", like <StyleUnit> inside of <StyleUnits> inside of <UnitArtStyleTypeInfo>.

Other ones that I know are the CivilizationInfos, DiplomacyInfos and the LeaderHeadInfos files. I've read that the Audio XML files do not support any comments inside them.

I've never seen a definitive guide on this, it's just accumulated experience and reading, the good old trial and error system! :cry:
 
Okay, thanks, I will keep that in mind in case I ever run into inexplicable parsing errors :)
 
Back
Top Bottom