Having problems about a trait that affect loyalty by religion

WatcherNinth

Chieftain
Joined
Mar 8, 2017
Messages
10
The original idea about this trait was the religion (any religion will do) found by this specific leader will decrease foreign cities' loyalty, and free cities believe this religion generate more religion pressure so adjacent cities would convert more quickly, so this religion will spread like a plague and leave bunches of free cities behind.
After several experiments, now the trait goes like this:
"Any foreign city believes your religion -1 loyalty per citizen per turn, free cities +20 loyalty instead and generate double religion pressure"
I planned using belief modifiers to add the effect to cities, so if the city converts later the effect will disappear too, but I found out that there is no requirement related to free cities. Now I am kinda stuck here.
I guess this effect can be done purely by lua script, but I thought modifier would be stabler. If anyone has better idea, plz let me know.
 
And I have already tried decrease loyalty by the amount of follower in the city, there is a GetNumFollowers() object, but it didn't work in normal games, maybe it only works in the nubia scenario.
 
I haven't messed around with beliefs at all, but there might be a few requirements you could experiment with. There's the Requirement Type: REQUIREMENT_CIVILIZATION_LEVEL, as well as the civilization level: CIVILIZATION_LEVEL_FREE_CITIES which was added in R&F (if I remember right). So if you set up your modifiers to use your own 'Requirement Set' then you should be able to check if it's a free city or a major civ.

Code:
<Requirements>
<Row>
<RequirementId>YOUR_UNIQUE_REQUIREMENT_NAME</RequirementId>
<RequirementType>REQUIREMENT_CIVILIZATION_LEVEL</RequirementType>
</Row>
<Requirements>

<RequirementArguments>
<Row>
<RequirementId>YOUR_UNIQUE_REQUIREMENT_NAME</RequirementId>
<Name>OpponentCivLevel</NAME>
<Value>CIVILIZATION_LEVEL_FREE_CITIES</Value>
</Row>
</RequirementArguments>

You would still have to add this requirement to a 'Requirement Set' with requirements to make sure the city follows your religion. I haven't tried using this myself, so I don't know if it will work for sure, but it could be a direction you could look in.
 
I haven't messed around with beliefs at all, but there might be a few requirements you could experiment with. There's the Requirement Type: REQUIREMENT_CIVILIZATION_LEVEL, as well as the civilization level: CIVILIZATION_LEVEL_FREE_CITIES which was added in R&F (if I remember right). So if you set up your modifiers to use your own 'Requirement Set' then you should be able to check if it's a free city or a major civ.

Code:
<Requirements>
<Row>
<RequirementId>YOUR_UNIQUE_REQUIREMENT_NAME</RequirementId>
<RequirementType>REQUIREMENT_CIVILIZATION_LEVEL</RequirementType>
</Row>
<Requirements>

<RequirementArguments>
<Row>
<RequirementId>YOUR_UNIQUE_REQUIREMENT_NAME</RequirementId>
<Name>OpponentCivLevel</NAME>
<Value>CIVILIZATION_LEVEL_FREE_CITIES</Value>
</Row>
</RequirementArguments>

You would still have to add this requirement to a 'Requirement Set' with requirements to make sure the city follows your religion. I haven't tried using this myself, so I don't know if it will work for sure, but it could be a direction you could look in.

Thanks, I tried this multiple times, it works out fine in the end. Here are some tips if anyone needs:
1. This requirement cannot attach to a belief, the log goes like this:
Code:
Warning: Object <Belief: 59, Player: 0, Religion: 1> does not support interface <{3BCA4C49-F422-44AE-8A10-857B3ECEFD3A}>.
So far, this requirement can work on modifiers attached to buildings, cities, and traits (as the official example).
2. This requirement actually has two arguments, the other one called "OwnerCivLevel" and never used by the games. It seems that this requirement can judge its owner's civ level even if it's assigned to SubjectRequirementSet.
3. There is all civilization level I can find:
CIVILIZATION_LEVEL_FULL_CIV
CIVILIZATION_LEVEL_CITY_STATE
CIVILIZATION_LEVEL_FREE_CITIES
CIVILIZATION_LEVEL_TRIBE (For Barbarian)

I have another problem now: I find out that I can't add belief modifiers using Lua during the game, there is only an object that can add specific belief to the player. If there is no other solution, I think I need to simply add these modifiers to any follower belief to make this mod works...
 
Back
Top Bottom