TheLunarArmy
Chieftain
Hi guys,
I'm busy working on my first civ mod and got the Lua mechanics working perfectly, but now I want to get a little fancy and add some floating text pop-up whenever I found a new city.
^This floating text
The plan is whenever a Non- city is founded it gets +2 and +15 . It would be great if I get some text to go with it, but the for the life of me I cannot find the appropriate Lua references to do this.
Below I posted my working Lua code for the actual mechanics (free feel to try it out/use it) but now I just want to add my little fancy message that says something along the lines: "Universal Health Care: +2 , +15 ."
Thanks!
I'm busy working on my first civ mod and got the Lua mechanics working perfectly, but now I want to get a little fancy and add some floating text pop-up whenever I found a new city.
Spoiler What the hell is he talking about? :
^This floating text
The plan is whenever a Non- city is founded it gets +2 and +15 . It would be great if I get some text to go with it, but the for the life of me I cannot find the appropriate Lua references to do this.
Below I posted my working Lua code for the actual mechanics (free feel to try it out/use it) but now I just want to add my little fancy message that says something along the lines: "Universal Health Care: +2 , +15 ."
Thanks!
Code:
GameEvents.PlayerCityFounded.Add(
function (iPlayer, iCityX, iCityY)
local pPlayer = Players[iPlayer];
local pPlot = Map.GetPlot(iCityX, iCityY);
local pCity = pPlot:GetPlotCity();
local cPop = pCity:GetPopulation();
local cFood = pCity:GetFood();
if (pPlayer:IsAlive()) then
if (pPlayer:GetCivilizationType() == GameInfoTypes.CIVILIZATION_CANADA) then
if ( pPlayer:GetNumCities() > 1 and not pCity:IsOriginalCapital() ) then
pCity:SetPopulation(cPop + 2, true);
pCity:SetFood(cFood + 15);
-- TODO: Fancy little floating text message
end
end
end
end)