The problem I am trying to come to grips with is this: I have two CvPlots and need to check all the plots that are in direct line between these plots for certain conditions. Since I have only recently begun to mod the SDK, I am unsure which would be the best code in the DLL to base my function on.
To explain better what I am trying to do, let me explain how I would proceed if I had to start from scratch. I would make a loop that starts on the FromPlot, gets all adjacent plots, picks the plot that is closest to the Destination Plot, and then increases a counter if the conditions that I want to check are met. The Loop would then re-run with the same Destination Plot, setting the FromPlot to the plot that was closest to it among the adjacent plots of the previous loop, until the FromPlot is equal to the Destination Plot. Does that make sense?
Now I cannot imagine that there is no such function yet in the DLL. I haven't found there what I need yet, although I really do not understand the A* Pathfinding engine. Could the generatePath Function be used for my purposes? Note that I would want to treat unpassable terrain equal to all other plots. What matters is the actual distance, plot or step. Yet I do not need the actual distance as an integer, but a list of all the CvPlots that jointly make up the shortest path between two plots in terms of distance.
It would be great if you could give me some hints that can make my life easier, before I try implementing the function described above from scratch.
To explain better what I am trying to do, let me explain how I would proceed if I had to start from scratch. I would make a loop that starts on the FromPlot, gets all adjacent plots, picks the plot that is closest to the Destination Plot, and then increases a counter if the conditions that I want to check are met. The Loop would then re-run with the same Destination Plot, setting the FromPlot to the plot that was closest to it among the adjacent plots of the previous loop, until the FromPlot is equal to the Destination Plot. Does that make sense?
Now I cannot imagine that there is no such function yet in the DLL. I haven't found there what I need yet, although I really do not understand the A* Pathfinding engine. Could the generatePath Function be used for my purposes? Note that I would want to treat unpassable terrain equal to all other plots. What matters is the actual distance, plot or step. Yet I do not need the actual distance as an integer, but a list of all the CvPlots that jointly make up the shortest path between two plots in terms of distance.
It would be great if you could give me some hints that can make my life easier, before I try implementing the function described above from scratch.