pineappledan
Deity
Yes, Egypt already does this.Is it possible to disable building by sql for one civ? If you disable building classfor Armory will the dummy be accessible?
Aztec also does this in base VP.
It will not affect our ability to put whatever building we want in a city via lua, since sql will only remove their ability to build them
3 things I haven't gotten to work properly with the timurids lua:What thing do you have planned for Timurids lua?
1. Timurids build all buildings from captured cities in their capital immediately. This includes unique buildings, except for a few exceptions (won't build unique buildings which give unique promotions)
It's a very big code, since it has to go through each possible UB. Here's a snippet of it, just dealing with Arsenal replacements
Code:
function JewelOfTheEast (iOldOwner, bIsCapital, iX, iY, iNewOwner, iPop, bConquest)
local nPlayer = Players[iNewOwner];
local oldOwner = Players[iOldOwner];
local nCapital = nPlayer:GetCapitalCity()
local city = Map.GetPlot(iX, iY):GetPlotCity();
local title = "Jewel of the East";
if nPlayer:GetCivilizationType() == TimuridsID then
if (city:GetNumBuilding(GameInfoTypes.BUILDING_ARSENAL) > 0) then
if oldOwner:GetCivilizationType() == GameInfoTypes.CIVILIZATION_AUSTRIA then
nCapital:SetNumRealBuilding(GameInfoTypes.BUILDING_ARSENAL, 0);
nCapital:SetNumRealBuilding(GameInfoTypes.BUILDING_KREPOST, 0);
nCapital:SetNumRealBuilding(GameInfoTypes.BUILDING_AUSTRIA_STANDSCHUTZEN, 1);
local descr = "Foreign architects have constructed a " .. Locale.ConvertTextKey(GameInfo.Buildings[GameInfoTypes.BUILDING_AUSTRIA_STANDSCHUTZEN].Description) .. " in your [ICON_CAPITAL] Capital!";
nPlayer:AddNotification(NotificationTypes.NOTIFICATION_WONDER_COMPLETED, descr, title, nCapital:GetX(), nCapital:GetY(), GameInfoTypes.BUILDING_AUSTRIA_STANDSCHUTZEN, -1);
elseif oldOwner:GetCivilizationType() == GameInfoTypes.CIVILIZATION_RUSSIA then
nCapital:SetNumRealBuilding(GameInfoTypes.BUILDING_ARSENAL, 0);
nCapital:SetNumRealBuilding(GameInfoTypes.BUILDING_AUSTRIA_STANDSCHUTZEN, 0);
nCapital:SetNumRealBuilding(GameInfoTypes.BUILDING_KREPOST, 1);
local descr = "Foreign architects have constructed a " .. Locale.ConvertTextKey(GameInfo.Buildings[GameInfoTypes.BUILDING_KREPOST].Description) .. " in your [ICON_CAPITAL] Capital!";
nPlayer:AddNotification(NotificationTypes.NOTIFICATION_WONDER_COMPLETED, descr, title, nCapital:GetX(), nCapital:GetY(), GameInfoTypes.BUILDING_KREPOST, -1);
elseif not nCapital:IsHasBuilding(GameInfoTypes.BUILDING_ARSENAL) then
nCapital:SetNumRealBuilding(GameInfoTypes.BUILDING_ARSENAL, 1);
local descr = "Foreign architects have constructed a " .. Locale.ConvertTextKey(GameInfo.Buildings[GameInfoTypes.BUILDING_ARSENAL].Description) .. " in your [ICON_CAPITAL] Capital!";
nPlayer:AddNotification(NotificationTypes.NOTIFICATION_WONDER_COMPLETED, descr, title, nCapital:GetX(), nCapital:GetY(), GameInfoTypes.BUILDING_ARSENAL, -1);
end
end
end
end
GameEvents.CityCaptureComplete.Add(JewelOfTheEast)
Code:
function MadrasahTradeYields(PlayerID)
local pPlayer = Players[PlayerID]
if (pPlayer:IsAlive() and pPlayer:GetCivilizationType() == TimuridsID) then
print("Trade out!");
local Routes = pPlayer:GetTradeRoutes();
local NumRoutes = pPlayer:GetNumInternationalTradeRoutesUsed()
if (NumRoutes > 0) then
for city in pPlayer:Cities() do
local iCounter = 0;
local cityID = city:GetID();
local iMadrasah1 = GameInfoTypes.BUILDING_TIMURID_MADRASAH_1_MOD
local iMadrasah2 = GameInfoTypes.BUILDING_TIMURID_MADRASAH_2_MOD
local iMadrasah3 = GameInfoTypes.BUILDING_TIMURID_MADRASAH_3_MOD
for tradeRouteID, tradeRoute in ipairs(Routes) do
local pFromCity = tradeRoute.FromCity
local pFromCiv = tradeRoute.FromCivilizationType
local pToCity = tradeRoute.ToCity
local pToCiv = tradeRoute.ToCivilizationType
local dPlayer = Players[DestPlayer]
if ((pFromCity:GetNumBuilding(GameInfoTypes.BUILDING_TIMURID_MADRASAH_MOD) > 0) and pFromCiv ~= TimuridsID) or ((pToCity:GetNumBuilding(GameInfoTypes.BUILDING_TIMURID_MADRASAH_MOD) > 0) and pToCiv ~= TimuridsID) then
iCounter = iCounter + 1
end
end
if city:IsHasBuilding(iMadrasah1) then
city:SetNumRealBuilding(GameInfoTypes.BUILDING_TIMURID_MADRASAH_1_DUMMY, iCounter)
end
if city:IsHasBuilding(iMadrasah2) then
city:SetNumRealBuilding(GameInfoTypes.BUILDING_TIMURID_MADRASAH_2_DUMMY, iCounter)
end
if city:IsHasBuilding(iMadrasah3) then
city:SetNumRealBuilding(GameInfoTypes.BUILDING_TIMURID_MADRASAH_3_DUMMY, iCounter)
end
end
end
end
end
GameEvents.PlayerDoTurn.Add(MadrasahTradeYields)
Code:
function CapitalBonusOnRaze(hexPos, iOldOwner, cityID, iNewOwner)
local nPlayer = Players[iNewOwner];
local nCapital = nPlayer:GetCapitalCity()
if nPlayer:GetCivilizationType() == TimuridsID then
nCapital:SetNumRealBuilding(bTimDummy, (nCapital:GetNumRealBuilding(bTimDummy) + 1))
if nPlayer:IsHuman() and nPlayer:IsTurnActive() then
local vCityPosition = PositionCalculator(nCapital:GetX(), nCapital:GetY())
nPlayer:AddNotification(NotificationTypes.NOTIFICATION_INSTANT_YIELD,
'Your Palace in [COLOR_POSITIVE_TEXT]'..nCapital:GetName()..'[ENDCOLOR] has gained more yields: +1 [ICON_CULTURE] Culture, +1 [ICON_SCIENCE] Science, +1 [ICON_GOLD] Gold, and +1 [ICON_PRODUCTION] Production,[NEWLINE][ICON_BULLET], and +1 [ICON_WAR] Military Supply in your [ICON_CAPITAL] Capital',
'Artisans fled to '..nCapital:GetName(),
nCapital:GetX(), nCapital:GetY(), nCapital:GetID())
end
end
end
Events.SerialEventCityDestroyed.Add(CapitalBonusOnRaze)
Code:
function TimuridNoVillage (iPlayer, iUnit, iX, iY, iBuild)
if iBuild == GameInfoTypes.IMPROVEMENT_TRADING_POST and Players[iPlayer]:GetCivilizationType() == TimuridsID then
return false
else return true
end
end
Last edited: