Tomatekh's Timurids for VP

I will think of it, but it's for sure doable.
 
Last edited:
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.
 
Tell me if it worked the way you want.
 
Just tested the new code. Nothing happens when a city is conquered. Lua shows no runtime errors
 
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
 

Attachments

  • Timurid lua scripts.zip
    3 KB · Views: 118
Last edited:
It is indeed working.

I have updated the resources and the OP with the new change to the UA. Thank you so much for your work on that lua, @adan_eslavo

Now I need to finish up Canada.
 
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.
 
Please find attached my Canada for VP.

I'll send you a PM detailing what is still needing work; it's 2 relatively short lua codes which are causing trouble
 

Attachments

  • Canada for VP (v1).zip
    18.8 MB · Views: 284
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.
 
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:
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:
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.
 
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?
 
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?
 
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?
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?
 
What about each deh increasing supply by 1? Is that possible?
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.
 
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.
 
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:
Top Bottom