Help with city base tile yields

korn469

Warlord
Joined
Aug 27, 2001
Messages
190
Hey I'm making a small mod, and I was wondering which xml documents included the values for the base square? Also is it possible to have a building add food to a city? Thanks!
 
I'm working on a tag for the City Plot Yields, Buildings can easily add Yield (it will not show up on the City Plot It instread apears on the building side bar). Use the <iYieldChanges> tag for example this

<YieldChanges>
<iYield>0</iYield>
<iYield>0</iYield>
<iYield>8</iYield>
</YieldChanges>

Is what makes the Palace give 8 Commerce
 
korn469 said:
Hey I'm making a small mod, and I was wondering which xml documents included the values for the base square?


I am not certain if this is what you want (it's not the tile yield after a city is made)

but the CIV4TerrainInfos.xml and CIV4FeatureInfos.xml define the original plots (before a city is made on them)





korn469 said:
Also is it possible to have a building add food to a city? Thanks!


yes you have to find this tagline in the BuildingsInfos.xml (or write it in):


Code:
			<YieldModifiers>
				[COLOR="Blue"]<iYield>15</iYield>[/COLOR]
				<iYield>0</iYield>
				<iYield>0</iYield>
			</YieldModifiers>


or this:


Code:
			<YieldChanges>
				[COLOR="Blue"]<iYield>1</iYield>[/COLOR]
				<iYield>0</iYield>
				<iYield>0</iYield>
			</YieldChanges>

The Blue Values are the food

I believe YieldModifers is a Percentage of Food (15% Food)

While the YieldModifers is the exact amount of food Bonus for that building (+1 Food)


just follow existing formats or YieldModifiers/YieldChanges in existing buildings
(ORDER is IMPORTANT in XML so place those taglines in their respective positions! :mischief: )


NOTE: You and use either YieldModifiers or YieldChanges (technically you can do both :D ) but only one is necessary... and depending what type of bonus you want .... percentage bonus vs straight bonus...

Hope that helps ;)
 
Yes I did find where to change the terrians before settling a city on them, but what I'd like to do is to change it so that the city base square doesn't provide any food. Then I was going to try the following two experiments, to make each citizen consume one food instead of two, and to make it so that cities didn't start out with any squares beside the city base square. That would mean that a size one city would starve if founded more than two tiles outside of your cultural borders. If the palace added one food, then the founding city wouldn't have a problem. However, I still haven't figured out how to do overseas colonization yet. That's what I'm trying to do, so the food consumption and city starting radius is in the global defines, and now I modify the palace. So any clue of to do this without having a python code that puts a building in every city that yields -2 food?
 
korn469 said:
Yes I did find where to change the terrians before settling a city on them, but what I'd like to do is to change it so that the city base square doesn't provide any food. Then I was going to try the following two experiments, to make each citizen consume one food instead of two, and to make it so that cities didn't start out with any squares beside the city base square. That would mean that a size one city would starve if founded more than two tiles outside of your cultural borders. If the palace added one food, then the founding city wouldn't have a problem. However, I still haven't figured out how to do overseas colonization yet. That's what I'm trying to do, so the food consumption and city starting radius is in the global defines, and now I modify the palace. So any clue of to do this without having a python code that puts a building in every city that yields -2 food?

I'm not sure if this will work, because typically cities and improvements don't like to be on the same plot, but perhaps use the python callback onCityBuilt to put an improvement on the plot called "City" (although you don't really need to call it anything), and this improvement gives -2 food yield.

Edit: Oh wait, you wanted to do it WITHOUT python. Sorry, my bad :P
 
korn469 said:
Yes I did find where to change the terrians before settling a city on them, but what I'd like to do is to change it so that the city base square doesn't provide any food. Then I was going to try the following two experiments, to make each citizen consume one food instead of two, and to make it so that cities didn't start out with any squares beside the city base square. That would mean that a size one city would starve if founded more than two tiles outside of your cultural borders. If the palace added one food, then the founding city wouldn't have a problem. However, I still haven't figured out how to do overseas colonization yet. That's what I'm trying to do, so the food consumption and city starting radius is in the global defines, and now I modify the palace. So any clue of to do this without having a python code that puts a building in every city that yields -2 food?


Well to make a long story short... In my (hopefully) upcoming mod I was dismayed that cities dont produce money when created...

I cant code python or SDK so I edit XML to meet my needs...

so I basically made two buildings... one building created in every capitol (1st city) of each different civ...

this building allows another "free building" in all cities created including and after the first building...



this "free building" provided the extra money to each city when created

getting the free building was based off of the Stonehedge (like getting free obelisks after stonehedge was created)

however I gave this "stonehedge" building (I did not have to make it a world wonder or national wonder btw...see below) to every civ starting the game... therefore my free money

but I made the cost of the buildings -1 where no one can create these buildings after the initial start up

Have I lost you yet? :crazyeye:


basically you can do this with your food "principle" by making a building that provides ANOTHER free building... this free building gives the -2 food for the city

it is relative easy to do....

add the buildings to CIV4BuildingInfos.xml and CIV4BuildingsClassInfos.xml

(and the art xml too - for Civilopedia graphics- but unless you know what your doing I would mess with the citylsystem.xml - graphics in the game)

the only tedious part is adding that "stonehedge" type building to EACH civilization in the CIV4CivilizationsInfos.xml

(copy and paste should shorten that out! :mischief: )


and presto! all cities automatically have the -2 food building when created since all civs get that free "stonehedge" building in their capitol and this "stonehedge" building provides all cities with the "free" -2 food building! :goodjob:


this sounds more complicated than it really is.... :eek:


there is probably an easier way to do this....

but my solution only messes with XML and doesnt alter gameplay... (where the AI is confused about what to build...since it is automatically given these buildings and can not tamper with that :lol: )


Hope that helps! ;)
 
Back
Top Bottom