Right now, my idea for solving this "problem" is a theoretical one, which needs to be first validated of its possibility, and then translated into MQ2's language. I am making this announcement because I know that I will be needing help over the development of this macro. Hopefully this possibility will ignite a spark in some of you macro developers out there to join the "cause".
The whole basis for this macro will lie within a prioritizing system. Every pathing coordinate placed on a given zone map will have a priority. This can be explained more easily with a simple diagram.
Take a zimple zone map. It has its pathing-related problems. Walls, rooms, doors, bodies of water, traps, etc. If you start with a zone map like this, the first step to creating a pathing system would be to place pathing coordinates on it (ignore teal squares for now, just look at black dots):
http://www.samuraiwar.com/bbs/album_pic.php?pic_id=5973
Take a moment to notice how I placed the dots. They are at key points. For example, I plotted the dots around the dangerous lava pit, and where doorways were involved, I plotted the dots right smack dab in the middle of the doorway. This ensures that when we're walking around, we don't go where we shouldn't, and we don't get stuck.
Simple enough. Now, we have to make sense of it all. The prioritizing system allows the usage of main paths, as well as connecting subpaths. One main path takes you through the whole zone, subpaths take you to more specific destinations. Think of it as a river... all streams collect into one main river. Now taking this into consideration, we also have to remember how this system is going to be used. We will find the coordinates of our target, and then find the closest pathing coordinate to our destination. We'll then follow the paths and subpaths to this coordinate, and finally, to our destination. Now, we also have to use a naming convention that is practical for the MQ2 language, and also makes some sort of sense. For now, I have just used a X.Y.Z.N system, where X is the main path coordinate handle, Y is the sub path coordinate handle, and Z is the sub-sub path coordinate handle, etc. Now, I haven't clearly thought out a way that this would work with MQ2, BUT if MQ2 can handle multi-dimensional arrays, this system would be easily converted to something along the lines of ${Coord[3][2][0]}. Now, lets refer to the following map for an example scenario:
http://www.samuraiwar.com/bbs/album_pic.php?pic_id=5974
So, how in hell would this work? Well, we'll need some examples. Remember those teal dots? They're our examples. I've labled the dots A-D for our purposes:
http://www.samuraiwar.com/bbs/album_pic.php?pic_id=5975
For starters, lets say we want to get from 1 to 5. Well, we're at 1 and our destination is 5. 5 is bigger than 1, so we're going up in the path coordinates. That means our next step is 2. Once we're at 2, our destination is still 5. 2 is less than 5, so we're still going up in the path coordinates. That means our next step is 3. So on and soforth, until we get to 5. Hooray!
Now, lets do something a little more complicated. Lets get from 1.0 to 3.2.0. We're at 1 and our destination is 3.X.X, so we have to go up the coordinate ladder, and go to 2, then to 3. Now that we're at 3, we still have .X.X to deal with, which were only renamed because they were not relevent to the IMMEDIATE step that had to be taken. .X.X are still .2.0 in our variable memories. Now we're at 3.0, and we want to get to 3.2.X, so we're going up, we're gonna go to 3.1.X, then 3.2.X. Well, now we're at 3.2.0, and our destination is 3.2.0. Hey... we're at our destination! Splendid.
What if we want to get back to 1? We're at 3.2.0, and our destination is 1. Well right now, we aren't in the same LEVEL as 1 (that being the main path of 1.0, 2.0, 3.0 etc.), so we're going to have to get to that level. We're at 3.2.0, the 0 level for the 3rd sub-level, so we can move on to the second sub-level. Had we been at say, 3.2.1, we would have to get to the .0 coordinate for our current sub-level. Why? Because ONLY THE .0 COORDINATES CONNECT TO THE HIGHER PRIORITY LEVEL. (Go ahead, take a look at the map). Right, so we're at 3.2.0, and its safe to move on to the 2nd sub-level. Our destination is 3.0 because it is in the same level as our final destination, 1.0. (If you notice, the pattern here to get back to the a higher priority levels is to keep going to the .0 coordinates for each level. So, we're at 3.2.0, our destination is 3.0, 2 is greater than 0, so we're going down the coordinate ladder. We go to 3.1.0, and then 3.0. Now we're at 3.0, and we can go to 1.0. *PHEW*
Did you get all that? If not, try reading it all over again from the 1-5 scenario. I'm a programmer, not a teacher, but I'm trying my best here to explain my reasoning.
Okay, now thats great if you want to get around town, but what if you want to get to a specific destination? Let's say we want to get to D. We'll start off by finding the pathing coordinate thats closest to D. With MQ2 in mind, we would loop through all of our pathing coordinates, and do a distance formula on each one against D, and each time we find one thats closer than the previous closest coordinate, we'd make note of it. We'd be left with the closest coordinate to D out of all of our coordinates. (May be a little sloppy, but can't think of any other way to do it). So, assuming this system works, 2.2.0 is the closest coordinate to D. Now we have to find the coordinate that's closest to us. Lets say we're at C. The closest coordinate to C is 3.1.0. Now we just go from our starting coordinate to our ending coordinate, and then to our destination, using the system described above.
Now, this system isn't planned to be perfect. There will be some situations that don't fit the norm. Lets say we're at D again, and we want to get to B. The closest coordinate to B is 3.2.0. So we'll have to go to 3.2.0 and THEN B. Doesn't that seem a little wierd? We're practically going into another room just to get to B. Because of situations like this, we'll have to plan out our coordinates carefully. This may mean that we'll have to bring triginometry or something into the mix, to find the best way to plot coordinates. But that isn't so important right now, that can be dealt with when it comes up. Right now, the focus should be on determining the possibility of this project.
Thank you very much for your time, I hope you enjoyed reading this, and I would be happy to hear if you are interested. If you are confused by something, please say so, and I will try to rewrite it in a clearer manner. Questions, comments, etc. feel free to post.
Signing out,
Vayeco Dynn


