Are you planning to upload your awesome spell or system to Hive? Please review the rules here.Dismiss Notice
The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!Dismiss Notice
We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.Dismiss Notice
The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.Dismiss Notice
Check out the Staff job openings thread.Dismiss Notice
Submitted by PurgeandFire
- A GUI version of:
No credits are needed. If you do give credits, then give credits to Rising_Dusk or Vexorian for the original implementation of the pathing check.
This is to help spells when checking for pathing. I noticed that some knockbacks and such have poor checking, as they only check if the terrain walkability is off. That only checks the default pathing (cliffs and such), but the unit will slide through buildings and destructables. I know people won't use the vJASS version, so I made a GUI implementation.
- There are two common methods for checking pathing:
(1) Move an item there. (Vexorian/Rising_Dusk) Check if the item's position is close to the destination point. If it isn't close, then that means that the wc3 engine repositioned it because that point isn't pathable. Seems simple, right? Well, there are some issues:
- Items are similar to unit pathing is most ways... except units can walk through items. Items can't be positioned near other items, however. This is why the enumeration is necessary--it hides items so that it accurately determines whether the point is walkable for a unit.
- There may be some issues in really crowded areas (a.k.a. when the wc3 engine desperately has to find the nearest pathable point).
The pros is that this method is clean, fast, and handles most cases quite nicely. And one thing is for sure, it is definitely more accurate than checking if the walkability is off (it actually combines that check + the item check).
(2) Set a unit's position there. (Bob666 [N-a-z-g-u-l]/Nestharus) Then you perform similar checks based on that. That fixes the problem mentioned in the second point above (in really crowded areas). However, the reason why I chose the first implementation is that SetUnitPosition() fires a "stop" order and moving the unit may fire region enter events. In the end, it may be more problematic for GUI users than it is worth.
- Go to File -> Preferences and check Automatically create unknown variables while pasting trigger data
- Copy and paste the category "CheckWalkability"
- (Optional) Delete the code after "Variables for Copy and Paste"
- Use it as shown in the demo. You just set CP_Point to the point you want to check for pathability. Then you run the trigger. CP_IsPointWalkable will return whether the point is walkable.
- Note: You may want to remove the location after using it if you no longer need it, just to prevent leaking.
Page 1 of 2
Page 1 of 2