HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to check if pathing is invalid

09-10-2006, 06:24 PM#1
GosuSheep
What I'm trying to say is. How can u check if a unit is completely surrounded by something? Perhaps a region that follows the unit and checks if he can reach the edges of it? i dont know

replies are greatly appreciated
09-10-2006, 06:39 PM#2
The)TideHunter(
Collapse JASS:
function CF_UnitIsInValidPath takes unit whichUnit returns boolean
    return not (IsTerrainPathable(GetUnitX(whichUnit), GetUnitY(whichUnit), PATHING_TYPE_WALKABILITY))
endfunction

function CF_LocationIsInValidPath takes location whichLocationreturns boolean
    return not (IsTerrainPathable(GetLocationX(whichLocation), GetLocationY(whichLocation), PATHING_TYPE_WALKABILITY))
endfunction

function CF_LocationIsInValidPathXY takes real X, real Y returns boolean
    return not (IsTerrainPathable(X, Y, PATHING_TYPE_WALKABILITY))
endfunction
09-10-2006, 07:00 PM#3
blu_da_noob
http://www.wc3jass.com/viewtopic.php?t=2374
09-11-2006, 11:44 PM#4
GosuSheep
does it need to be done in jass? im not exactly an expert with that stuff
09-11-2006, 11:53 PM#5
Alevice
http://www.wc3campaigns.net/showthre...531#post827531

Change floatability with walkability, and the expression to true.
09-12-2006, 05:40 PM#6
The)TideHunter(
Quote:
Originally Posted by The)TideHunter(
Collapse JASS:
function CF_UnitIsInValidPath takes unit whichUnit returns boolean
    return not (IsTerrainPathable(GetUnitX(whichUnit), GetUnitY(whichUnit), PATHING_TYPE_WALKABILITY))
endfunction

function CF_LocationIsInValidPath takes location whichLocationreturns boolean
    return not (IsTerrainPathable(GetLocationX(whichLocation), GetLocationY(whichLocation), PATHING_TYPE_WALKABILITY))
endfunction

function CF_LocationIsInValidPathXY takes real X, real Y returns boolean
    return not (IsTerrainPathable(X, Y, PATHING_TYPE_WALKABILITY))
endfunction
09-12-2006, 05:50 PM#7
Alevice
tide - "does it need to be done in jass? im not exactly an expert with that stuff"

my post had a non jass alternative