Unique City-States

Would you play this mod?


  • Total voters
    20
  • Poll closed .
With cooperation of @jarcast2 and few others we can present to you UCS v7:
Code:
Changelog:
New:
    - added City-States with unique abilities:  ==> Taipei (maritime)
                                                ==> Óc Eo (mercantile);
    - added compatibility with any mod that adds Bonus or Luxury resources (f.i. Even More Resources; that mod must be loaded before UCS to work);
    - added manual Yangcheng compatibility with EMR (Animal Resources);
    - added an icon for Marsh improvement by @gwennog;
Lua:
    - added pseudoAllies (you can get Unique CS bonus even if you are not an Ally; being over 300% of the Ally threshold is enough for it; this means multiple players can get the bonus at the same time) (lua);
    - added Embassies mechanic (you get bonuses from CS after establishing an Embassy in CS territory; bonus is permanent);
    - you can disable any of the 3 possible ways of getting bonuses with values in lua file: bIsAllyAnOption, bIsEmbassyAnOption or bIsPseudoAllyAnOption (changing true to false);
    - functions on AllyChange now are checked on Turn (lua);
    - Jerusalem now checked on turn (instead of on AllyChange); this allows transferring religion or setting Sphere of Influence even after being allied with CS; Sphere and Religion are now independent from each other (lua);
    - added Sphere of Influence notification for Lhasa and many other Notifications; reworked many of them or rewrote the texts (lua);
    - added notification when bonus from CS is applied (separate for each condition) (lua);
    - modified coordinates of numerous notifications (now they focus on City-State instead of Major Player City) (lua);
    - fixed Marsh creation (lua)
Balance:
    - updated UnitCombats for all UCS promotions (mainly Submarines, Carriers, but sometimes others);
    - reworked slightly all Clermont promotions;
    - slightly buffed: Kyiv, Milan, Vilnius, Kyzyl, Jerusalem (added specific bonus for all players, because other bonuses are only for an Ally);
    - increased thresholds for being Friend with CS (from 35 to 50) and to be an Ally (from 70 to 100);
Other fixes:
    - historical correction changes:    "Gwynedd" City-State renamed to "Aberffraw";
                                        "Auckland" City-State renamed to "Parihaka";
                                        "Tamaki Makaurau" ability renamed to "City of Sails";
                                        "Honduras" City-State renamed to "Tegucigalpa";
                                        "Muisca" City-State renamed to "Suamox";
                                        "Laconia" City-State renamed to "Sparta";
    - updated anything regarding promotions in files (multiple errors; pedia types, pedia fixes, new text label etc.);
    - merged all text files into one big cleaned up file easier to manage;
    - cleaned up and reworked lua file; deleted unnecessary code;
    - further text changes and fixes (f.i. many additional help notes added; corrected some crucial logic errors);
Few things to mention:
  • almost all texts in the game where revised; please report any inconsistence that could sho up after mod rework and adding new mechanics;
  • please test out those city-states' abilities which require lua, because whole lua file was revised and optimized and new mechanics were added;
  • please report any other glitches and errors.
Have fun!
Can you please fix/update the non-EUI version of the citystatehelperstatus file for this mod please? Thank you!
 
I'm not playing non-EUI version. Sorry, I cannot help you.
 
Maybe @Padre19 can update non-EUI version. How was that earlier? Both were updated simultaniously?
 
If anyone wants to help, then here in another thread started by @Hinin we talk about new CSs' specializations that will be added to the UCS in next update.
 
Ok, I decided to release UCS v8, because I finished siginificant part of CSs passives rework, and I would like to share current build for testing. Feedback very welcome!

Changelog:
Code:
New:
    - added new City-States:    ==> Andorra (cultured);
                                ==> Canossa (religious);
                                ==> Thimphu (cultured);
    - Canossa, Andorra, Thimphu now update on New Turn, City construction and City capturing;
    - Canossa also updates on Building Construction;
    - all City-States receive additional passive bonuses related to their Trait or Personality; this will give some flavour and specialize CSs better;
    - added notifications and notes to CityStatesStatusHelper.lua about all new passive CSs' bonuses;
    - added Reference for EE modmod for better compatibility;
        -- added Drydock to the list of buildings boosted by Muscat;
    - unlocked few CustomModOptions related to CS behaviour (GLOBAL_CS_OVERSEAS_TERRITORY, RELIGION_ALLIED_INQUISITORS);
    - replaced Nairobi with Levuka (new ability as well); there was a conflict with Mombasa;
    - added info about UU type gifted by CS in CityStateStatusHelper tooltip;
    - added unique art for Grand Harbour (Valetta) building (@gwennog);
    - added new promotion icons (@gwennog);
