+50% Production in Capital with Railroad

PinkHammurabi

Warlord
Joined
Jul 11, 2008
Messages
249
Location
Sewell, NJ (but from Philly!)
First off, mods, if this thread is in the wrong area I apologize; I had looked and this seemed to be the most appropriate place, but if I'm wrong feel free to move it. Thank you.

Now, what I'm looking for is someone to tell me what to add or change in order to have the Capital gain the 50% production increase that other cities get when they are connected via railroad/harbor trade routes. I'm okay with the bonus either coming immediately upon discovery or when the first city is appropriately connected.

I have only very basic knowledge and understanding of game file manipulations (changing default city names, editing Wonder effects, etc.), so any instructions can't be that complicated.

Of course, providing a file that I can use as a replacement for an existing file is also welcome.

Any help regarding this matter is greatly appreciated. Thank you.

--
P.S. Is there an edit for making Angkor Wat affect the entire empire instead of just the city it's built in? Which leads me to ask: Is the effect wrong or is the tooltip wrong?

Thanks again.
 
I would like to see a Station building, where you get the bonus if you build the Station.
 
@PinkHammurabi:
A good idea, but as far as I can see, there is no simple way to mod what you're asking. There is nothing that you can attach that 50% production bonus to when Railroads are discovered such that it only affects the capital. And I don't know of a way to trigger something like that when a city first gets its railroad bonus, either.

The simplest way that I can imagine this working is to add a new building, like Montov's "Railroad Station", which has the 50% Production bonus. I'm not even sure if it's possible to restrict this building to be built in the capital though. The Buildings table has a "Capital" flag, used by the Palace. This may work exactly as needed, or it may not - it could mean all such buildings are automatically & instantly built in the capital city (which can change). That would actually be ok if it works that way while respecting a technology requirement also.

Anyway, making such a change is not trivial, and requires significant modding experience to achieve. I may play around with this at some point, in which case I'll follow up.
 
I'm not even sure if it's possible to restrict this building to be built in the capital though. The Buildings table has a "Capital" flag, used by the Palace. This may work exactly as needed, or it may not - it could mean all such buildings are automatically & instantly built in the capital city (which can change). That would actually be ok if it works that way while respecting a technology requirement also.

The "Capital" flag means that the building makes the city in which it is built the capital, IIRC. An easy way to make buildings only buildable in the capital is set them to require the Palace in the same city (under BuildingClasses required in city or something like that).
 
@Supercheese:
Thanks for that, sounds reasonable, I was just speculating and haven't tested it in any way. Do you have any idea what would happen to a building dependent on the palace if the capital is lost and the palace (presumably) moves to another city? This might let you build a second "railroad station" which doesn't go away if you regain your original capital... That could be abused in theory. The game doesn't permit you sell buildings that are prerequisites to an existing buildings, but I don't think that will help in dealing with a palace dependancy.

I thought about setting MaxPlayerInstances to 1 in BuildingClasses, but I don't think that prevents you from gaining multiples by recapturing former capital cities.

EDIT: The table in question is called Building_ClassesNeededInCity
 
Yeah, I haven't tested it either, but the combination of the 1 per player limit (National Wonder) and Requires Palace in City would likely work properly. That's the way the Treasury NW works in RoM for Civ4, and I don't think anyone was complaining of exploits there...
 
I'm delighted to see some discussion regarding making something work here, thanks guys! The "Station", working as you've suggested, sounds like a pretty reasonable and balanced way to approach this. If you know the text that can be added to the Buildings file to achieve this let me know. Personally, I'm not concerned with Civilopedia entries and the like, just the functionality of the building.

I think I'd know how to add this building, however, I was looking at the Factory and Windmill entries in the Building file and didn't see what dictates the production bonus, so I don't know how to effectively add this Station. If someone comes up with something please contribute, and at the very least I'd love to see updates or thoughts as you've done so far.

Again, I'm happy just to see this open discussion and I'd like to thank you guys for your participation, it's much appreciated. :)
 
I think I'd know how to add this building, however, I was looking at the Factory and Windmill entries in the Building file and didn't see what dictates the production bonus, so I don't know how to effectively add this Station.

The production bonus is defined in another table, Building_YieldModifiers, the entries for that are the bottom of Civ5Buildings.xml.
 
Heh, that's great, he did it exactly as we discussed, right up to the:
MaxPlayerInstances>1</MaxPlayerInstances

I'm stealing this for my private mod, it's well self-contained in Central_Station.xml
 
Forgive me if this is impossible, but couldn't you just make it so the palace provided the bonus once you discovered steam power?
 
Forgive me if this is impossible, but couldn't you just make it so the palace provided the bonus once you discovered steam power?

I think you're right, it would work like the Mughal Fort, by setting <EnhancedYieldTech>TECH_STEAM_POWER</EnhancedYieldTech> for the Palace, and then adding a new entry for Palace in the <Building_TechEnhancedYieldChanges> table! This way you wouldn't have to build anything. Hopefully it would still work if the capital was moved. I missed this capability because I didn't know that Mughal Fort did something similar.
 
I think you're right, it would work like the Mughal Fort, by setting <EnhancedYieldTech>TECH_STEAM_POWER</EnhancedYieldTech> for the Palace, and then adding a new entry for Palace in the <Building_TechEnhancedYieldChanges> table! This way you wouldn't have to build anything. Hopefully it would still work if the capital was moved. I missed this capability because I didn't know that Mughal Fort did something similar.

But keep in mind those seem to be integer-value yield changes (+1, +2, +3, etc.) rather than a percentage-based modifier (50%).
 
Would this work:
Code:
<Building_YieldModifiers>
		<Row>
			<BuildingType>BUILDING_PALACE</BuildingType>
                        <PrereqTech>TECH_RAILROAD</PrereqTech>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>50</Yield>
		</Row>
</Building_YieldModifiers>
 
I am not sure if this has been covered.. Or that this is something painfully obvious that you have already looked into, but have you tried to see what xml looks like for roads, it seems to be an exact problem.
 
@BomberEscort
Nice try, but no. The Building_YieldModifiers doesn't have a PrereqTech field. Even if we were to add one, I doubt the code would know what it means without C++ changes.

@Dünamünde
I'm not sure what you mean. How would roads be able to help?
 
It's actually really easy to do, I have a mod online that does it as a new building 'Railyard'. Search 'National Wonders and Building Tweaks' in mod browser if you wanna peek at the code in full (code is in the Palace_RailroadBoost.xml file).

Follow the 'create a building' tutorial in http://kael.civfanatics.net/files/ModdersGuide.pdf (Don't forget to set the PrereqTech to TECH_RAILROAD) and then make the building require a palace in the city, therefore it will be Capitol only:

Code:
	<Building_ClassesNeededInCity>
		<Row>
			<BuildingType>BUILDING_YOURBUILDING</BuildingType>
			<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
		</Row>
	</Building_ClassesNeededInCity>

And give it a+50% production boost:

Code:
	<Building_YieldModifiers>
		<Row>
			<BuildingType>BUILDING_YOURBUILDING</BuildingType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>50</Yield>
		</Row>
	</Building_YieldModifiers>
 
Back
Top Bottom