New modder looking for advice with religion changes

dbergan

Warlord
Joined
Feb 27, 2006
Messages
152
Location
Sioux Falls, SD
Hi,

I'm an experienced computer programmer, but new to Civ6 mods. I've read the tutorials and made a couple demos, but still learning where things are at in the vast data files. For my first mod, I want to make some changes to how religion works. If you know how to do any of the following, I'd appreciate it if you could show me.


1) Make it so that Cathedrals can hold religious art OR a relic


2) Make it so all holy site buildings (shrine, temple, cathedral, wat, stave church, etc) can be purchased with gold or faith


3) Make it so that the Condemn Heretic action always creates a relic for the victim (regardless of martyr promotion)

4) Remove the limit to the number of religions in the game (currently it's 7 for huge-sized maps, 2 for duel-sized maps)

5) Remove the limit to the number of beliefs in your religion (currently it's one of each type: follower, founder, worship, enhancer)

6) Remove the limit to how many great prophets you can earn (currently it's one)... in other words, make them into normal great people where you earn one and then start working on the next


7) Attach a type of belief (follower, founder, worship, enhancer) to each great prophet. When you activate the prophet it founds a religion with 1 belief of that type (your choice within the type), or evangelizes 1 belief of that type to your existing religion (your choice within the type)


8) Make it so that missionaries and apostles radiate religious pressure like a city, but only up to a distance of 3 tiles


9) Show the XP bar on apostles


10) Apostles gain XP for winning theological battles like warriors do


11) Apostles gain 4 XP if they convert a foreign city, 1 XP if they convert a domestic city, 12 XP if they convert a holy city


Thanks for your help!

Kind regards,
David
 
1) INSERT INTO GreatWork_ValidSubTypes (GreatWorkSlotType, GreatWorkObjectType) VALUES ('"GREATWORKSLOT_CATHEDRAL', 'GREATWORKOBJECT_RELIC');
2) UPDATE Buildings SET PurchaseYield='YIELD_FAITH' WHERE BuildingType = 'BUILDING_SHRINE'; Can't be both gold and faith

4) Doable and arleady done. Search 'Religion Expanded' here or on steam. Read 'Religions Limit' part of description. You will know what to look for.

6) Probably hardcoded. No solution till DLL release.
7) Similar to 6 but can be done the 'bad' way (LUA function that injects itself into founding event) IF you first resolve 5) which I have no idea how to do.
8) LUA. Beyond mine scope of knowledge but with this you could certainly get help on this forum.
9-11) Apostles are civilian units and thus what they do when fighting is not 'combat' in the same sense as military units do. I'm not even sure if they have XP. Gaining promotions after won theological battles/convertions is probably closest you can get to your idea. And since theological units don't use promotion trees but can choose any random promotion it couldn't be worked around by making 'blank XP promotions'.
 
Last edited:
Thank you for your help! Made a good effort on this mod last night, and thought I would share my progress and frustrations.


(1) Make it so that Cathedrals can hold religious art OR a relic
DONE Thanks for the SQL:

INSERT INTO GreatWork_ValidSubTypes (GreatWorkSlotType, GreatWorkObjectType) VALUES ("GREATWORKSLOT_CATHEDRAL", "GREATWORKOBJECT_RELIC") ;


(2) Make it so all holy site buildings (shrine, temple, cathedral, wat, stave church, etc) can be purchased with gold or faith
DONE

First we switch them all to be purchased by gold (not faith):
UPDATE Buildings SET PurchaseYield = "YIELD_GOLD" WHERE PrereqDistrict = "DISTRICT_HOLY_SITE" AND PurchaseYield = "YIELD_FAITH" ;

Then we add a modifier attached to the Astrology tech that mimics how the Jesuit Education belief works:
INSERT INTO TechnologyModifiers (TechnologyType, ModifierId) VALUES ("TECH_ASTROLOGY", "HOLY_SITE_CAN_PURCHASE_BUILDINGS_WITH_FAITH") ;

INSERT INTO Modifiers (ModifierId, ModifierType, SubjectRequirementSetId) VALUES ("HOLY_SITE_CAN_PURCHASE_BUILDINGS_WITH_FAITH", "MODIFIER_ALL_CITIES_ATTACH_MODIFIER", "CITY_HAS_HOLY_SITE") ;

INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES ("HOLY_SITE_CAN_PURCHASE_BUILDINGS_WITH_FAITH", "ModifierId", "HOLY_SITE_CAN_PURCHASE_BUILDINGS_WITH_FAITH_MODIFIER") ;

INSERT INTO Modifiers (ModifierId, ModifierType) VALUES ("HOLY_SITE_CAN_PURCHASE_BUILDINGS_WITH_FAITH_MODIFIER", "MODIFIER_CITY_ENABLE_BUILDING_FAITH_PURCHASE") ;

INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES ("HOLY_SITE_CAN_PURCHASE_BUILDINGS_WITH_FAITH_MODIFIER", "DistrictType", "DISTRICT_HOLY_SITE") ;


(3) Make it so that the Condemn Heretic action always creates a relic for the victim (regardless of martyr promotion)
FRUSTRATED There are very few references to Condemn Heretic in the SQL, and it doesn't look like I can make it the subject of a modifier. Thus, for the time being, I'm removing the function altogether:

DELETE FROM UnitCommands WHERE CommandType = "UNITCOMMAND_CONDEMN_HERETIC" ;


