turingmachine
Emperor
- Joined
- May 4, 2008
- Messages
- 1,438
Hi, so my goal is to look through all the plots in a city's three ring radius, find if one or more plots has a specific feature, then I do a specific event on that feature plot.
I was trying something like:
With the next line setting an improvement. The problem I am having is that instead of just setting the improvement on the forest plot, it is setting it on every plot in the city's three rings. It also sets the improvement regardless of if there's any forest in the city's radius.
I think I've just completely confused myself. If anyone has any advice?
I was trying something like:
Code:
for i = 0, pCity:GetNumCityPlots() - 1, 1 do
local plot = pCity:GetCityIndexPlot( i )
if plot:GetFeatureType(GameInfoTypes.FEATURE_FOREST) then
With the next line setting an improvement. The problem I am having is that instead of just setting the improvement on the forest plot, it is setting it on every plot in the city's three rings. It also sets the improvement regardless of if there's any forest in the city's radius.
I think I've just completely confused myself. If anyone has any advice?