| 03-26-2007, 12:33 AM | #1 |
IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY)
It seems to always return false on pathable terrain. Is this a glitch? Whats the radius it covers? a 32x32, 64x64 or 128x128? |
| 03-26-2007, 12:39 AM | #2 |
I think after messing around with it some I found that it returned opposite of what it seems that it should. Check if it returns true on unpathable terrain, and if so that's your answer. |
| 03-26-2007, 12:52 AM | #3 | |
Quote:
It checks only the X/Y you supply. Nothing else. |
| 03-26-2007, 12:52 AM | #4 | |
hmm, yes, it does return the opposite, which is easy to fix up, but it doesn't check in 128x128 tiles... :( So I would assume it checks in 32x32 since nothing is really ever 64x64... damn. Oh well, thanks and + rep for the help Edit: Quote:
|
| 03-26-2007, 12:58 AM | #5 |
It doesn't check a pathing map at all. It checks a single point as designated by the X/Y you supply. However, pathing in itself is supplied in 32x32 squares. So if you called the function on any point within a single 32x32 block it returns the same thing. The function itself only checks the supplied X/Y though. |
| 03-26-2007, 01:08 AM | #6 |
damn, so the only way I could check the whole 128x128 (terrain tile) would be to check every 32x32 grid with that function (16 checks * 256*256 = way too many). sigh... Okay, new question. Is there any other way to check if there is a cliff wall at a 128x128 square? I know I can check all 8 squares around it for a difference in terrain height, but that seems stupid aswell. Ideas? |
| 03-26-2007, 01:26 AM | #7 |
Okay, so I just ran some tests on this stuff in different cases. The truth be told, the function only seems to return reliably on cliff tiles and on doodads with pathing maps. It doesn't seem to work at all on destructables or units. It also seems to work on a 'tile' by 'tile' case. If there is ANYTHING blocking a single tile (Meaning terrain tile, whatever size that is) it will tell you it's impathable. This might be a useful behavior for you. GetTerrainCliffLevel() You could always check the cliff level difference between two coordinates. That would detect if a cliff was there, though it would require 2+ calls per check. Might not be realistic. [Apparently you thought of this too and came to the same conclusion] I can't think of any alternatives. You might just have to suffer with the inadequacy of IsTerrainPathable(). |
| 03-26-2007, 01:47 AM | #9 |
Are you sure you don't just want to move a unit there using SetUnitLocation then check if it wound up where it's supposed to be? It seems the fastest and most accurate method of checking for pathability |
| 03-26-2007, 01:50 AM | #10 |
| 03-26-2007, 05:53 PM | #11 |
In your case, you must be using SetUnitX and SetUnitY while you need to use SetUnitPosition takes unit whichUnit, real newX, real newY returns nothing
Setting of X and Y will not look for pathing problems, while the Position one does. |
| 03-26-2007, 07:25 PM | #12 | |
Quote:
If you don't want units to block pathability, use an item. If you do want units to block pathability, use a unit. |
| 03-26-2007, 09:04 PM | #13 | ||
Quote:
This is the section of code that checks for if the unit is there or not. JASS:... call SetUnitPosition(udg_PAS2_DummyUnit, udg_PAS2_Xtemp, udg_PAS2_Ytemp) set x = GetUnitX(udg_PAS2_DummyUnit) set y = GetUnitY(udg_PAS2_DummyUnit) if (x >= udg_PAS2_Xtemp - 1 and x <= udg_PAS2_Xtemp + 1) and (y >= udg_PAS2_Ytemp - 1 and y <= udg_PAS2_Ytemp + 1)then ... Quote:
True enough, or I could technically just disable all pathing for all pre-placed units, check and then enable it again... I'm going to let this slide for a bit. I need to work on the heuristic and on how I should implement the data for processing. If you guys have any ideas, don't be afraid to post. I'll check back to this thread periodically. Thanks to you all and + rep Edit: grim001 and Rising_Dusk have been rep-ed to recently, let me rep others and then I'll get back to you both. (done) |
