View Full Version : Adding a Building


Farsight
Oct 05, 2009, 05:07 PM
I'm making a mod which adds Poland, whose unique building is the Folwark, which replaces the Granary and adds +50% :gold: with Wheat. How can I do this in the XML files?

The_J
Oct 05, 2009, 05:51 PM
To make the gold dynamically appear together with the resource, can't be done in XML, afaik.

Farsight
Oct 05, 2009, 07:36 PM
Then which Python file will I need to modify?

Afforess
Oct 05, 2009, 07:52 PM
I'm making a mod which adds Poland, whose unique building is the Folwark, which replaces the Granary and adds +50% :gold: with Wheat. How can I do this in the XML files?

If you're up for SDK changes, I helped guide a person through the SDK changes for this, and they posted the finished product (see the last page on the thread) (http://forums.civfanatics.com/showthread.php?t=336730) that adds XML tags for what you want.

Farsight
Oct 06, 2009, 02:58 PM
Then how can I merge two CvGameCoreDLLs, since I also have WoC installed with the mod.

Afforess
Oct 06, 2009, 04:22 PM
Then how can I merge two CvGameCoreDLLs, since I also have WoC installed with the mod.

You need to get WoC source files, merge them with these sources, and do it that way. It should work, as I use WoC in my mods too. If you need help, their are tutorials on this forum on compiling the SDK for the first time (I had no experience, and somehow managed to do it right) and merging two sets of sources usually isn't much more than copy and pasting. If you need lots of help, the SDK forum is there for questions, and people are very helpful.

Tholish
Oct 10, 2009, 05:47 PM
You can just make the Folwark require wheat to be built in the first place. If you lose access to wheat it would still continue to work, though. The tag is <Bonus>. Its easy to rationalize. The Folwark (being a granary) retains enough wheat to continue functioning even if the wheat supply is broken.

Forcing a check of bonus availability each turn might be a good thing for somebody to do with the dll. The simplest way might be that if the bonus isn't present in the city, the building is simply scrapped. You could probably clone code from whatever it is that makes power plants work.