Missionaries from holy shrines

nfw

King
Joined
Aug 31, 2010
Messages
733
Is there a way to let the holy city with the shrine to continue to train missionaries, even after Scientific Method?

Thanks.
 
I didn't even know what a Shrine could train missionaries... :wow:

Try this (I haven't tested it myself):
Spoiler :
In CvGameUtils.py find this bit of code and add the highlighted lines:
Code:
	def canTrain(self,argsList):
		pCity = argsList[0]
		eUnit = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		bIgnoreCost = argsList[4]
		bIgnoreUpgrades = argsList[5]
[B]		if 16 < eUnit < 23:
			eReligion = eUnit % 17
 			return pCity.isHolyCityByType(eReligion) and pCity.isHasBuilding(80 + eReligion * 4)[/B]
		return False
It shouldn't slow down the game very much at all...
 
In regular BtS, and any mod I can remember playing, a Shrine doesn't let you train missionaries. Only the monasteries do.

As I recall, Scientific Method doesn't stop missionaries from being trained, it only stops you from being able to build new monasteries. You can still produce missionaries in cities that already have monasteries - the requirement evidently doesn't care if the building is obsolete, only that it exists. I remember training missionaries after Scientific Method, and even airlifting them to new cities over on different continents, and islands, once I have airports.

This might not be the case in some mods - but I don't remember running into that change.

New cities become useful real fast when just a few turns after the city is founded you have airlifted in a Sushi executive, a Creative Con. or Mining Inc. executive, and a missionary of your state religion (especially if you have the AP and/or 1 or more of the other wonders that improve religious buildings for your state religion) - not necessarily in that order.
 
Problem is when I take over other civilizations, all monasteries are destroyed so I cannot spread their religion to my empire, post Scientific Method. Sure I can switch to Organized Religion, but it really shouldn't be that way.

So I think the shrine should double as a "super monastery", I mean, seriously...
 
The missionary units have a value specified for their PrereqBuilding, specifically the relevant monastery building. That tag can only take one building so a unit can not be allowed by two different buildings.

You can add units that require the shrines instead of the monasteries, one per religion. They can be identical in every other respect to the regular missionary, or (as long as you are messing with them) they could be different in some way.
 
The missionary units have a value specified for their PrereqBuilding, specifically the relevant monastery building. That tag can only take one building so a unit can not be allowed by two different buildings.
Would my CvGameUtils hack work though?
 
I think you'd need to do a canTrain instead of a cannotTrain. You can use canTrain to force a unit to be trainable when it normally wouldn't be, whereas cannotTrain is used to force a unit to be untrainable when it normally can be trained. In CvCity::canTrain the Python canTrain is called near the beginning of the function and if it returns True then CvCity::canTrain immediately returns True, skipping the regular checks, allowing the unit to be trained. The Python cannotTrain is called at the end of the function and if it returns True then CvCity::canTrain returns False, but it only gets that far if none of the conditions it checks has already indicated False (i.e. it only does the call if it would otherwise return True).

Also, coding in the numbers like that would basically require that a unmoded unitinfos and buildinginfos files be used (or that any new units or buildings are added to the end of the list and none removed from the files, anyway). This seems like a bad plan, although it does simplify the code a little it also makes it harder to understand and fix should something change.

For example: Instead of eReligion = "eUnit % 17", I'd get the unit's unit info via the CyUnit.getUnitType() return value fed into gc.getUnitInfo() and then from that you can use the CvUnitInfo.getPrereqReligion() function to actually get the data instead of relying on the unit ID number.
 
I think you'd need to do a canTrain instead of a cannotTrain. You can use canTrain to force a unit to be trainable when it normally wouldn't be, whereas cannotTrain is used to force a unit to be untrainable when it normally can be trained.
Oh, I see. CvGameUtils is new territory to me. :p

I changed my previous post. :goodjob:

Also, coding in the numbers like that would basically require that a unmoded unitinfos and buildinginfos files be used (or that any new units or buildings are added to the end of the list and none removed from the files, anyway). This seems like a bad plan, although it does simplify the code a little it also makes it harder to understand and fix should something change.
Yeah, I of course realized this. I was counting on nfw running a clean BtS installation... :p
 
In regular BtS, and any mod I can remember playing, a Shrine doesn't let you train missionaries. Only the monasteries do.

I made a mod that does that a long time ago (and I've been adding and adding to it since then).

Although, it didn't train "missionaries" per se.
It trained "Prophets" (not great Prophets) - which looked and functioned the same as missionaries, but had double the religion spread value (which I think determines its chances of success in spreading the religion), 3 movement points (instead of 2), and cost half the hammers of a normal missionary. It also used a different limit, so you could have 3 missionaries, and 3 "prophets" - making it even nicer to control a holy city with a shrine.

Later, I added an "evangelist" class, that was available after mass media, that required a "revival center" or "religious center" for their respective religion.
The "evangelists" functioned the same as missionaries, and the building required for them was cheaper than a monastery (since it only gave 1 culture, and no research boost).
In this implementation, any city could build them, but it would be easy to make this "religious center" require the shrine.

There are a lot of options with just XML if you don't insist that they be called the same name in the xml file (you can have two different units have the same displayed name in game
 
Back
Top Bottom