Trying to modify the Dome improvement's maintenance and tech yield bonus, not working

Galgus

Emperor
Joined
Aug 22, 2012
Messages
1,705
I tried to copy an old Civ 5 mod's method of seemingly deleting and replacing code relevant to the Dome, but it doesn't seem to be doing anything.

I've only been looking at the tech web listed yields to test whether or not it worked - do those automatically update to reflect changed yields, or are they some other text file?

This is my XML.

<GameData>

<Improvements>
<Delete ImprovementType="IMPROVEMENT_DOME" />
<Row>
<ImprovementType>IMPROVEMENT_DOME</ImprovementType>
<EnergyMaintenance>0</EnergyMaintenance>
</Row>
</Improvements>

<Improvement_TechYieldChanges>
<Delete ImprovementType="IMPROVEMENT_DOME" />

<Row>

<ImprovementType>IMPROVEMENT_DOME</ImprovementType>
<TechType>TECH_BIOSPHERES</TechType>
<YieldType>YIELD_Food</YieldType>
<Yield>1</Yield>

</Row>
</Improvement_TechYieldChanges>

</GameData>
 
I'm not sure how to open the db file properly, or what program would be safe to get.
 
Code:
<Improvements>
   <Delete ImprovementType="IMPROVEMENT_DOME" />
   <Row>
       <ImprovementType>IMPROVEMENT_DOME</ImprovementType>
       <EnergyMaintenance>0</EnergyMaintenance>
   </Row>
</Improvements>

First problem here is that there is no column named "ImprovementType" in the <Improvements> table, so your delete function is looking for something that does not exist.
It should be Type="IMPROVEMENT_DOME" instead.

Secondly, deleting that row would delete the *entire* row and everything in it, including the Description, Help, Civilopedia, ArtDefineTag, IconAtlas, PortraitIndex, PillageEnergy, EnergyMaintainance, BuildableOnAnyResource, CityHP & RemovesArtifactResource entries.
If you did it that way you'd need to add back in values for all those other columns too in the new row you're creating, as well as a value for EnergyMaintenance.

A simpler way to do it is to use an Update command to change just the value of EnergyMaintenance inside that row, but leave the rest of the row alone. No need to delete anything then.

Code:
<GameData>
  <Improvements>
      <Update>
          <Where Type="IMPROVEMENT_DOME"/>
          <Set EnergyMaintenance="0"/>
      </Update>
   </Improvements>
</GameData>
 
I'm not sure how to open the db file properly, or what program would be safe to get.

I just tend to either open the db files in notepad or drag and drop it into my active project in Modbuddy, then just use it as a reference without actually editing it. Modbuddy tends to be the superior option since it has all the color highlighting that most ide's do, which makes readability better. You can also drag the active windows main bar to pull the window out of modboddy as a popout, which makes it a lot easier to compare on the fly with another of your files :)
 
First problem here is that there is no column named "ImprovementType" in the <Improvements> table, so your delete function is looking for something that does not exist.
It should be Type="IMPROVEMENT_DOME" instead.

Secondly, deleting that row would delete the *entire* row and everything in it, including the Description, Help, Civilopedia, ArtDefineTag, IconAtlas, PortraitIndex, PillageEnergy, EnergyMaintainance, BuildableOnAnyResource, CityHP & RemovesArtifactResource entries.
If you did it that way you'd need to add back in values for all those other columns too in the new row you're creating, as well as a value for EnergyMaintenance.

A simpler way to do it is to use an Update command to change just the value of EnergyMaintenance inside that row, but leave the rest of the row alone. No need to delete anything then.

Code:
<GameData>
  <Improvements>
      <Update>
          <Where Type="IMPROVEMENT_DOME"/>
          <Set EnergyMaintenance="0"/>
      </Update>
   </Improvements>
</GameData>

That worked perfectly, thanks!

I'm still not sure how to modify the Biospheres tech yield change.

I made these two attempts, but they seemed to make the mod as a whole not load despite the functional portion you showed:

<Improvement_TechYieldChanges>

<Techtype>Tech_Biospheres</Techtype>

<Update>
<Where Type="IMPROVEMENT_DOME"/>
<Set Yield_Food="1"/>
</Update>

<Update>
<Where Type="IMPROVEMENT_DOME"/>
<Set Yield_Energy="0"/>
</Update>

</Improvement_TechYieldChanges>

_______________________________________
<Improvement_TechYieldChanges>

<Update>

<ImprovementType>IMPROVEMENT_DOME</ImprovementType>
<TechType>TECH_BIOSPHERES</TechType>
<YieldType>YIELD_ENERGY</YieldType>
<Yield>0</Yield>

</Update>

<Update>

<ImprovementType>IMPROVEMENT_DOME</ImprovementType>
<TechType>TECH_BIOSPHERES</TechType>
<YieldType>YIELD_Food</YieldType>
<Yield>1</Yield>

</Update>

</Improvement_TechYieldChanges>
 
Spent a bit of time looking at this issue for you, the following code snippet should achieve what you are after...

Code:
<Improvement_TechYieldChanges>

	<Update>
		<Where ImprovementType="IMPROVEMENT_DOME" TechType="TECH_BIOSPHERES" YieldType="YIELD_ENERGY"/>
		<Set Yield="0"/>
	</Update>

	<Row>
		<ImprovementType>IMPROVEMENT_DOME</ImprovementType>
		<TechType>TECH_BIOSPHERES</TechType>
		<YieldType>YIELD_FOOD</YieldType>
		<Yield>1</Yield>
	</Row>

</Improvement_TechYieldChanges>

In your first scenario, you are trying to update YIELD_FOOD which doesnt exist, in the second one you are trying to put in a YIELD_ENERGY which already exists. You are also trying to Set Yield_Food and Yield_Energy in your first try, which while not likely to cause an error, it will not have the desired results, since YieldTypes are strings and not integers; so when you Set YieldTypes to "1" you are setting it as the string "1" not the number 1. Instead you should be setting Yields.
 
Thanks for the help!

I hadn't thought in terms of creating a yield for food and changing it for Energy.

The game displays Energy: 0 as a yield, but I'm happy with it being functional.

I'll have to remember this for any future improvement modding.
 
Back
Top Bottom