I've added a backup-plan for the AI to choose its next best fitting religion type if a favored religion is already taken according to civilization type. In the Religion.xml is the dev comment:
"Matches for favored religions. Leaders will try to match on leader type first, then on civ type, then choose randomly".
Originally, there are only leader types defined in the file and no civilization type. I've added now these, for example like this by sql:
Strangely, the game crashes now severely when starting a new game session.
According to 01_GameplaySchema.sql, there shouldn't be any problem as the table is defined like this:
My additional LeaderType entries seem to work fine though, but what's wrong with the CivilizationTypes?
"Matches for favored religions. Leaders will try to match on leader type first, then on civ type, then choose randomly".
Originally, there are only leader types defined in the file and no civilization type. I've added now these, for example like this by sql:
Code:
INSERT INTO FavoredReligions (CivilizationType, ReligionType) SELECT "CIVILIZATION_AMERICA", "RELIGION_CATHOLICISM";
According to 01_GameplaySchema.sql, there shouldn't be any problem as the table is defined like this:
Code:
-- Table of suggested religions. Will try to match leader first, then civ, then random pick
CREATE TABLE "FavoredReligions" (
"LeaderType" TEXT,
"CivilizationType" TEXT,
"ReligionType" TEXT NOT NULL,
PRIMARY KEY(LeaderType, CivilizationType, ReligionType),
FOREIGN KEY (ReligionType) REFERENCES Religions(ReligionType) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (LeaderType) REFERENCES Leaders(LeaderType) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (CivilizationType) REFERENCES Civilizations(CivilizationType) ON DELETE CASCADE ON UPDATE CASCADE);