Klisz
King
- Joined
- Aug 18, 2014
- Messages
- 804
And then I was also wondering if anyone could program something like this as well:
Code:When one of your units dies, a replacement unit has a 20% chance to appear outside the Capital.
Code:
GameEvents.UnitKilledInCombat.Add(function(iKillingPlayer, iKilledPlayer, iKilledUnitType) {
local pPlayer = Players[iKilledPlayer]
if pPlayer:GetCivilizationType() == iCiv and Game.Rand(5) == 0 then
local pCapital = pPlayer:GetCapitalCity()
if pCapital then
local pPlot = pCapital:GetCityIndexPlot(1)
pPlayer:InitUnit(iKilledUnitType, pPlot:GetX(), pPlot:GetY()):JumpToNearestValidPlot()
end
end
})
Just make sure you have a "local iCiv = GameInfoTypes.CIVILIZATION_ETC" line before this.