Balance:
    - updated Óc Eo ability (slightly buffed; now also +1 Happiness in Empire for each Sea Internation TR);
Fixed:
    - Óc Eo now updates on City construction (builds dummies) and City capturing (checks new owner);
    - instead of on UnitActionChanged (on Cargo Ship) Óc Eo now updates on PlayerDoTurn; it will save some memory, and will prevent the bug when bonus is no more active and player still has dummies and at least one active trade route;
    - added missing BullyUnitClass column to MinorCivilizations table;
    - reworked icon atlases for buildings, improvements and promotions; cleaned up the folder and deleted unnecessary files;
    - all dummies now have same generic icon;
    - text fixes.

Like in the previous update, this time I also update CSL, PO and MC modmods to adapt for changes made in UCS (new CSs, new promotions etc.).

Spoiler CSs Passives so far :

RELIGIOUS:
  • :c5greatperson: Holy Site for all of them on spot without Resource, Feature nor Improvement nor City; If it does not find anything in ring 3 of the city, then it won't build it at all (such situation can be met on small Islands);
  • +33% :c5faith: Religious Pressure;
  • +2 :c5gold:, +2 :c5culture: and +2 :c5faith: from Mountains and Atolls.
  • +2 :c5gold:, +2 :c5culture: and +2 :c5faith: to Natural Wonders.
  • -10 :c5culture: Broder Growth Points for all of them (I wanted to make modifiers, like -10%, but VP neglects negative values);
  • Friendly: -25% :c5faith: Conversion Resistance. 5% Chance for spawning a Missionary in Friends territory; +2 :c5culture: Culture from incoming :trade: Trade Routes;
  • Neutral: +10% :c5faith: Conversion Resistance; +5 :c5production: for every World Religion that has at least one Follower in this City-State. +1 :c5food: to Rivers and +2 :c5food: to Lakes;
  • Hostile: +25% :c5faith: Conversion Resistance; +25% :c5faith: Religious Pressure. 10 :c5culture: Culture on Unit's Death.
MARITIME:
  • Manufactory and one Bonus Resource nearby;
  • +15% :c5food: Growth;
  • 10 :c5culture: Border Growth Points when :c5citizen: Citizen is born;
  • +20% :c5citystate: Enemy Spy Effectiveness;
  • Friendly: +50% :c5production: Production to Workers and Fishing Boats. Rarely gifts a Worker or a Fishing Boat (50% chance for any of them) to its Friends (5%). +1 :c5food: Food to Bonus Resources.
  • Neutral: +10 :c5food: Food per 4 :c5citizen: Citizens in this City-State. +10 :c5strength: Defense and +50 City HP.
  • Hostile: +20% :c5production: Production to all Naval Units. 50 :c5food: Food and 20 :c5culture: Border Growth Points from :c5production: Unit Production. +1 :c5production: Production per 2 :c5citizen: Citizens.
MILITARISTIC:
  • Fort and a Strategic Resource (=1) nearby;
  • Can train its unique unit;
  • +10% :c5production: Production towards all Military Units;
  • You can upgrade your units inside their territory if Allied;
  • -33% :c5food: Growth;
  • Friendly: Gifts Units to its Friends at an increased rate (additional 5% chance). All Military Units gain 30 XP when trained in this City-State.
  • Neutral: +25% :c5war: Unit Supply Cap. +20% XP gained from Combat for units Trained in this City-State. All Military Units gain 10 XP when trained in this City-State.
  • Hostile: +50% :c5war: Unit Supply Cap. +33% :c5production: Production towards all Military Units.
MERCANTILE:
  • Town and a Luxury Resource nearby


CULTURED:

  • Academy nearby;
 

Attachments

  • (overhaul) Unique City-States (v 8).zip
    2.9 MB · Views: 134
Last edited:
Do you get the new city state bonuses if you conquer the city or only the great person improvements make them more attractive?
 
Do you get the new city state bonuses if you conquer the city or only the great person improvements make them more attractive?
These are only CSs bonuses so conquering them deletes all stuff from the city.

I must also add the code recreating stuff after liberating the CS, but that's for later times.
 
Quick v9 update with some important fixes, new art by @gwennog and some new stuff.
Code:
New:
    - negative values for CS passives are now marked red in the tooltip;
    - added new passives for Mercantile CSs;
    - added missing art for Vilnius, Milan and Kyiv buildings (@gwennog);
