T Tryhard Trevor Chieftain Joined Feb 29, 2016 Messages 22 Jun 6, 2016 #1 Currently working on a custom Civ. Does anyone have any suggestions on what the best way to get and loop through all the plots in a city?
Currently working on a custom Civ. Does anyone have any suggestions on what the best way to get and loop through all the plots in a city?
whoward69 DLL Minion Joined May 30, 2011 Messages 8,721 Location Near Portsmouth, UK Jun 6, 2016 #2 The basic code is Code: for i = 0, pCity:GetNumCityPlots()-1, 1 do local pPlot = pCity:GetCityIndexPlot(i) if (pPlot) then -- Do some more tests here end end If you need finer grained control (city working the plot, etc), see CityView.lua for further details
The basic code is Code: for i = 0, pCity:GetNumCityPlots()-1, 1 do local pPlot = pCity:GetCityIndexPlot(i) if (pPlot) then -- Do some more tests here end end If you need finer grained control (city working the plot, etc), see CityView.lua for further details