Creating culture-like religion mechanics

Anachist

Chieftain
Joined
Oct 29, 2010
Messages
37
I would like to create a mod that uses religions instead of cultures. Religions would replace cultures. Like if city would have +45 my culture/turn, it would have +45 my religion in my mod.

Religions would show in city investigate interface like cultures in BtS. If one city had over 50% one religion, it would convert to that religion. One city could only have one religion at the time.

Missionaires would spear religion like great artists perform great works. They would bring certain amount of religion points to city that religion is spearder.

I'm just started Civ modding, but I'm quite advanced C++ programmer. I have also some experience on python.

Hope you even understand what I mean.
 
Sorry, I don't understand what you mean, or I'd try to point you toward where to start. If you're an experienced C++ programmer you should have no problems, The Source for the gamecore in Civ is very logically set up.

I suppose my question is, what specifically, functionally do you want to do first? And have you worked with the XML in Civ or are you starting completely out of the blue (If so I'd recommend doing something simple in the XML like adding a unit, just to give you a starting point on how civ is structured)?
 
Thinking on it a bit more, it's not necessary to work with the XML. Emperor Fool, the main coder for the BUG mod claimed that he never did, so it's not needed. To start off, I suppose one thing you could do is set it so that a city can only have 1 Religion, which would be pretty easy. Look at CvCity::setHasReligion then if the function is being told to add a religion to the city, loop through Religions, test if the city has any extras, and remove them. Basically add something like this code:

Code:
void CvCity::setHasReligion(ReligionTypes eIndex, bool bNewValue, bool bAnnounce, bool bArrows)
{
...
	if (!isHasReligion(eIndex) && bNewValue)
	{
		int iI;
		for (iI = 0; iI < GC.getNumReligionInfos(); ++ iI)
		{
			if (eIndex != ReligionTypes(iI))
			{
				setHasReligion(ReligionTypes(iI), false, true)
			}
		}
 
I think I get what he means.

Instead of a city being X% Nation, it would be X% Religion

"Instead of a city being X% Nation, it would be X% Religion" easy enough.
Rename all the civs names with religion names then. Easy to do in XML.

"Saladin of the Islam".

This guy have a plan or is he just shooting ideas out there?
 
I think I get what he means.

Instead of a city being X% Nation, it would be X% Religion

Yep, that's exactly what I mean.

And my problem really is that I don't know what different functions do. I don't know if there is already existing function for something I would like to do. And if there is, what is it called. And how about variables? Wich variables store what data?

I'm completely confused about the mess of functions.

I know quite a lot about C++, but modding Civ is just... different.
 
Back
Top Bottom