View Full Version : Is it possible to implement these ideas?


Davinci Fan
Jun 06, 2007, 09:39 PM
I am curious if some of the ideas I have for a mod can be implemented, and if so, in what format (XML, Python, SDK, etc). If anyone could give me pointers on how to implement these ideas, such as what files to look at/edit, I would be grateful.

Any items in brackets stand in for a generic example of that type (i.e. [Unit] stands for a unit I have in my game. I don't want to confuse anyone with flavor, so I'm leaving it out of my post.)

1. [Religion] will only spread in a Civilization's lands if they have researched [Technology].

2. [Civilization] starts with [Religion] and it's first city is that religion's holy city.

3. [Unit] costs 15 Food in addition to 50 hammers (NOTE: this is different from settlers/workers)

4&5. Forests generate 2 Wood per turn in addition to hammers/food. [Unit] costs 20 Wood in addition to 10 Food and 20 hammers (similar to 3)

6. [Unit] costs 2 Hammers per turn from its home city. If these cannot be produced, [Consequence]. (Such as population goes down by one, unit is destroyed, etc.)

6 and a half. [Unit] costs 2 Hammers and 3 Wood per turn etc...

Thank you for your input.

primordial stew
Jun 08, 2007, 12:12 AM
> 1.

I don't have a good understanding of how the game implements this functionality, so in my limited view of it, I would build a hash of which cities rightfully have a religion, and then loop through each city every turn removing religions which don't belong. There must be a better way though :/


> 2.

This can be done in python without much hassle.


> 3.

I don't think this is quite what you want, but there is already support for buildings any unit with food. Settlers + workers always get this, and military units are controlled by an xml tag + having an appropriate civic. Compare the migration civic to another to see what is set.

> wood

Wood? There is a timber resource in some mods, so that along with the.. mod which quantifies raw materials.. from have/have not, to have X number of units available is maybe what you want.

There is some discussion in the "Red Storm Rising" dev thread.

Davinci Fan
Jun 08, 2007, 01:06 AM
I was trying to keep flavor out of it to avoid confusing anyone; I guess wood messed that up a bit. What I meant was that I wanted a fourth (and more) yield (in addition to hammers, food, and commerce) for tiles to generate. This is not like resources.

As to the building units with food, that is not exactly what I want. I was looking to have a unit require two separate costs to be fulfilled: a hammer cost, and a food cost (in addition, if wood and other yields were allowed, I'd like to have those costs as well)

I don't suppose anyone has any thoughts on the upkeep bit? I think it's kind of like with great people (who cost 2 food per turn) but I am not sure where to find that coding.

Mexico
Jun 08, 2007, 02:37 AM
> 1.

I don't have a good understanding of how the game implements this functionality, so in my limited view of it, I would build a hash of which cities rightfully have a religion, and then loop through each city every turn removing religions which don't belong. There must be a better way though :/


python game util doReligion (inCvGameUtils.py) is called from CvCity::doReligion, which is responsible for religion spread
so you can update this and check if owner of city has researched appropriate technology