turingmachine
Emperor
- Joined
- May 4, 2008
- Messages
- 1,438
Hi guys, I'm wondering if you can help me out with something.
I know I can loop through all the plots adjacent to a plot by doing something like:
But I need to loop through all the plots in a two tile radius, not just one. I'm not sure how to do this. Is it something like doing a separate loop for the X and Y plot and then combining them?
I know I can loop through all the plots adjacent to a plot by doing something like:
Code:
directions = {DirectionTypes.DIRECTION_NORTHEAST, DirectionTypes.DIRECTION_EAST, DirectionTypes.DIRECTION_SOUTHEAST,
DirectionTypes.DIRECTION_SOUTHWEST, DirectionTypes.DIRECTION_WEST, DirectionTypes.DIRECTION_NORTHWEST}
for loop, direction in ipairs(directions) do
local pPlot = Map.PlotDirection(pCityPlot:GetX(), pCityPlot:GetY(), direction)
But I need to loop through all the plots in a two tile radius, not just one. I'm not sure how to do this. Is it something like doing a separate loop for the X and Y plot and then combining them?