Is there any easy way to check if a city is a Holy City with Lua?

Tomatekh

Emperor
Joined
Aug 6, 2012
Messages
1,434
Is there any easy way to check if one of your cities is a holy city with Lua? (Not just for the religion you founded, but any religion, if say you happened to have captured a holy city in the past).

Related to this, is there any easy way to check if a player's founded religion has a certain belief (I see a GetStateReligionName, but nothing for individual beliefs)?

Thanks for any help.
 
Not simple, but all of the code is in "function GetReligionTooltip(city)" in "InfoTooltipInclude.lua" (that's the code that adds the religious status to the City Banner tooltip - which includes if a city is the holy city for any founded religions)
 
Thanks again for pointing this out. It ended up being much easier than I thought and I got everything working perfectly.
 
It's useful if you say what the answer is when you find it. Otherwise very frustrating for others searching for the same answer.

city:IsHolyCityAnyReligion()

The second part needs the iterator:
Code:
for i,v in pairs(Game.GetBeliefsInReligion(eReligion)) do
	--code
end

Be careful with the religious functions because many of them will CTD if you use a religion as arg that has not yet been founded.
 
Back
Top Bottom