Help with XML not loading

Jifanodd

Chieftain
Joined
Apr 27, 2018
Messages
21
I'm trying to put up my first mod that modifies Campus buildings. I used another mod as basis and removed everything I didn't need. I've set up the modinfo file and two XML files, one changing the number of Citizen slots and the other changing the science yield of campus buildings.

So far the mod loads and changes in CitizenSlots.xml are visible in game so that works. But loading the BuildingYields.xml produces the following error in database.log:

[1539127.681] [Gameplay] ERROR: Database::XMLSerializer (BuildingYields.xml): 'Row' or 'Delete' expected, got 'Building_YieldChanges'.
[1539127.681] [Gameplay]: In XMLSerializer while updating table Buildings from file BuildingYields.xml.


Contents of the xml are:

<GameInfo>

<Buildings>
<Building_YieldChanges>
<Update>
<Where BuildingType="BUILDING_LIBRARY"/>
<Set YieldChange="4"/>
</Update>
<Update>
<Where BuildingType="BUILDING_UNIVERSITY"/>
<Set YieldChange="6"/>
</Update>
<Update>
<Where BuildingType="BUILDING_MADRASA"/>
<Set YieldChange="7"/>
</Update>
<Update>
<Where BuildingType="BUILDING_RESEARCH_LAB"/>
<Set YieldChange="8"/>
</Update>
</Building_YieldChanges>
</Buildings>

</GameInfo>


Running the vanilla version with no other mods enabled. Can anybody tell what goes wrong?
 
Remove the "<Buildings>" and "</Buildings>" tags, it tells the game to uptade the "Buildings" table while you want to update the "Building_YieldChanges" table.
 
You have building_YieldChanges inside buildings, which is not correct, to alter Buildings is one thing, to alter the YieldChanges is another.

code sample:
Code:
<Buildings>
  <Update>
    <Where BuildingType="BUILDING_LIBRARY"/>
    <Set Cost="1"/>
  </Update>
</Buildings>
<Building_YieldChanges>
  <Update>
    <Where BuildingType="BUILDING_LIBRARY"/>
    <Set YieldChange="4"/>
  </Update>
</Building_YieldChanges>
 
Thanks for both of you for quick answers, that was the error indeed. Oh, the delight of achieving small things!
 
Back
Top Bottom