Spreading religion

Shqype said:
Uhh.. I'm not sure I did it properly. In order to get a "Final Release" choice I must have the CvGameCoreDLL file open ... so first I make changes to the files, save them, and then open up the CvGameCoreDLL file. Both options "Build Solution" and "Build CvGameCoreDLL" are available. I chose the latter and ended up with a Final Release folder which new files in it. Not sure what to do with them..

One of those files is probably CvGameCoreDLL.dll. Thats the only file you need.
 
I looked for it and it wasn't in that folder, I had CvGameCoreDLL.exp and CvGameCoreDLL.lib instead. Just now I went to the folder to double-check and on my way there I found a new folder created 2 levels above where I looked called "assets." I opened it up, and sure enough there's a CvGameCoreDLL.dll file weighing in at 3.53 MB :)
 
Ok, I have a slight problem. I did all your steps that you described in "installing and using the SDK" thread, but i have run into a problem, I can't edit the CvCity.cpp file. I tried to edit it directly from codeblock, but it won't let me insert or change any code. Can you help?
 
ArneHD said:
Ok, I have a slight problem. I did all your steps that you described in "installing and using the SDK" thread, but i have run into a problem, I can't edit the CvCity.cpp file. I tried to edit it directly from codeblock, but it won't let me insert or change any code. Can you help?

Its read only. You will have to change the flags on all of those files so they arent read only anymore.
 
Kael said:
Its read only. You will have to change the flags on all of those files so they arent read only anymore.

Thank you, works now.
 
OK, I am trying to automaticaly add religious building when a city recives a religion. However, being realy new to this, I have no idea where to start. I think I need to find where the program applies the religion effects to the city, but I can't find it.
 
ArneHD said:
OK, I am trying to automaticaly add religious building when a city recives a religion. However, being realy new to this, I have no idea where to start. I think I need to find where the program applies the religion effects to the city, but I can't find it.

There is an onReligionSpread python function that could do this. You could also do it in the python cityDoTurn ceck but thats probably more expensive.
 
Kael said:
There is an onReligionSpread python function that could do this. You could also do it in the python cityDoTurn ceck but thats probably more expensive.

Thank you, but how do I have to specify which religion it is that is spreading?
 
ArneHD said:
Thank you, but how do I have to specify which religion it is that is spreading?

Its already in the function. Here is the one I use:

Code:
	def onReligionSpread(self, argsList):
		'Religion Has Spread to a City'
		iReligion, iOwner, pSpreadCity = argsList
		iOrder = gc.getInfoTypeForString('RELIGION_THE_ORDER')
		iVeil = gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL')
		player = PyPlayer(iOwner)
		pPlayer = gc.getPlayer(iOwner)
		if iReligion == iVeil:
			if (pSpreadCity.isHasReligion(iOrder) and pSpreadCity.isHolyCityByType(iVeil) == False):
				pSpreadCity.setHasReligion(iReligion, False, False, False)
				CyInterface().addMessage(iOwner,True,25,'The Ashen Veil was removed from a city.','AS2D_ORDER_DINK',1,'Art/Interface/Buttons/Religions/Order.dds',ColorTypes(8),pSpreadCity.getX(),pSpreadCity.getY(),True,True)

		if iReligion == iOrder:
			if (pSpreadCity.isHasReligion(iVeil) and pSpreadCity.isHolyCityByType(iOrder) == False):
				pSpreadCity.setHasReligion(iReligion, False, False, False)
				CyInterface().addMessage(iOwner,True,25,'The Order was removed from a city.','AS2D_ASHEN_DINK',1,'Art/Interface/Buttons/Religions/Ashen.dds',ColorTypes(8),pSpreadCity.getX(),pSpreadCity.getY(),True,True)
			if (pPlayer.getStateReligion() == iOrder and pSpreadCity.isHasReligion(iVeil) == False and pSpreadCity.getOccupationTimer() <= 0):
				iRnd = CyGame().getSorenRandNum(100, "Bob")
				if (iRnd <= gc.getDefineINT('ORDER_CRUSADER_SPAWN_CHANCE')):
					eTeam = gc.getTeam(pPlayer.getTeam())
					if eTeam.isHasTech(gc.getInfoTypeForString('TECH_FANATICISM')):
						iUnit = gc.getInfoTypeForString('UNIT_CRUSADER')
						CyInterface().addMessage(iOwner,True,25,'A Crusader has joined your cause.','AS2D_UNIT_BUILD_UNIT',1,'Art/Interface/Buttons/Units/Crusader.dds',ColorTypes(8),pSpreadCity.getX(),pSpreadCity.getY(),True,True)
					else:
						iUnit = gc.getInfoTypeForString('UNIT_DISCIPLE_THE_ORDER')
						CyInterface().addMessage(iOwner,True,25,'An Acolyte has joined your cause.','AS2D_UNIT_BUILD_UNIT',1,'Art/Interface/Buttons/Units/Discipleorder.dds',ColorTypes(8),pSpreadCity.getX(),pSpreadCity.getY(),True,True)
					newUnit = pPlayer.initUnit(iUnit, pSpreadCity.getX(), pSpreadCity.getY(), UnitAITypes.NO_UNITAI)

		if (not self.__LOG_RELIGIONSPREAD):
			return
		CvUtil.pyPrint('%s has spread to Player %d Civilization %s city of %s'
			%(gc.getReligionInfo(iReligion).getDescription(), iOwner, player.getCivilizationName(), pSpreadCity.getName()))
 
OK, last question, how do I add buildings through python? I really appreciate all the help you have given me, and I think this will be my last question.
 
ArneHD said:
OK, last question, how do I add buildings through python? I really appreciate all the help you have given me, and I think this will be my last question.

You will want to look here for all fo the python functions: http://civilization4.net/files/modding/PythonAPI_v160/

The function you are looking for is:
Code:
pCity.setHasRealBuilding(gc.getInfoTypeForString('BUILDING_WARDING_STONES'), True)
 
Thank you. You have been of great help.

Edit: Never mind, I did it. I finaly figured out what was wrong and corrected it.

Thanks again for your help.
 
Ok, I have another request, could someone send me a unmodified CIV4BuildingInfos.xml from the 1.61 patch? I forgot to backup mine and now it doesn't work.
 
Kael said:
Religions dont spread naturally if a city already has a religion. It is handled in the void CvCity::doReligion() function in CvCity.cpp:...

I take it if you have downloaded someone elses' mod, you can't edit it to have this alteration, because the dll is machine code or something? (my programming knowledge is rustier than the titanic). I like the mod keldath and mrgenie are working on but i loathe missionaries. ;)

I just want religion to spread randomly and then go to war over control of the holy cities. Just like real life!
 
seady said:
I take it if you have downloaded someone elses' mod, you can't edit it to have this alteration, because the dll is machine code or something? (my programming knowledge is rustier than the titanic). I like the mod keldath and mrgenie are working on but i loathe missionaries. ;)

I just want religion to spread randomly and then go to war over control of the holy cities. Just like real life!

Sure you can! The dll dosen't matter (exept for balance) in mods that do not replace it. As long as it is not needed for the mod itself, you can have this improvement.
 
Back
Top Bottom