SDK Help with Religion

Fintilgin

Chieftain
Joined
Dec 6, 2004
Messages
57
I'm hoping someone can help me with this, as I know next to nothing about C++ and have been trying to trial and error a solution to this problem without any success.

What I want to do is make it so that it takes TWO technologies to found a religion. I was sort of hoping to use the 'Andprereq' functionality from the techtree, but I can't find any other references to it in the SDK files.

The idea is that say, Christianity requires both Monotheism and the 'Christian Thought' tech while Islam require Monotheism and 'Islamic Thought'. Both the new techs would be non-tradable starting techs, european civs would start with 'Christian Thought' and middle eastern civs with 'Islamic Thought'. Whoever discovered Monotheism first would found the religion, but no one else could. So, in this case you could never have both Christianity AND Islam in a single game, but every game you'd get a different religion in that slot.

I've posted on the idea before: http://forums.civfanatics.com/showthread.php?t=135261 and I've done some work on the icons and extra religions, but without the SDK mod it's useless.

I'm going to keep plugging away at it, but if some coding guru has some advice or help it would be greatly appreciated! :D
 
Fintilgin said:
I'm hoping someone can help me with this, as I know next to nothing about C++ and have been trying to trial and error a solution to this problem without any success.

What I want to do is make it so that it takes TWO technologies to found a religion. I was sort of hoping to use the 'Andprereq' functionality from the techtree, but I can't find any other references to it in the SDK files.

The idea is that say, Christianity requires both Monotheism and the 'Christian Thought' tech while Islam require Monotheism and 'Islamic Thought'. Both the new techs would be non-tradable starting techs, european civs would start with 'Christian Thought' and middle eastern civs with 'Islamic Thought'. Whoever discovered Monotheism first would found the religion, but no one else could. So, in this case you could never have both Christianity AND Islam in a single game, but every game you'd get a different religion in that slot.

I've posted on the idea before: http://forums.civfanatics.com/showthread.php?t=135261 and I've done some work on the icons and extra religions, but without the SDK mod it's useless.

I'm going to keep plugging away at it, but if some coding guru has some advice or help it would be greatly appreciated! :D

1. You could do this just with XML by creating a new tech for each religion and having that tech have 0 research cost but require any set of required techs that you want.

2. You could also do it via python by creating a tech for each religion and automatically giving it to any civ that knows both of the techs.

3. You could do it in the SDK too by extending the schema to allow for 2 tech req attributes on religions and making sure that the team has both of these before the religion is founds.

All of these solutions will handicap the AI who wont understand that it needs both of the religions to found the religion. As such players will have an advantage rushing to tech combos that found religions.
 
Kael said:
1. You could do this just with XML by creating a new tech for each religion and having that tech have 0 research cost but require any set of required techs that you want.

That won't work because the idea is to make a variable 'cultural' religion mod. So once a civilization discovers monotheism and founds a religion from the 'monotheism slot' no other civilization can do so that game. Christianity, Islam, and Judaism might all be founded off the monotheism tech, but only ONE per game and the one that's founded is dependent on which civilization discovers it first.

Kael said:
2. You could also do it via python by creating a tech for each religion and automatically giving it to any civ that knows both of the techs.

That still won't prevent multiple religon foundings off a single tech. I want to leave the basic functionality of only the first person to discover the tech gets to found a religion, but I want to put a whole bunch of religions on that tech and have a second prereq in order to actually found it. So India gets Hinduism from Polythesim, the Scandinavians get Norse Pantheon, and the Romans get Hellenic Pantheon, but they're mutually exclusive. In other words, if it wasn't for the second prereq, the first civilization to discover meditation would found half a dozen religions.

Kael said:
3. You could do it in the SDK too by extending the schema to allow for 2 tech req attributes on religions and making sure that the team has both of these before the religion is founds.

This is what I've been trying to do, but I'm having trouble figuring out how to do it. It looks like DoHolyCity is what founds a religion, and I found the bit that checks techprereq in the Religion XML file, but I can't figure out how to make it check a second prereq. It seems straightforward to define a TechPrereq2 line in the Religion XML file, but then how do I force the SDK to check it? I assume I can't just copy that line and change GetTechPrereq to GetTechPrereq2, correct? Somehow I need to define just what GetTechPrereq2 is supposed to do. That's why I was hoping to copy the AndPrereq functionality somehow.

Kael said:
All of these solutions will handicap the AI who wont understand that it needs both of the religions to found the religion. As such players will have an advantage rushing to tech combos that found religions.

It shouldn't handicap the AI because the second prereq is a freebe starting tech that they don't need to focus on. They can just go for a normal religion tech and found a culturally appropriate religion. It dosen't even need to a be a secondary TECH to determine it, it could be a trait or some new, hidden variable defined in the religion and civlilization XML files. It just seemed like copying the already existing functionality and using a second TechPrereq would be the easiest way for someone of my programing ignorance to brute force a solution. :)
 
What about making a religion discovered when a certain wonder is built? Then you could heavily flavor the building so that a certain leader with certain traits would be more inclined to build it?
 
Back
Top Bottom