1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  4. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  5. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

PathingLib v1.6

Submitted by Quilnez
This bundle is marked as approved. It works and satisfies the submission rules.
Code (vJASS):

library PathingLib
   
    // Object generator
    //! external ObjectMerger w3u hgry hPLF unsf "(PathingLib) FlyChecker"   unam "" umdl ".mdl" ubdg 0 uabi "Aloc" uble 0 ulum 0 upoi 0 uico "" umxp 0 umxr 0 ussc 0 ushu "" ugol 0 uaen "" udea "" umvt "fly" usnd "" ufle 0 ufoo 0 uspe 1 uhom 1 urac "unknown" usid 0 usin 0 upgr "" uhot "" utip "" utub ""
    //! external ObjectMerger w3u hfoo hPLW unsf "(PathingLib) WalkChecker"  unam "" umdl ".mdl" ubdg 0 uabi "Aloc" uble 0 ulum 0 upoi 0 uico "" umxp 0 umxr 0 ussc 0 ushu "" ugol 0 uaen "" udea "" umvt "foot" ucol 0 usnd "" ufle 0 ufoo 0 uspe 1 uhom 1 urac "unknown" usid 0 usin 0 upgr "" uhot "" utip "" utub ""
    //! external ObjectMerger w3u hhou hPLB unsf "(PathingLib) BuildChecker" unam "" umdl ".mdl" ubdg 1 uabi "Aloc" upat "" ulum 0 upoi 0 uubs "" uble 0 ushb "" uico "" ugol 0 ufma 0 umxp 0 ubsl "" umxr 0 ussc 0 ushu "" uaen "" udea "" umvt "" ucol 0 usnd "" ufle 0 ufoo 0 uspe 1 uhom 1 urac "unknown" usid 0 usin 0 upgr "" uhot "" utip "" utub ""
    //! external ObjectMerger w3u hpea hPLP unsf "(PathingLib) PathChecker"  unam "" umdl ".mdl" ubdg 0 uabi "Aloc" uble 0 ubui "hPLF,hPLW,hPLB" ulum 0 upoi 0 uico "" umxp 0 umxr 0 ussc 0 ushu "" ugol 0 uaen "" udea "" umvt "foot" ucol 0 usnd "" ufle 0 ufoo 0 uspe 1 uhom 1 urac "unknown" usid 0 usin 0 upgr "" uhot "" utip "" utub ""
   
    // Configuration
        globals
            private constant integer PATH_CHECKER  = 'hPLP'
            private constant integer FLY_CHECKER   = 'hPLF'
            private constant integer WALK_CHECKER  = 'hPLW'
            private constant integer BUILD_CHECKER = 'hPLB'
            private constant player  DUMMY_PLAYER  = Player(15)
        endglobals
    /*
                    Pathing Library v1.6
                    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
        Description
        ¯¯¯¯¯¯¯¯¯¯¯
            Allows you to detect all pathability types:
            walkablility, flyability, and buildability.
           
            Warning!
            Please keep informed that this system is more sensitive than
            any other walkability checker systems out there, as it also
            detects pathing map generated by normal units as well.
           
        API
        ¯¯¯
            | function IsTerrainFlyable takes real x, real y returns boolean
            | function IsTerrainWalkable takes real x, real y returns boolean
            | function IsTerrainBuildable takes real x, real y returns boolean
                   
        How to import
        ¯¯¯¯¯¯¯¯¯¯¯¯¯
            - Copy Fly, Walk, Build, and Path Checker at object editor (Unit).
            - Make sure Path Checker is able to build Fly, Walk, and Build Checker
              (at object editor>unit>Path Checker>"Techtree - Structures built")
            - Configure this system correctly.
                   
        Link: hiveworkshop.com/forums/spells-569/pathing-type-v1-2-a-263230/
    */

   
    globals
        private unit PathChecker
    endglobals
   
    function IsTerrainFlyable takes real x, real y returns boolean
        return IssueBuildOrderById(PathChecker, FLY_CHECKER, x, y)
    endfunction
   
    function IsTerrainWalkable takes real x, real y returns boolean
        return IssueBuildOrderById(PathChecker, WALK_CHECKER, x, y)
    endfunction
   
    function IsTerrainBuildable takes real x, real y returns boolean
        return IssueBuildOrderById(PathChecker, BUILD_CHECKER, x, y)
    endfunction
   
    private module Init
        private static method onInit takes nothing returns nothing
            call init()
        endmethod
    endmodule
   
    private struct InitStruct extends array
        private static method init takes nothing returns nothing
            set PathChecker = CreateUnit(DUMMY_PLAYER, PATH_CHECKER, 0, 0, 0)
            call UnitRemoveAbility(PathChecker, 'Amov')
            call ShowUnit(PathChecker, false)
            if GetLocalPlayer() == DUMMY_PLAYER then
                call FogEnable(false)
            endif
        endmethod
        implement Init
    endstruct
   