Changes:   
    - renamed Armagh's Saints and added unique art for them (@gwennog);
Fixes:
    - deleted unnecessary 32px file for buildings;
    - revisions of texts (optimizing; shortening; clarity);
    - reduced Religious malus to -5 Border Growth Points;
    - fixed important issue with Jersualem's lua code.
 

Attachments

  • (overhaul) Unique City-States (v 9).7z
    2.6 MB · Views: 298
Should be with latest. If it's not, please tell me what to fix.
 
Currently playing with v8 in my current game and I really like the diversity this mod brings. Is v9 savegame compatible with v8 ?
 
Quite a long time since I played with UCS, thanks for updating the mod. A few weird things happened to me:
- Geneva gifted me a missionary before I had a religion in any city. (not sure how the AI would do with it)
- Bratislava alliance bonus is still active despite my Influence dropping below both allies and friends thresholds.

Also 50/100 thresholds feels way too much and is a huge nerf for policies/wonders benefitting from alliances and poor Bismarck, I would lower this to 40/80.
 
- Bratislava alliance bonus is still active despite my Influence dropping below both allies and friends thresholds.

Do you have an embassy with Bratislava? That now gives you the unique bonus even if you don't have an alliance.
 
Do you have an embassy with Bratislava? That now gives you the unique bonus even if you don't have an alliance.

Nope, I forgot to mention I set both flags for pseudo-alliance and embassy to false in the lua file. I observed the same pattern with Ormus then I stopped to check and maintained alliance status for the rest of the game only with tose two. Sadly I can't provide logs this session has now ended.
 
Nope, I forgot to mention I set both flags for pseudo-alliance and embassy to false in the lua file. I observed the same pattern with Ormus then I stopped to check and maintained alliance status for the rest of the game only with tose two. Sadly I can't provide logs this session has now ended.
I'm back from bike trip now, so I will try to look at that asap.
 
Greetings from the other side of the world. Thank you for continuing the mode again. Your new Idea is very interesting.
In my country, I translate this mode into my language. However, some problems interfere with translation.

upload_2022-6-12_0-15-28.png

(TXT_KEY_CULTURED_BONUS)
(TXT_KEY_CULTURED_FRIENDLY_BONUS)

This is the problem. TXT_KEY_TEXT is translated also and I can't see City-state Bonus.

I slightly changed the lua code.
Edit : function GetCityStateTraitText is used in many different places. Instead edit function, add new function.

Lua/CityStateStatusHelper.lua, line 453~ changed to:
Code:
        -- Traits and Personalities
        local eMinorTrait = GetCityStateTraitKey(minorPlayerID)
        local eMinorPersonality = minorPlayer:GetPersonality()
      
        local sMinorPersonalityStr = ""
        if eMinorPersonality == MinorCivPersonalityTypes.MINOR_CIV_PERSONALITY_FRIENDLY then
            sMinorPersonalityStr = "FRIENDLY"
        elseif eMinorPersonality == MinorCivPersonalityTypes.MINOR_CIV_PERSONALITY_NEUTRAL then
            sMinorPersonalityStr = "NEUTRAL"
        elseif eMinorPersonality == MinorCivPersonalityTypes.MINOR_CIV_PERSONALITY_HOSTILE then
            sMinorPersonalityStr = "HOSTILE"
        end

Lua/CityStateStatusHelper.lua, line 936~ added to:
Code:
function GetCityStateTraitKey(minorPlayerID)

    local minorPlayer = Players[minorPlayerID]

    if minorPlayer then
        local minorCivTraitID = minorPlayer:GetMinorCivTrait()
        if minorCivTraitID == MinorCivTraitTypes.MINOR_CIV_TRAIT_CULTURED then
            return "CULTURED"
        end
        if minorCivTraitID == MinorCivTraitTypes.MINOR_CIV_TRAIT_MILITARISTIC then
            return "MILITARISTIC"
        end
        if minorCivTraitID == MinorCivTraitTypes.MINOR_CIV_TRAIT_MARITIME then
            return "MARITIME"
        end
        if minorCivTraitID == MinorCivTraitTypes.MINOR_CIV_TRAIT_MERCANTILE then
            return "MERCANTILE"
        end
        if minorCivTraitID == MinorCivTraitTypes.MINOR_CIV_TRAIT_RELIGIOUS then
            return "RELIGIOUS"
        end
    else
        print("Lua error - invalid player index")
    end

    return ""
end
upload_2022-6-12_0-21-33.png


Then, it's also shown well in my language.
Can you apply this change? Or please let me know if you have a Github link.
 
Last edited:
Top Bottom