| 10-09-2006, 09:59 AM | #2 |
From how I understand it I guess you'd have to make a grid system, which would be region madness. Or use coordinates. Or calculate moved distance. Or something! :) |
| 10-09-2006, 10:39 AM | #3 |
I guess you'd be looking at a pathing system to count the number of squares to move (and get the shortest path). Depth First Search (or A* variation) would be fastest, but wouldn't absolutely guanrantee shortest path (pretty likely though, unless you have lots of obstacles in random places), Breadth First Search would get you guanranteed shortest path, but would be more process-intensive. |
| 10-09-2006, 04:05 PM | #4 |
I fail to see how a grid system would be region madness, you could create the rects dynamically with a trigger and leave them in a matrix, the hard thing is making a matrix, blizz forgot to let us do that... |
| 10-09-2006, 04:20 PM | #5 |
Well, erm you said it :) Hard to make the matrix, easier is placing the region, but enter and leave regions don't happen in the exact same place/time they are supposed to and you are bound to make some mistake in placing all of them on the map. It would also need a makeshift coordinate system for referencing them. |
| 10-09-2006, 04:44 PM | #6 | |
Quote:
|
| 10-09-2006, 06:32 PM | #7 |
is there a way to get the X and y coordinates of the selected unit and the mouse? |
| 10-09-2006, 07:30 PM | #8 |
Uhm, my idea would be a unit (very slow one) get the order to move, then you set the x and y of the triggering unit and another x and y value to the target point, check if it's in reach and when it is you move it to that point else you move the unit to it's original position back. |
| 10-09-2006, 08:39 PM | #9 | ||
Quote:
Yep. IIRC, its in the real-type functions. Quote:
Using trackables. |
| 10-10-2006, 02:02 AM | #10 | |
Quote:
Ok i read about the trackables and in the link you gave me i seen nothing about getting the X and Y location of the mouse. (I'm not looking for the location of an object when mouse over). |
| 10-10-2006, 02:07 AM | #11 |
The only way you can know the location of the mouse is to cover the field with trackables and have the fire mouse-over events. |
| 10-10-2006, 02:21 AM | #12 |
ok so say i get the mouse XY locations to work, how would i then find out how to avoid objects. |
| 10-10-2006, 04:14 AM | #13 |
Then you'd need something to figure out a path like what blu said. |
| 10-10-2006, 09:33 AM | #14 |
I don't think trackables will work for you, they cannot be destroyed or moved or changed, just created. |
| 10-10-2006, 10:45 AM | #15 |
Why would they not work? Essentially he would have a grid of trackables, much like a grid of regions. Determining where the cursor is would be based on determining which trackable fired the event or which trigger fired, which is rather simple to do. He has no need to ever change the trackable, just the way he deals with the event firing. The only problem is it would be impractical to use in multiplayer since you cannot determine which cursor fires the event, unless of course, there's a method I'm unaware of. |
