I hope that I'm putting this in the right place. It is a question about python so I'm not sure where else this question would go. Also if it looks like while I'm typing this that I don't know what I'm talking about, it's probably because I don't. I don't know much about python and thats probably why this is so confusing to me.
I've seen this system work in a few mods so far. In Dune Wars, on spread the Imperial religion is replaced by other faiths and Qizarate removes all other religions on spread as well. In Rhye's and Fall the Arabs spread their state religion on spawn and on Dawn of Civilization they not only spread their faith on spawn but remove non-state religions. I like it the most in RFC Classical World where Hellenism is almost always replaced by Christianity or Islam on spread (code seems to give it a 90% chance).
I would like to learn how this system works. It seems all the games use totally different code to reach this end of replacing religions and I don't understand how it works.
This is the python for Dune Wars. I think it's the least complicated so it's best I try to understand this first.
It seems (false, false, false) is always used when removing a religion. I don't desire the part that has the holy city survive. I don't know how I'd convert this for use for other religions. I know self.iRImp means the Imperial religion but I don't know how the python knows that. Does anyone know how to implement this into the base game?
I've seen this system work in a few mods so far. In Dune Wars, on spread the Imperial religion is replaced by other faiths and Qizarate removes all other religions on spread as well. In Rhye's and Fall the Arabs spread their state religion on spawn and on Dawn of Civilization they not only spread their faith on spawn but remove non-state religions. I like it the most in RFC Classical World where Hellenism is almost always replaced by Christianity or Islam on spread (code seems to give it a 90% chance).
I would like to learn how this system works. It seems all the games use totally different code to reach this end of replacing religions and I don't understand how it works.
This is the python for Dune Wars. I think it's the least complicated so it's best I try to understand this first.
Spoiler :
# Religion has spread to a city. If Imperial is there remove it. ALN-leave holy city
# If Qizarate is the one spreading, remove all others. ALN-leave holy cities
def onReligionSpread(self, argsList):
iReligion, iOwner, pCity = argsList
if pCity.isHasReligion(self.iRImp) and iReligion != self.iRImp:
if not pCity.isHolyCityByType(self.iRImp):
pCity.setHasReligion(self.iRImp, false, false, false)
if iReligion == self.iRQiz:
for i in range(gc.getNumReligionInfos()):
if i == self.iRQiz: continue
if pCity.isHolyCityByType(i): continue
if pCity.isHasReligion(i):
pCity.setHasReligion(i, false, false, false)
# If Qizarate is the one spreading, remove all others. ALN-leave holy cities
def onReligionSpread(self, argsList):
iReligion, iOwner, pCity = argsList
if pCity.isHasReligion(self.iRImp) and iReligion != self.iRImp:
if not pCity.isHolyCityByType(self.iRImp):
pCity.setHasReligion(self.iRImp, false, false, false)
if iReligion == self.iRQiz:
for i in range(gc.getNumReligionInfos()):
if i == self.iRQiz: continue
if pCity.isHolyCityByType(i): continue
if pCity.isHasReligion(i):
pCity.setHasReligion(i, false, false, false)
It seems (false, false, false) is always used when removing a religion. I don't desire the part that has the holy city survive. I don't know how I'd convert this for use for other religions. I know self.iRImp means the Imperial religion but I don't know how the python knows that. Does anyone know how to implement this into the base game?