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

Tomatekh's Timurids for VP

Discussion in 'Mods Repository' started by pineappledan, May 11, 2018.

  1. adan_eslavo

    adan_eslavo Archmage of all Pixels Supporter

    Joined:
    Apr 23, 2017
    Messages:
    1,511
    Gender:
    Male
    Location:
    Łódź, Poland
    I will think of it, but it's for sure doable.
     
    Last edited: Oct 6, 2018
  2. adan_eslavo

    adan_eslavo Archmage of all Pixels Supporter

    Joined:
    Apr 23, 2017
    Messages:
    1,511
    Gender:
    Male
    Location:
    Łódź, Poland
    Here you have the code. I checked it and it works. Paste it in your cuurent code.
    Code:
    local L = Locale.ConvertTextKey
    local tBuildings = {}
    local tWaterBuildings = {}
    
    (...)
    
    function JewelOfTheEast1(iPlayer, iUnitOrCity, iRole, bIsCity)
        if not (bIsCity and iRole == 1) then return end
     
        local pPlayer = Players[iPlayer]
     
        if not pPlayer then return end
     
        local pCity = pPlayer:GetCityByID(iUnitOrCity)
        tBuildings = {}
        tWaterBuildings = {}
     
        for building in GameInfo.Buildings() do
            if pCity:IsHasBuilding(building.ID) and (not building.NukeImmune or building.ID == GameInfoTypes.BUILDING_MILITARY_BASE) and building.HurryCostModifier ~= -1 then -- no wonders or dummies
                local bIsUnique = false
                local bIsFound = false
             
                for uniqueBuilding in DB.Query("select * from Civilization_BuildingClassOverrides where BuildingType = ?", building.Type) do
                    bIsUnique = true
                 
                    for equivalentBuilding in GameInfo.Buildings() do
                        if equivalentBuilding.BuildingClass == uniqueBuilding.BuildingClassType then
                            local bIsBaseBuilding = true
                         
                            for equivalentUniqueBuilding in DB.Query("select * from Civilization_BuildingClassOverrides where BuildingType = ?", equivalentBuilding.Type) do
                                bIsBaseBuilding = false
                            end
                         
                            if bIsBaseBuilding then
                                bIsFound = true
                             
                                if equivalentBuilding.Water then
                                    table.insert(tWaterBuildings, equivalentBuilding)
                                else
                                    table.insert(tBuildings, equivalentBuilding)
                                end
                             
                                break
                            end
                        end
                    end
                 
                    if bIsFound then
                        break
                    end
                end
             
                if not bIsUnique then
                    if building.Water then
                        table.insert(tWaterBuildings, building)
                    else
                        table.insert(tBuildings, building)
                    end
                end        
            end
        end
    end
    GameEvents.BattleJoined.Add(JewelOfTheEast1)
    
    function JewelOfTheEast2(iOldOwner, bIsCapital, iX, iY, iNewOwner, iPop, bConquest)
        -- buildings part
        local pPlayer = Players[iNewOwner]
        local pCapital = pPlayer:GetCapitalCity()
        local pCapitalX, pCapitalY, pCapitalID = pCapital:GetX(), pCapital:GetY(), pCapital:GetID()
        local sName = pCapital:GetName()
        local iCoastalBuildings = 0
     
        if not (pPlayer and pPlayer:GetCivilizationType() == TimuridsID) then return end
     
        if pCapital:IsCoastal() then
            iCoastalBuildings = #tWaterBuildings
        end
     
        local iNumberOfBuildings = #tBuildings + iCoastalBuildings
     
        if iNumberOfBuildings == 0 then return end
         
        local sCitiesNames = ""
     
        for i, building in pairs(tBuildings) do
            if not pCapital:IsHasBuilding(building.ID) then        
                pCapital:SetNumRealBuilding(building.ID, 1)
             
                if i - iCoastalBuildings == iNumberOfBuildings then
                    sCitiesNames = sCitiesNames .. " and " .. L(building.Description)
                elseif sCitiesNames == "" then
                    sCitiesNames = sCitiesNames .. L(building.Description)
                else
                    sCitiesNames = sCitiesNames .. ", " .. L(building.Description)
                end
            end
        end
     
        if pCapital:IsCoastal() then
            for i, building in pairs(tWaterBuildings) do
                if not pCapital:IsHasBuilding(building.ID) then        
                    pCapital:SetNumRealBuilding(building.ID, 1)
                 
                    if i == #tWaterBuildings then
                        sCitiesNames = sCitiesNames .. " and " .. L(building.Description)
                    elseif sCitiesNames == "" then
                        sCitiesNames = sCitiesNames .. L(building.Description)
                    else
                        sCitiesNames = sCitiesNames .. ", " .. L(building.Description)
                    end
                end
            end
        end
     
        if pPlayer:IsHuman() and pPlayer:IsTurnActive() then
            local sText = "Foreign architects have constructed following buildings in your [ICON_CAPITAL] Capital: " .. sCitiesNames .. "."
            local sTitle = "Jewel of the East"
         
            pPlayer:AddNotification(NotificationTypes.NOTIFICATION_WONDER_COMPLETED,
                sText,
                sTitle,
                pCapitalX, pCapitalY, GameInfoTypes.BUILDING_PALACE, -1)
        end
     
        -- yields part - on City Capture, if City has never been captured before, give capital a bonus
        local pCity = Map.GetPlot(iX, iY):GetPlotCity()
     
        if pCity:GetNumBuilding(bUniqCaptureDummy) == 0 then
            pCapital:SetNumRealBuilding(bTimDummy, (pCapital:GetNumBuilding(bTimDummy) + 1))
            pCity:SetNumRealBuilding(bUniqCaptureDummy, 1)
     
            if pPlayer:IsHuman() and pPlayer:IsTurnActive() then
                local vCityPosition = PositionCalculator(pCapitalX, pCapitalY)
             
                pPlayer:AddNotification(NotificationTypes.NOTIFICATION_INSTANT_YIELD,
                    'Your Palace in [COLOR_POSITIVE_TEXT]'..sName..'[ENDCOLOR] has gained more yields: +1 [ICON_CULTURE] Culture, +1 [ICON_RESEARCH] Science, +1 [ICON_GOLD] Gold, and  +1 [ICON_PRODUCTION] Production',
                    'Artisans captured and brought to '..sName,
                    pCapitalX, pCapitalY, pCapitalID)
            end
        end
    end
    GameEvents.CityCaptureComplete.Add(JewelOfTheEast2)


    Instead of Uniques, their base versions are put to the capital. Never Capture are also copied. Added also Coastal City conditions.
     
    pineappledan likes this.
  3. adan_eslavo

    adan_eslavo Archmage of all Pixels Supporter

    Joined:
    Apr 23, 2017
    Messages:
    1,511
    Gender:
    Male
    Location:
    Łódź, Poland
    Tell me if it worked the way you want.
     
  4. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
  5. adan_eslavo

    adan_eslavo Archmage of all Pixels Supporter

    Joined:
    Apr 23, 2017
    Messages:
    1,511
    Gender:
    Male
    Location:
    Łódź, Poland
    I send you whole file. It works well. You probably forgot about one thing I told you before. I used one additional function from Community Patch' Custom Mod Options: BattleJoined. You need to enable it in some sql file. I played alongside with MUCfVP and there is such file which enables this option and many more. But for everyone playing without MUCfVP it will not work.
    Code:
    -- Melting Great Turkish Bombard
    UPDATE CustomModOptions    SET Value = 1 WHERE Name = 'EVENTS_BATTLES';
    non-coastal city
    upload_2018-10-7_11-28-54.png
    coastal city
    upload_2018-10-7_11-29-20.png
     

    Attached Files:

    Last edited: Oct 7, 2018
  6. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
  7. adan_eslavo

    adan_eslavo Archmage of all Pixels Supporter

    Joined:
    Apr 23, 2017
    Messages:
    1,511
    Gender:
    Male
    Location:
    Łódź, Poland
    Nice to have new civ available. What is the stage of Canada. Any plans after Canada?

    You can post images of Jewel of the East from my post on main thread.
     
  8. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
  9. infidel88

    infidel88 Chieftain

    Joined:
    Jul 29, 2013
    Messages:
    478
    Location:
    Yuggoth
    How come 'blame canada' is not a war theme'? ;)
     
    CppMaster and adan_eslavo like this.
  10. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
    If you can find me a full orchestral version of blame Canada, then maybe I’ll see what we can do.

    I’m not that happy with how the mod uses canada’s National anthem for the music... as if we don’t have any other Canadian music. I was trying to find a fully orchestrated rendition of “the northwest passage”, but nothing quite fit the bill.
     
  11. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
    Really interested to hear back from people on balance. I'm partway through a game with Timurids, and I'm finding the UA pretty toothless.

    I puppeted 3 cities and razed 3 more by mid medieval. I haven't hit the big power surge in Renaissance, but I can't say that an extra +9:c5gold:/:c5production:/:c5science:/:c5culture:/:c5war: is making a tremendous impact. There's also the matter of this bonus getting weaker as you enter later eras (fewer turns left), and not scaling with era ( :c5production:/:c5science:/:c5culture:/:c5gold: costs scale exponentially). I feel like the relatively late Renaissance power spike might feel unfair, because focusing on peaceful play until your power spike means giving up hundreds of yields off your UA.

    I'm considering adding a scaling by era to the UA. Thoughts?

    On a brighter note, I'm looking forward to getting back to my game and hitting Renaissance. The Tumen comes 1 tech early, but Chemistry can be reached by ignoring Chivalry. I can get my unique lancer while skipping the Knights tech :lol:. I also can't wait to put the Farsakh Cannon through its paces in a real, full fight.
     
    Last edited: Oct 11, 2018
  12. maptap

    maptap Chieftain

    Joined:
    Mar 6, 2016
    Messages:
    50
    Location:
    NY
    I'm actually wrapping up a game with the timurids right now. I have just entered the atomic era. This is only my second attempt at a warmongering civ ever, so bear that in mind.

    Even though it is really tempting to make full use of the UA and start warring ASAP, I found that due to the unique units coming so late, I was very weak compared to neighbors in the early game. When I did get my unique units I went from score rank 12 to 6 in 1 era. I have probably razed like 40 cities by now. I really like the mechanic to encourage warring non stop - I have never had this much fun playing civ.

    I agree with you that the UA seems very lackluster. It just comes so late for it to be worth it. The extra supply is really the only noticeable part. Some ideas I had: double the yields increase (except for supply) and provide either a one time production boost or a free supply unit at the capital each time a city is razed. Maybe3 add a faith yield?

    Anyway, thanks for all your great mods!
     
    Last edited: Oct 11, 2018
  13. Minh Le

    Minh Le Chieftain

    Joined:
    Aug 20, 2018
    Messages:
    793
    Gender:
    Male
    Tried a game with Tirmurid with a fun setup. I add 4 more civs to a standard pangea map so it becomes very crowded. I razed cities from ancien era but really the UA feel a bit underpower. It ram up quick early game but fell off after that. Compair to China UA which boost every cities and you have bonus on settle it feels very weak. Stealing unique buildings is nice though.
     
  14. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
    The military supply certainly is noticeable, yeah. It makes war weariness pretty much ignorable, since your supply buffer gets pretty generous.

    How about this?:
    Whenever you Capture or :c5razing: Destroy a city, Palace gains +2:c5culture:Culture, :c5science: Science, :c5gold:Gold, :c5production:Production, and :c5faith:Faith, increasing by 1 every era. Buildings from captured cities are immediately constructed in your :c5capital: Capital.
    • Increase base amount to +2
    • swap :c5war:Military supply for :c5faith:faith
    • add scaling with era
    Sounds good?
     
  15. maptap

    maptap Chieftain

    Joined:
    Mar 6, 2016
    Messages:
    50
    Location:
    NY
    Hmm. I'm honestly not sure. The supply felt really necessary, because of the amount of war needed to really make use of the UA. Maybe the supply should only go up on capturing the city and not increase with era?
     
  16. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
    That's really hard to parse in the UA description. People will get confused, and it takes a lot of lines to explain. What if I added 2-3 military supply onto the Registan?
     
  17. maptap

    maptap Chieftain

    Joined:
    Mar 6, 2016
    Messages:
    50
    Location:
    NY
    What about each deh increasing supply by 1? Is that possible?
     
  18. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
    It would be possible, but it's pretty incongruous with the rest of the Deh's theme. Plus, that would only be a fix if everyone is playing with 4UC.

    Is a lack of infinitely scaling supply really that big a problem? Other perpetual war civs like Sweden, Mongolia and Huns don't get any bonus supply, and they get on just fine. The only ones that get more supply are Japan and 4UC Assyria.
     
  19. maptap

    maptap Chieftain

    Joined:
    Mar 6, 2016
    Messages:
    50
    Location:
    NY
    I'm not sure if the lack would be a problem, all I know is that I was constantly at -40 supply from war weariness ever since Industrial. At times, I was literally at war with all 15 AIs at once :lol:.

    (However, this could be due to my lack of experience with warmonger civs).

    The reason why I think supply is extra important for Timur is because his UA encourages very few cities, leading to much less supply.

    Just my 2 cents.
     
  20. pineappledan

    pineappledan Warlord

    Joined:
    Aug 9, 2017
    Messages:
    3,995
    Gender:
    Male
    Location:
    Alberta, Canada
    You should aim for short bursts of hyperviolence, rather than big, dragged out affairs. Use peace treaty time to secure your positions, heal up, reposition troops, recover from war weariness. Let the treaty expire, and hit them again.

    I think Registan is where any supply should be added, if any. I'm thinking either a flat +3:c5war:, or a +15%:c5war: scaling on :c5citizen:city population
     
    Last edited: Oct 11, 2018

Share This Page