[Vanilla] Track Religion?

Lukasdb

Chieftain
Joined
Feb 13, 2021
Messages
25
Hi people!

It there any way to track civ religion? I want to make a mod where civ is able to deploy enemy civ UU when it's religion is the same as enemy civ. I was thinking of dynamically adding Civ traits depending on religion status. If you know this is definiately not gonna work please let me know :)
 
In the meantime i've been trying to make it possible to buy allies unique units and came up with this string below. I tried to make a new unit, that mimics the original UU but for another civ where there are requirements to both unlock technology and be an ally of owner civ. Sufice to say it doesn't work probably due to modifier string. Am having trouble coming with a modifier, that checks if a target civ is an ally. I searched all the tables with effects such as but see none, that could fit in my mod. The closest I could find was
EFFECT_ADOPT_ALLY_FOUNDED_RELIGIONS
Is there any way to add effects?



<GameInfo>
<Types>
<Row Kind="KIND_TRAIT" Type="TRAIT_CIVILIZATION_BORROW_UNIT"/>
</Types>
<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_JAPAN" TraitType="TRAIT_CIVILIZATION_BORROW_UNIT"/>
</CivilizationTraits>
<Traits>
<Row Description="LOC_UNIT_POLISH_HUSSAR_DESCRIPTION" Name="LOC_UNIT_POLISH_HUSSAR_NAME" TraitType="TRAIT_CIVILIZATION_BORROW_UNIT"/>
</Traits>
<TraitModifiers>
<Row>
<TraitType>TRAIT_CIVILIZATION_BORROW_UNIT</TraitType>
<ModifierId>STANDARD_DIPLOMATIC_ALLY</ModifierId>
</Row>
</TraitModifiers>
<Modifiers>
<Row>
<ModifierId>STANDARD_DIPLOMATIC_ALLY</ModifierId>
<ModifierType>MODIFIER_PLAYER_DIPLOMACY_SIMPLE_MODIFIER</ModifierType>
<CivilizationType>CIVILIZATION_POLAND</CivilizationType>
<SubjectRequirementSetId>PLAYER_ALLY</SubjectRequirementSetId>
</Row>
</Modifiers>
<Units>
<Row Description="LOC_UNIT_POLISH_HUSSAR_DESCRIPTION" Name="LOC_UNIT_POLISH_HUSSAR_NAME" TraitType="TRAIT_CIVILIZATION_BORROW_UNIT" Cost="250" PurchaseYield="YIELD_GOLD" MandatoryObsoleteTech="TECH_RIFLING" Combat="55" Maintenance="3" PromotionClass="PROMOTION_CLASS_HEAVY_CAVALRY" PrereqCivic="CIVIC_MERCENARIES" FormationClass="FORMATION_CLASS_LAND_COMBAT" Domain="DOMAIN_LAND" ZoneOfControl="true" BaseSightRange="2" AdvisorType="ADVISOR_CONQUEST" BaseMoves="4" UnitType="UNIT_POLISH_HUSSAR"/>
</Units>
</GameInfo>
 
  1. You cannot add new EffectTypes, CollectionTypes, RequirementTypes, or RequirementSetTypes to the game.
  2. Table "Units" already has a UnitType called "UNIT_POLISH_HUSSAR" so you cannot attempt to add another row in the table with the same designation for column UnitType
  3. Table "Modifiers" already has a ModifierId called "STANDARD_DIPLOMATIC_ALLY" so you cannot attempt to add another row in the table with the same designation for column ModifierId
  4. Table "Modifiers" has no column called "CivilizationType".
  5. There are ModifierTypes that unlock the ability to build or purchase a unit (see the Nihang). But the Nihang is tied to a City-State. A modifier is then attached to all major players which allows any major player to create Nihangs if they are the Suzerain of the City-State. It is the set of requirements that is attached to the modifier that creates the effects of needing to be the suzerain.
  6. You would not want to use the STANDARD_DIPLOMATIC_ALLY Modifier anyway. You would want to create your own modifier but the designation for who must be the ally to whom would have to be done as RequirementArguments tied to a new set of RequirementIds. You would have to create a new RequirementSetId also since PLAYER_ALLY isn't going to serve nor would you want to alter it via an update.
  7. The problem with the religion thing is there are no RequirementTypes that are directly for "shared" religion, though there is one where if we reverse the logic might accomplish the desired requirement. There are only three I was able to find via a quick look at the database:
    • REQUIREMENT_OPPONENT_IS_OTHER_RELIGION. An inverse could be applied to this and I think it will make it require a shared religion.
    • REQUIREMENT_PLAYER_FOUNDED_NO_RELIGION
    • REQUIREMENT_PLAYER_FOUNDED_OUR_RELIGION
 
Last edited:
Update.
1. Still working on it. Spend a lot of time researching your guide LeeS(btw. 143 pages is a LOT, gratz!) and other recources like this one here: https://forums.civfanatics.com/threads/questions-regarding-limitations-of-mods.663297/#post-15935104.
2. I tried to use mvemba modifier in which he gains founder belief, provided condition, that religion is majority. I tried to attach a new effect to it called EFFECT_ATTACH_MODIFIER, though am not sure it actually attaches a standard modifier...
3. I duplicated in intend to make it exclusive to Japan under condition Poland's religion is dominating. Though I think any link would be enough for me(Trade route or alliance i mean).
4. The biggest challange here for me(I think...) is identyfing which civ has that dominant religion/my trade route/is my ally. I Tried to specify it in the code but it doesn't work obviously.
5. Am super exhausted! I am having a lot of fun, but am spending on figuring it out for almost 12 hours a day :D.
6. Am sharing my mod in current state in ZIP for your opinion.
7. REQUIREMENT_OPPONENT_IS_OTHER_RELIGION - This applies to Units unfortunately
Thanks LeeS and everybody who can pitch an idea!
 

Attachments

  • Changes gameplay.zip
    4 KB · Views: 28
Last edited:
Top Bottom