Religion - Civ Specific Religions

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,728
Location
Near Portsmouth, UK
Examples of how to limit beliefs to specific civilizations and/or religions and also how to specify alternative religions for civs if their preferred choice is taken using the additional religion events added in my modded DLL

Download (and required DLL Download)

NOTE: If you also use my UI - Religion Spread mod, you will need to upgrade that to V5 or later

Code:
function OnPlayerCanFoundPantheon(iPlayer)
  return true
end
GameEvents.[B][COLOR="Red"]PlayerCanFoundPantheon[/COLOR][/B].Add(OnPlayerCanFoundPantheon)

function OnPlayerCanFoundReligion(iPlayer, iCity)
  return true
end
GameEvents.[B][COLOR="red"]PlayerCanFoundReligion[/COLOR][/B].Add(OnPlayerCanFoundReligion)

function OnGetReligionToFound(iPlayer, iPreferredReligion, bIsAlreadyFounded)
  return iPreferredReligion
end
GameEvents.[B][COLOR="red"]GetReligionToFound[/COLOR][/B].Add(OnGetReligionToFound)

function OnPantheonFounded(iPlayer, iCapitalCity, iReligion, iBelief)
end
GameEvents.[B][COLOR="red"]PantheonFounded[/COLOR][/B].Add(OnPantheonFounded)

function OnReligionFounded(iPlayer, iHolyCity, iReligion, iBelief1, iBelief2, iBelief3, iBelief4, iBelief5)
end
GameEvents.[B][COLOR="red"]ReligionFounded[/COLOR][/B].Add(OnReligionFounded)

function OnReligionEnhanced(iPlayer, iReligion, iBelief1, iBelief2)
end
GameEvents.[B][COLOR="red"]ReligionEnhanced[/COLOR][/B].Add(OnReligionEnhanced)

function OnPlayerCanHaveBelief(iPlayer, iBelief)
  return true
end
GameEvents.[B][COLOR="red"]PlayerCanHaveBelief[/COLOR][/B].Add(OnPlayerCanHaveBelief)

function OnReligionCanHaveBelief(iPlayer, iReligion, iBelief)
  return true
end
GameEvents.[B][COLOR="red"]ReligionCanHaveBelief[/COLOR][/B].Add(OnReligionCanHaveBelief)
 
I read that this mod is incompatible with BNW.
It's a pity, give a civilization a second preferred religion was a very good idea (especially in conjunction with religion-specific buildings or wonders).
Can I ask you if there's any chance to be updated ?
 
Untested in play (but no database.log or lua.log errors), but I don't see why it wouldn't work

It was marked as "retired" due to the differences between the G&K and BNW ChooseReligionPopup.lua file and at the time I couldn't be bothered to convert it
 
Thank you Whoward! I will put it to good use. Your work, as always, is really precious.
 
Just one question: I saw that you inserted more than one alternative religion choice as example.

So, I looked at the lua file but I'm still unsure on how it works:

1) If the first choice is already founded, the AI pick the second and if this is already founded too than pick the third

or

2) If the first is already founded the AI pick a random one between the other two

Can you tell me which one is true ?
 
Hi Whoward, I tested the mod. It seems to work fine but I noticed something in the lua.log:

I just wish to know if there's a bug (maybe it's my fault) or this is what is supposed to happen.

I tought it was better to upload it, there are a series of errors at the bottom of the file.

Thank you in advance for your time.
 

Attachments

Looks like you've edited the code, because, in my version, the print that's immediately before each of those errors is coming from line 102, which quite clearly isn't throwing the error.
 
Sorry if I bother you again whit this, but, as you can see, it could be a conflict with IGE or a bug, let me explain:

I did another test, I re-downloaded the mod from your site,
I used (of course) your DLL (v.53) and IGE. No other mod.
I gave myself 1200 faith points in the 2nd turn, founded Buddhismin the 3d turn. As expected only pagodas were avalaible, so it seems to work fine.

But the errors are the same, and the fact that they happen only to me seems something I should worry about.

Could be a conflict with IGE ? I never had problems with it before but it is the only other mod I used in the test.
Thank you in advance for your time.
 

Attachments

Back
Top Bottom