endlibrary
 


Last update:
- Added object generator

Credits:
- Special thanks to PurgeandFire for his pathability checking method!
- TheHelper.net for a complete pathing color tutorial.

Keywords:
check, terrain, pathing, pathability, walkability, flyability, buildability, color
Contents

PathingLib (Map)

Reviews
Moderator
11:40, 10th Mar 2015 IcemanBo: The system works very nicely and can be very useful. Good job.
  1. 11:40, 10th Mar 2015
    IcemanBo: The system works very nicely and can be very useful. Good job.
     
  2. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,467
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Could you write a small description explaining your system?
     
  3. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    description is provided in the jass resource already.

    I like the overall description quite a lot actually.

    Cant really rate the algorithm, but I guess it works correctly, assuming you tested it.

    One last thing to mention is you could mention to copy the units from the map, but that is not really required, since most people will understand that if it says 'h000' and 'n000' than it most likely is implicit, kind of.
     
  4. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,467
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    That requires me to actually read the JASS though... =(

    Though what I really wanted to know is what is the point of this system?
     
  5. Faith

    Faith

    Joined:
    Dec 29, 2009
    Messages:
    883
    Resources:
    3
    Spells:
    1
    Tutorials:
    2
    Resources:
    3
    The point of the system is to enable you to check not only if the terrain is walkable, but if it's buildable, pathable for air units, etc.
    There are also combinations, the 'colors' are results of things being, for example, both walkable AND buildable.

    Now I'm not the best with vJASS but I'm basing this off of what I remember when I was working with pathability before, and I had looked up a few resources. :)
     
  6. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,234
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Updated. It's completely accurate now. Glitch on water has been fixed as well. Enjoy.
     
  7. Keiji

    Keiji

    Administrator

    Joined:
    Nov 24, 2007
    Messages:
    3,649
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Opening test.
     
  8. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,234
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    OMG. I'm so excited to release this update. It's not only much faster due to its new approach (big thanks to PurgeandFire), but it also allows you to check flyability and buildability as well. And it's no longer depending on IsTerrainWalkable library by Vex. It has its own function which is faster than before. Enjoy!!!
     
  9. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,109
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    UNUSED_PLAYER
    is not the best name in my eyes.
    System works very good, I like it much.

    Approved.
     
  10. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,861
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    What did I just saw ?
     
  11. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,234
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    What did you see? :O
     
  12. MoCo

    MoCo

    Joined:
    May 24, 2005
    Messages:
    585
    Resources:
    7
    Maps:
    5
    Tutorials:
    1
    JASS:
    1
    Resources:
    7
    Hey Quilnez, this seems to be a great system - thanks for this.
     
  13. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,234
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Hey, thanks! And you are welcome! Well, this is nothing without PnF's idea :grin:
     
  14. Pinzu

    Pinzu

    Joined:
    Nov 30, 2007
    Messages:
    1,167
    Resources:
    3
    Spells:
    2
    Tutorials:
    1
    Resources:
    3
    How would one go about detecting if and which building is causing unwalkable?
     
  15. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,855
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    group enum units in the place that the tile is unwalkable, that will give you exact unit, if any(if none, its some kind of destructable)
     
  16. Pinzu

    Pinzu

    Joined:
    Nov 30, 2007
    Messages:
    1,167
    Resources:
    3
    Spells:
    2
    Tutorials:
    1
    Resources:
    3
    I thought so too, but the Building has to be in the center of the search area, it doesn't pick up corners so to speak.
     
  17. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,234
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    Updated with the following changes:
    • Renamed to "Pathing Library" or in short "PathingLib"
    • Improved documentations
    • Global vision is no longer given to dummy player
    • Improved object editor data:
      • Added locust to dummy units
      • Dummy units are moved to Other-Special category for better look
      • Removed pathing map from Build Checker, improved accuracy, supposedly
    • And some others
     
  18. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    This is a nice way to detect pathing.
     
  19. TKF

    TKF

    Joined:
    Nov 29, 2006
    Messages:
    1,238
    Resources:
    5
    Maps:
    5
    Resources:
    5
    Excellent supplement for projectile systems and for other useful systems where you need to identify different pathings from apart.