[lua] Map.PlotXYWithRangeCheck() description

Nefliqus

Prince
Joined
Sep 16, 2010
Messages
400
Location
Poland
[lua] Map.PlotXYWithRangeCheck() description:

for direction_plot_X = -4, 4 do --all directions loop
for direction_plot_Y = -4, 4 do --all directions loop
local otherPlot = Map.PlotXYWithRangeCheck(start_plot_X, start_plot_Y, direction_plot_X, direction_plot_Y, distance_in_plots);
end
end

is it ok?
 
[lua] Map.PlotXYWithRangeCheck() description:

for direction_plot_X = -4, 4 do --all directions loop
for direction_plot_Y = -4, 4 do --all directions loop
local otherPlot = Map.PlotXYWithRangeCheck(start_plot_X, start_plot_Y, direction_plot_X, direction_plot_Y, distance_in_plots);
end
end

is it ok?

What exactly are you trying to do? The Map.PlotXYWithRangeCheck function will return nil if the plot isn't within the given range of the starting plot, so your loop will successfully assign either nil or a valid plot to the otherPlot variable. You haven't done anything with it yet though, so I don't know what your question is... ?
 
What exactly are you trying to do? The Map.PlotXYWithRangeCheck function will return nil if the plot isn't within the given range of the starting plot, so your loop will successfully assign either nil or a valid plot to the otherPlot variable. You haven't done anything with it yet though, so I don't know what your question is... ?

Thank you for this info, now I understand this function in 100%. I use it to place barbs camp not close to Civ starting position. It works ok.
 
Back
Top Bottom