[SDK] LoadXml failed for PlayerOptions and GraphicsOptions

Maniac

Apolyton Sage
Joined
Nov 27, 2004
Messages
5,603
Location
Gent, Belgium
For Planetfall I wanted to add some extra options for invisibility types, eg an invisibility type for native life which only makes them invisible on fungus features.

Therefore I harvested code from Conqueror's Delight which allows exactly that. Conqueror's Delight removes CIV4InvisibilityInfos.xml from BasicInfos, and adds a new file to GameInfo with the same name.

I did the related code changes too, but now, when I try to load the game, I get an error saying the PlayerOptionInfos.xml and GraphicsOptionInfos.xml failed to load, upon which the game crashes.

Does anyone have a clue what could cause this problem?? :confused:

Edit: When using an older DLL, the error still occurs. The problem lies somewhere in what I added in GameInfoSchema. If I remove this, the error disappears. I can't see why this could cause issues though. :confused:

Code:
	<ElementType name="Civ4InvisibleInfos" content="eltOnly">
		<element type="InvisibleInfos" minOccurs="1" maxOccurs="1"/>
	</ElementType>
	<ElementType name="InvisibleInfos" content="eltOnly">
		<element type="InvisibleInfo" minOccurs="0" maxOccurs="*"/>
	</ElementType>
	<ElementType name="InvisibleInfo" content="eltOnly">
		<element type="bPermanent" minOccurs="0"/>
		<element type="bFullHealth" minOccurs="0"/>
		<element type="InvisibleOnTerrains" minOccurs="0"/>
		<element type="InvisibleOnFeatures" minOccurs="0"/>
	</ElementType>
	<ElementType name="bPermanent" content="textOnly" dt:type="boolean"/>
	<ElementType name="bFullHealth" content="textOnly" dt:type="boolean"/>
	<ElementType name="InvisibleOnTerrains" content="eltOnly">
		<element type="InvisibleOnTerrain" minOccurs="0"/>
	</ElementType>
	<ElementType name="InvisibleOnFeatures" content="eltOnly">
		<element type="InvisibleOnFeature" minOccurs="0"/>
	</ElementType>
	<ElementType name="InvisibleOnTerrain" content="eltOnly">
		<element type="TerrainType"/>
		<element type="bInvisible"/>
	</ElementType>
	<ElementType name="TerrainType" content="textOnly"/>
	<ElementType name="bInvisible" content="textOnly" dt:type="boolean"/>
	<ElementType name="InvisibleOnFeature" content="eltOnly">
		<element type="FeatureType"/>
		<element type="bInvisible"/>
	</ElementType>
 
Looking at the CIV4GlobalTypesSchema.xml file, I see that each element type is declared with an <ElementType> before being used as a type="<type>" attribute of an <element>. Try reordering your definitions.
 
I can almost say 100% that you have declared an element in the schema which already existed. Duplicate definitions in the Schema cause the entire thing to collapse and fail horribly.

And I've done lots of Schema entries with the order all bungled around, so that part isn't important. Order only matters when listing out what the subelements will be (order has to match between Schema and base XML)
 
Thanks. There already was a bPermanent tag.

And I've done lots of Schema entries with the order all bungled around, so that part isn't important. Order only matters when listing out what the subelements will be (order has to match between Schema and base XML)

Even that can be avoided by setting the minimum occurence of a tag to 0 AFAIK.
 
I had thought that as well, but relative order still matters most of the time. I have been able to place <button> anywhere that I want to, which is most confusing and slightly vexing. I would love to know how/why on that one so that I wouldn't have to worry about order for so many other things.
 
Back
Top Bottom