Help with xml schema issue

saltbush

Chieftain
Joined
Apr 29, 2006
Messages
50
I've been playing around with some basic modding and have been trying to add this tag to pastures and plantations
Code:
<IrrigatedYieldChange>
	<iYield>1</iYield>
	<iYield>0</iYield>
	<iYield>0</iYield>
</IrrigatedYieldChange>

However this brings up an error due to the schema, and my only fix seems to be changing the schema from
Code:
	<element type="PrereqNatureYields" minOccurs="0"/>
	<element type="YieldChanges" minOccurs="0"/>
	<element type="RiverSideYieldChange" minOccurs="0"/>
	<element type="HillsYieldChange" minOccurs="0"/>
	<element type="IrrigatedYieldChange" minOccurs="0"/>
	<element type="bHillsMakesValid"/>
	<element type="bFreshWaterMakesValid"/>
	<element type="bRiverSideMakesValid"/>
	<element type="bNoFreshWater"/>
	<element type="bRequiresFlatlands"/>
	<element type="bRequiresRiverSide"/>
	<element type="bRequiresIrrigation"/>
	<element type="bCarriesIrrigation"/>
	<element type="bRequiresFeature"/>
	<element type="bWater"/>
	<element type="bGoody"/>
	<element type="bPermanent"/>
	<element type="bUseLSystem" minOccurs="0"/>
	<element type="iTilesPerGoody"/>
	<element type="iGoodyRange"/>
	<element type="iUpgradeTime"/>
	<element type="iAirBombDefense"/>
	<element type="iDefenseModifier"/>
	<element type="iPillageGold"/>
	<element type="TerrainMakesValids"/>
	<element type="FeatureMakesValids"/>
	<element type="BonusTypeStructs" minOccurs="0" maxOccurs="*"/>
	<element type="ImprovementPillage"/>
	<element type="ImprovementUpgrade"/>
	<element type="TechYieldChanges"/>
	<element type="RouteYieldChanges"/>
	<element type="WorldSoundscapeAudioScript" minOccurs="0"/>
	<element type="bGraphicalOnly"/>
to this
Code:
		<element type="HillsYieldChange" minOccurs="0"/>
		<element type="IrrigatedYieldChange" minOccurs="0"/>
		<element type="bHillsMakesValid" minOccurs="0"/>
		<element type="bFreshWaterMakesValid" minOccurs="0"/>
		<element type="bRiverSideMakesValid" minOccurs="0"/>
		<element type="bNoFreshWater" minOccurs="0"/>
		<element type="bRequiresFlatlands" minOccurs="0"/>
		<element type="bRequiresRiverSide" minOccurs="0"/>
		<element type="bRequiresIrrigation" minOccurs="0"/>
		<element type="bCarriesIrrigation" minOccurs="0"/>
		<element type="bRequiresFeature" minOccurs="0"/>
		<element type="bWater" minOccurs="0"/>
		<element type="bGoody" minOccurs="0"/>
		<element type="bPermanent" minOccurs="0"/>
		<element type="bUseLSystem" minOccurs="0"/>
		<element type="iTilesPerGoody" minOccurs="0"/>
		<element type="iGoodyRange" minOccurs="0"/>
		<element type="iUpgradeTime" minOccurs="0"/>
		<element type="iAirBombDefense" minOccurs="0"/>
		<element type="iDefenseModifier" minOccurs="0"/>
etc

This seems really messy and also lengthens my loading times (at least i think it does). Having said that it does actually work and creates no errors in the game itself.

If anyone has a cleaner solution i'd love to hear it.

thanks
 
saltbrush, I agree with you that almost all of the definitions found in the schema should have the minOccurs="0". The rational behind not including them I believe was to help people understand what the valid tags are in each XML object without having to open up the schema file. This way people wouldn't be confused when comparing one unit info definition to another.
 
the bit i dnt seem to understand is why a farm can have the irrigation tag part but no other improvement can, i can't see anything in the schema that defines that, if i could find that bit i could make it a little cleaner
 
Adding a tag that wont give you a loading error just requires a change in the Schema, but the game will ignore it without a change to the Source Code. I am not shure but I think the effects of irrigations are hardcoded in some way.
 
strange thing is it actually works with my changes posted above, ie a bunch of cows that get irrigated give +1 food, however i had to add all those stupid minoccurs = 0 stuff,

so i'm still fairly sure its an xml issue rather than sdk or python
 
Back
Top Bottom