Civilization Start Times

MAHRana

Prince
Joined
May 22, 2010
Messages
323
i was playing Into the Renaissance and i noticed that the Mongols start the game later than the other civs in the scenario. Is there a way to mod the game to make a scenario where settlers are spawned after a certain year/era/tech has been reached along the lines of Rhye's and Fall? It could be a nice feature, especially when it comes to immersion, and i think it's a possibility that'll make scenarios more interesting.
 
Mongols do start late in ItR (about turn 35 or so, IIRC). Gives time for Russia to get prepared.
 
Found some LUA scripts that make the Mongols appear later in the game:

Spoiler :
ScoreHolyCities();

if (iTurn == 40) then
BringInMongols();
elseif (iTurn == 50 or iTurn == 60 or iTurn == 70 or iTurn == 85 or iTurn == 110) then
ReinforceMongols();
elseif (iTurn == 150) then
MongolsPullOut();
end


Spoiler :
function BringInMongols()

FindMongolStartPlot();

local iX = GetPersistentProperty("MongolStartX");
local iY = GetPersistentProperty("MongolStartY");

local start_plot = Map.GetPlot(iX, iY);
local pPlayer = Players[12];
pTeam = Teams[pPlayer:GetTeam()];
pPlayer:SetStartingPlot(start_plot);

local capital = pPlayer:InitCity(start_plot:GetX(), start_plot:GetY());
capital:SetPopulation(5, true);

local iBuildingID;
iBuildingID = GameInfoTypes["BUILDING_PALACE"];
capital:SetNumRealBuilding(iBuildingID, 1);
iBuildingID = GameInfoTypes["BUILDING_MONUMENT"];
capital:SetNumRealBuilding(iBuildingID, 1);
iBuildingID = GameInfoTypes["BUILDING_SHRINE"];
capital:SetNumRealBuilding(iBuildingID, 1);
iBuildingID = GameInfoTypes["BUILDING_GRANARY"];
capital:SetNumRealBuilding(iBuildingID, 1);
iBuildingID = GameInfoTypes["BUILDING_WALLS"];
capital:SetNumRealBuilding(iBuildingID, 1);
iBuildingID = GameInfoTypes["BUILDING_BARRACKS"];
capital:SetNumRealBuilding(iBuildingID, 1);
iBuildingID = GameInfoTypes["BUILDING_LIBRARY"];
capital:SetNumRealBuilding(iBuildingID, 1);
iBuildingID = GameInfoTypes["BUILDING_MARKET"];
capital:SetNumRealBuilding(iBuildingID, 1);

local iTechIndex = GameInfoTypes["TECH_CHIVALRY"];
pTeam:SetHasTech(iTechIndex, true);

iUnitID = GameInfoTypes["UNIT_SETTLER"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_SETTLE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_SETTLER"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_SETTLE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_SETTLER"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_SETTLE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_WORKER"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_WORKER, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_WORKER"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_WORKER, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_WORKER"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_WORKER, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_SWORDSMAN"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_DEFENSE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_SWORDSMAN"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_DEFENSE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_SWORDSMAN"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_DEFENSE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KHAN"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_GENERAL, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_CATAPULT"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();
end


Spoiler :
function FindMongolStartPlot()

local bestX = 78;
local bestY = 53;

if (not AreAllAdjacentUnoccupied(bestX, bestY)) then

-- Go North 10 plots
for iY = bestY + 1, bestY + 10, 1 do
if (AreAllAdjacentUnoccupied(bestX, iY)) then
SetPersistentProperty("MongolStartX", bestX);
SetPersistentProperty("MongolStartY", iY);
return true;
end
end

-- Go South 10 plots
for iY = bestY - 1, bestY - 10, -1 do
if (AreAllAdjacentUnoccupied(bestX, iY)) then
SetPersistentProperty("MongolStartX", bestX);
SetPersistentProperty("MongolStartY", iY);
return true;
end
end

-- Go North 20 more plots
for iY = bestY + 11, bestY + 30, 1 do
if (AreAllAdjacentUnoccupied(bestX, iY)) then
SetPersistentProperty("MongolStartX", bestX);
SetPersistentProperty("MongolStartY", iY);
return true;
end
end

-- Go South 20 more plots
for iY = bestY - 11, bestY -30, -1 do
if (AreAllAdjacentUnoccupied(bestX, iY)) then
SetPersistentProperty("MongolStartX", bestX);
SetPersistentProperty("MongolStartY", iY);
return true;
end
end

return false;
end

SetPersistentProperty("MongolStartX", bestX);
SetPersistentProperty("MongolStartY", bestY);
return true;
end


Spoiler :
function ReinforceMongols()

local pPlayer = Players[12];
local capital = pPlayer:GetCapitalCity();

iUnitID = GameInfoTypes["UNIT_SWORDSMAN"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_DEFENSE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_SWORDSMAN"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_DEFENSE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KHAN"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_GENERAL, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_MONGOLIAN_KESHIK"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_CATAPULT"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_RANGED, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();

iUnitID = GameInfoTypes["UNIT_SETTLER"];
unit = pPlayer:InitUnit (iUnitID, capital:GetX(), capital:GetY(), UNITAI_SETTLE, DirectionTypes.DIRECTION_WEST);
unit:JumpToNearestValidPlot();
end


Spoiler :
function MongolsPullOut()

end


They were in the "TurnsRemaining" LUA file. Would these scripts work with a Human controlled civ?
 
So, if I'm reading this right, Mongols appear on turn 40 with a founded capital, 3 settlers, 3 workers, 3 Swordsmen, 6 Keshiks, a Kahn and a Catapult, and then get another Settler, Kahn, Catapult, 2 Swordsmen and 3 Keshiks on each of turns 50, 60 70, 85 and 110. No wonder they are so bothersome.
 
Top Bottom