(4) Remove the limit to the number of religions in the game (currently it's 7 for huge-sized maps, 2 for duel-sized maps)
DONE Thanks for the tip, turns out it's only one line of SQL (albeit in a strange place):

UPDATE Map_GreatPersonClasses SET MaxWorldInstances = 999 WHERE GreatPersonClassType = "GREAT_PERSON_CLASS_PROPHET";


(5) Remove the limit to the number of beliefs in your religion (currently it's one of each type: follower, founder, worship, enhancer)
DONE, KINDA Seems like there's a hard limit of 4 beliefs in your religion no matter what. But I did make it such that you can take any 4 beliefs. (e.g. 4 enhancer beliefs)

UPDATE BeliefClasses SET MaxInReligion = 999 WHERE BeliefClassType != "BELIEF_CLASS_PANTHEON" ;

UPDATE Beliefs SET BeliefClassType= "BELIEF_CLASS_FOLLOWER" WHERE BeliefClassType != "BELIEF_CLASS_PANTHEON" ;


(6) Remove the limit to how many great prophets you can earn (currently it's one)... in other words, make them into normal great people where you earn one and then start working on the next
DONE I haven't tested how Saladin's "Last Prophet" works (probably just never activates?) Anyway, here's the SQL:

UPDATE GreatPersonClasses SET MaxPlayerInstances = NULL WHERE GreatPersonClassType = "GREAT_PERSON_CLASS_PROPHET" ;


(7) Attach a type of belief (follower, founder, worship, enhancer) to each great prophet. When you activate the prophet it founds a religion with 1 belief of that type (your choice within the type), or evangelizes 1 belief of that type to your existing religion (your choice within the type)

DONE, with changes. Since there's a hard limit of 4 beliefs per religion, I decided we're better off ignoring the belief types altogether and just evangelizing anything. Your first 4 prophets add 4 beliefs, but what do the rest do? Launch inquisitions, for one.

UPDATE GlobalParameters SET Value = 1 WHERE Name = "RELIGION_INITIAL_BELIEFS" ;
UPDATE Units SET EvangelizeBelief = 0, LaunchInquisition = 0 WHERE UnitType = "UNIT_APOSTLE" ;
UPDATE Units SET EvangelizeBelief = 1, LaunchInquisition = 1 WHERE UnitType = "UNIT_GREAT_PROPHET" ;




(8) Make it so that missionaries and apostles radiate religious pressure like a city, but only up to a distance of 3 tiles
STARTED I'm thinking that there might be a way to hook into the Great Generals' area-of-effect and disburse religious pressure rather than combat strength/movement. That'd work for 2-tile pressure.


(9) Show the XP bar on apostles
FRUSTRATED I don't see any SQL that controls the XP bar. Apostles do have XP, because it says they start at level 2. I think you're right that it's embedded in their unit class.


(10) Apostles gain XP for winning theological battles like warriors do
HAVEN'T STARTED


(11) Apostles gain 4 XP if they convert a foreign city, 1 XP if they convert a domestic city, 12 XP if they convert a holy city
HAVEN'T STARTED


(12) Remove Heathen Conversion promotion (new)

DONE

DELETE FROM UnitPromotions WHERE PromotionClass = "PROMOTION_CLASS_APOSTLE" AND UnitPromotionType = "PROMOTION_HEATHEN_CONVERSION" ;


(13) Other things for the latter Great Prophets to do (new)
Some ideas:
- Area of effect (perhaps religious pressure, or increase combat strength for religious units... maybe even normal combat units?... maybe super-medic healing?)
- Activate to build shrine/temple (like Isaac Newton for the campus)
- Create a relic
- Instant faith yield (boring)
- Promote 3 apostles
- make 3 cities pressure like holy cities (4x the normal, I think)
- nuke enemy religious units (e.g. he runs in like a suicide bomber and blows up ("wins over!") killing all opposing adjacent religious units)
- 1 spread that totally wipes a city of all other religions and adds enough pressure for each citizen in the city (200 per citizen, I think)


(14) Remove the effect where losing theological combat takes religious pressure out of nearby towns (new)
STARTED I think we could just apply Monastic Isolation's effect to everyone... and then get rid of that belief so no one takes it (or rework it)
 
Regarding 5) i am currently also interested in this and foud out that its more of an UI issue rather than DB related.
Spoiler Base/Assets/UI/ReligionScreen.lua :
Code:
function PopulateAvailableBeliefs(beliefType:string)

    m_Beliefs.IM:ResetInstances();

    for row in GameInfo.Beliefs() do

        local bBeliefTypeAlreadySelected:boolean = false;
        for _, beliefID in ipairs(m_SelectedBeliefs) do
            if row.BeliefClassType == GameInfo.Beliefs[beliefID].BeliefClassType then
                bBeliefTypeAlreadySelected = true;
                break;
            end
        end

        if (not bBeliefTypeAlreadySelected and
            not m_pGameReligion:IsInSomePantheon(row.Index) and
            not m_pGameReligion:IsInSomeReligion(row.Index) and
            not m_pGameReligion:IsTooManyForReligion(row.Index, m_PlayerReligionType) and
            ((beliefType ~= nil and row.BeliefClassType == beliefType) or
             (beliefType == nil and row.BeliefClassType ~= "BELIEF_CLASS_PANTHEON"))) then
            local beliefInst:table = m_Beliefs.IM:GetInstance();
            beliefInst.BeliefLabel:LocalizeAndSetText(Locale.ToUpper(row.Name));
            beliefInst.BeliefDescription:LocalizeAndSetText(row.Description);
            beliefInst.BeliefButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end);
            beliefInst.BeliefButton:RegisterCallback(Mouse.eLClick, function() OnBeliefSelected(row.Index, beliefInst) end);
            SetBeliefIcon(beliefInst.BeliefIcon, row.BeliefType, SIZE_BELIEF_ICON_LARGE);
            SetBeliefSlotDisabled(beliefInst, false);
        end
    end

    RealizeStack(m_Beliefs.Stack, m_Beliefs.Scrollbar);
end
As maybe you can see, as soon as one Belief Type was choosen, the others will be hidden.
My Problem for now is, how to get the Apostle to Evangelize after Beliefs >= 4.
 
Its a bug, still investigating how to prevent this ^^

The change in ReligionScreen.lua was basically that i removed this:
Code:
local bBeliefTypeAlreadySelected:boolean = false;
        for _, beliefID in ipairs(m_SelectedBeliefs) do
            if row.BeliefClassType == GameInfo.Beliefs[beliefID].BeliefClassType then
                bBeliefTypeAlreadySelected = true;
                break;
            end
        end
The if condition afterwards is what should prevent double selecting, but yeah the table structure is different than i thought :)
 
Back
Top Bottom