1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[R&F] Loyalty Mod

Discussion in 'Civ6 - Creation & Customization' started by historix69, Feb 24, 2018.

  1. historix69

    historix69 Chieftain

    Joined:
    Sep 30, 2008
    Messages:
    1,216
    The following Loyalty Mod tries to add some more details to Loyalty/Identity.
    - Max Loyalty is set to 1000 instead of 100.
    - Max influence from Population/Citizens per turn is smaller relative to Max Loyalty (5% instead of 20%).
    - Relative Influence from Happiness per turn is more important (in regard to Population influence).
    - Relative Influence from Unhappiness and Starvation per turn is more important.
    - Certain districts, certain buildings, unique districts and buildings, most religious buildings and wonders add a small amount of Loyalty to the city.

    Feel free to change parameters as you like and experiment ...

    Spoiler :

    Code:
    ----------------
    -- Parameters --
    ----------------
    
    -- Loyalty Start 100 -> 1000, Max 100 -> 1000
    
    update GlobalParameters set Value = "1000" where Name="LOYALTY_START";
    update GlobalParameters set Value = "1000" where Name="LOYALTY_MAXIMUM";
    
    -- Max Pressure per Turn : 20 -> 50
    
    update GlobalParameters set Value = "50" where Name="LOYALTY_PER_TURN_FROM_NEARBY_CITIZEN_PRESSURE_MAX_LOYALTY";
    
    -- Martial Law 8 -> 15, Occupation -5 -> -10
    
    update GlobalParameters set Value = "15" where Name="IDENTITY_PER_TURN_FROM_MARTIAL_LAW";
    update GlobalParameters set Value = "-10" where Name="IDENTITY_PER_TURN_FROM_OCCUPATION_MAX";
    
    -- Food Deficit (Starvation) : -4 -> -25
    
    update GlobalParameters set Value = "-25" where Name="IDENTITY_PER_TURN_FROM_STARVATION";
    
    -- Happyness : default -6, -6, -6, -3, 0, +3, +6
    
    update Happinesses_XP1 set IdentityPerTurnChange = "-25" where HappinessType="HAPPINESS_REVOLT";
    update Happinesses_XP1 set IdentityPerTurnChange = "-15" where HappinessType="HAPPINESS_UNREST";
    update Happinesses_XP1 set IdentityPerTurnChange = "-10" where HappinessType="HAPPINESS_UNHAPPY";
    update Happinesses_XP1 set IdentityPerTurnChange = "-5" where HappinessType="HAPPINESS_DISPLEASED";
    update Happinesses_XP1 set IdentityPerTurnChange = "0" where HappinessType="HAPPINESS_CONTENT";
    update Happinesses_XP1 set IdentityPerTurnChange = "10" where HappinessType="HAPPINESS_HAPPY";
    update Happinesses_XP1 set IdentityPerTurnChange = "25" where HappinessType="HAPPINESS_ECSTATIC";
    
    --------------------------------------
    -- Buildings, Districts and Wonders --
    --------------------------------------
    
    -- Palace Buff --
    
    insert into Modifiers (ModifierId, ModifierType)
    values ("MOD_PALACE_LOYALTY_BUFF", "MODIFIER_SINGLE_CITY_ADJUST_IDENTITY_PER_TURN");
    
    insert into ModifierArguments (ModifierId, Name, Value)
    values ("MOD_PALACE_LOYALTY_BUFF", "Amount", "25");
    
    -- Small Loyalty Buff for all other Buildings, etc. --
    
    insert into Modifiers (ModifierId, ModifierType)
    values ("MOD_SMALL_LOYALTY_BUFF", "MODIFIER_SINGLE_CITY_ADJUST_IDENTITY_PER_TURN");
    
    insert into ModifierArguments (ModifierId, Name, Value)
    values ("MOD_SMALL_LOYALTY_BUFF", "Amount", "1");
    
    ------------------------------------------------------
    
    -- Palace --
    
    insert into BuildingModifiers (BuildingType, ModifierId)
    values ("BUILDING_PALACE", "MOD_PALACE_LOYALTY_BUFF");
    
    
    -- Districts --
    insert into DistrictModifiers (DistrictType, ModifierId) values
    ("DISTRICT_CITY_CENTER", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_CAMPUS", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_HOLY_SITE", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_ENCAMPMENT", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_COMMERCIAL_HUB", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_ENTERTAINMENT_COMPLEX", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_THEATER", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_GOVERNMENT", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_WATER_ENTERTAINMENT_COMPLEX", "MOD_SMALL_LOYALTY_BUFF");
    
    
    -- Unique Districts --
    insert into DistrictModifiers (DistrictType, ModifierId) values
    ("DISTRICT_ACROPOLIS", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_BATH", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_HANSA", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_LAVRA", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_MBANZA", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_STREET_CARNIVAL", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_ROYAL_NAVY_DOCKYARD", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_IKANDA", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_SEOWON", "MOD_SMALL_LOYALTY_BUFF"),
    ("DISTRICT_WATER_STREET_CARNIVAL", "MOD_SMALL_LOYALTY_BUFF");
    
    
    -- Buildings -
    
    insert into BuildingModifiers (BuildingType, ModifierId) values
    ("BUILDING_BARRACKS", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_STABLE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_CASTLE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MARKET", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MUSEUM_ART", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MUSEUM_ARTIFACT", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_BROADCAST_CENTER", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_STADIUM", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_UNIVERSITY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_TALL", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_WIDE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_CONQUEST", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_CITYSTATES", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_SPIES", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_FAITH", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_MILITARY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_CULTURE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GOV_SCIENCE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_AQUATICS_CENTER", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_FOOD_MARKET", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_SHOPPING_MALL", "MOD_SMALL_LOYALTY_BUFF");
    
    
    -- Religious Buildings --
    
    insert into BuildingModifiers (BuildingType, ModifierId) values
    ("BUILDING_CATHEDRAL", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_DAR_E_MEHR", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GURDWARA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MEETING_HOUSE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MOSQUE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_PAGODA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_STUPA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_SYNAGOGUE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_TEMPLE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_WAT", "MOD_SMALL_LOYALTY_BUFF");
    
    
    -- Unique Buildings --
    
    insert into BuildingModifiers (BuildingType, ModifierId) values
    ("BUILDING_FILM_STUDIO", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MADRASA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_STAVE_CHURCH", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_ELECTRONICS_FACTORY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_TLACHTLI", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_PRASAT", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_BASILIKOI_PAIDES", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_SUKIENNICE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_ORDU", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_TSIKHE", "MOD_SMALL_LOYALTY_BUFF");
    
    
    -- Wonders --
    
    insert into BuildingModifiers (BuildingType, ModifierId) values
    ("BUILDING_ALHAMBRA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_BIG_BEN", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_BOLSHOI_THEATRE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_BROADWAY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_CHICHEN_ITZA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_COLOSSEUM", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_COLOSSUS", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_CRISTO_REDENTOR", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_EIFFEL_TOWER", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_ESTADIO_DO_MARACANA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_FORBIDDEN_CITY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GREAT_LIBRARY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GREAT_LIGHTHOUSE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_GREAT_ZIMBABWE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_HAGIA_SOPHIA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_HANGING_GARDENS", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_HERMITAGE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MAHABODHI_TEMPLE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_MONT_ST_MICHEL", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_ORACLE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_OXFORD_UNIVERSITY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_PETRA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_POTALA_PALACE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_PYRAMIDS", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_RUHR_VALLEY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_STONEHENGE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_SYDNEY_OPERA_HOUSE", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_TERRACOTTA_ARMY", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_VENETIAN_ARSENAL", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_HUEY_TEOCALLI", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_ANGKOR_WAT", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_APADANA", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_HALICARNASSUS_MAUSOLEUM", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_JEBEL_BARKAL", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_AMUNDSEN_SCOTT_RESEARCH_STATION", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_CASA_DE_CONTRATACION", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_KILWA_KISIWANI", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_KOTOKU_IN", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_ST_BASILS_CATHEDRAL", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_TAJ_MAHAL", "MOD_SMALL_LOYALTY_BUFF"),
    ("BUILDING_TEMPLE_ARTEMIS", "MOD_SMALL_LOYALTY_BUFF");
    
     
    Last edited: Feb 25, 2018
  2. qqqbbb

    qqqbbb Chieftain

    Joined:
    Sep 25, 2010
    Messages:
    411
    Nice mod. Why not release it properly?

    Troops near city should increase loyalty.

    Instead of all those single lines of code you can do this
    Code:
    INSERT INTO BuildingModifiers (BuildingType, ModifierId)
     SELECT BuildingType, 'MOD_SMALL_LOYALTY_BUFF'
    FROM Buildings;
    
     
  3. historix69

    historix69 Chieftain

    Joined:
    Sep 30, 2008
    Messages:
    1,216
    Thanks for the code.
    One reason to not use a wildcard was to handselect buildings. But it was a lot of work for all the wonders.

    Do you have any idea how to code "Troops near city should increase loyalty." ?
     
  4. qqqbbb

    qqqbbb Chieftain

    Joined:
    Sep 25, 2010
    Messages:
    411
    There is civic called limitanei. It increases loyalty if city has garrisoned unit. Adding to it requirement 'REQUIREMENT_PLOT_ADJACENT_FRIENDLY_UNIT_TYPE_MATCHES' should increase loyalty if there is a friendly unit near city.
     

Share This Page