Modding questions

ThunderMohawk

Chieftain
Joined
Sep 16, 2012
Messages
19
So far I've only been able to successfully mod happiness in buildings. I try to do the exact same things with culture and food but nothing happens.

This gave the colosseum 5 happiness and it worked.
<GameData>
<Buildings>
<Update>
<Set Happiness="5"/>
<Where Type="BUILDING_COLOSSEUM"/>
</Update>
</Buildings>
</GameData>


So I thought it would work the same like this for culture.
<GameData>
<Buildings>
<Update>
<Set Culture="12"/>
<Where Type="BUILDING_SHRINE"/>

</Update>
</Buildings>
</GameData>

It did nothing. Same for food and such. I'm having trouble figuring out how to code these things. It seems like the guides I find only give one example of one type of coding and just leave us to figure everything else out on our own. The modders guide. It tells how to edit the food and whatever of the granary and hospital but nothing about tech or culture or happiness. So I'm very confused.

How can I edit culture, tech, food, etc of buildings? Are there templates? Also how can I disable buildings from appearing? I see coding for deleting and disabling but don't know which I want. I want to make science buildings not buildable for a scenario I'm making where there's no research.
 
In Gods and Kings the <Culture> Tag no longer works. You have to use the BuildingYieldChanges table. Here is the Schema, from the XML file:

Code:
<Table name="Building_YieldChanges">
		<Column name="BuildingType" type="text" reference="Buildings(Type)"/>
		<Column name="YieldType" type="text" reference="Yields(Type)"/>
		<Column name="Yield" type="integer"/>
	</Table>

Using that table, you can edit culture and food yields of buildings. Here's an example:
Code:
<Row>
			<BuildingType>BUILDING_MONUMENT</BuildingType>
			<YieldType>YIELD_CULTURE</YieldType>
			<Yield>2</Yield>
		</Row>

Similar concept for food.

If you want to disable a building, then set cost to -1.
 
Ok I tried

<GameData>
<Row>
<BuildingType>BUILDING_MONUMENT</BuildingType>
<YieldType>YIELD_CULTURE</YieldType>
<Yield>4</Yield>
</Row>

</GameData>

It did nothing...

So then I tried
<GameData>
<Row>
<Update>
<BuildingType>BUILDING_MONUMENT</BuildingType>
<YieldType>YIELD_CULTURE</YieldType>
<Yield>4</Yield>
<Update>
</Row>

</GameData>

Neither made any change. I'm confused here.
 
That's because your code is specifying <Rows> without specifying which table. Do:

<GameData>
<Building_YieldChanges>
YOUR CODE
</BuildingYieldChanges>
</GameData>

The difference here is that now the code knows to modify rows in the "Building_YieldChanges" table, which is the table that dictates whether or not buildings give certain yields.
 
Ok I got the food and culture ones working. Thanks a lot! But are there templates for all these things? Like I'm unsure of how to know the coding for editing things. For example, how do I edit the costs of units and buildings? I get that you can set the cost to different things like -1 but do I just have to go in and find the unit's coding and build an update off that?
 
If you want to edit the costs of units and buildings just do <Update> <Set Cost=whatever/> <Where Type=whatever/> </Update> in the relevant table ("Units" and "Buildings", respectively). At the beginning of every XML file, the table schema is defined, so you can look at each one and figure out what each table does.
 
Ok I tried this and somehow all it did was change the cost of a watermill to 3 production. So then I tried putting "SetCost" and "WhereType" but under the "=" sign it said missing required white space. What does that mean? I'm just trying to change the production cost and maintenance cost right now.


<GameData>
<Buildings>
<Update>
<Set Cost="5"/>
<Where Type="BUILDING_WATERMILL"/>
</Update>
</Buildings>
</GameData>
 
If you've changed

Code:
<Set Cost="5"/>

to (the incorrect)

Code:
<SetCost="5"/>

the error is telling you that it needs the space back between Set and Cost

Given that the cost (ie how many hammers it takes) of most buildings is in the hundreds, 3 hammers for a cost of 5, depending on the game speed, is probably correct.

Do you actually want to change GoldMaintenance?
 
Back
Top Bottom