• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Check if point is passable

Status
Not open for further replies.
Level 3
Joined
Jun 21, 2017
Messages
31
So essentially ive been trying to make a dash skill that stopped when the unit collides with a Wall/Building/DDooa (unpassable terrain in general) .
I know how to do the dash itself and i know how to make the unit stop upon reaching the destinuppon as well as stop uppon hitting a unit. Its the part of stopping uppon contact with terraon that im just not sure how to do.
Ive had an idea of how to do it but i dont know if Warcraft 3 has the required commands.

Is there a way for the game to check whether a point is inside a passable or impassable zone?
I know i could in theory make a region around each dooad and building and check if the point is inside any of those regions but that would take quite a lot of both work as well as time.
So is it possible to check whether a space is occupied and if so is it doable with GUI or with JASS?

Thx to anyone who answers
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
You can check, if the terrain is pathable, however this only affects terrain and ignores doodads, buildings and units.
The most common way is to use path checkers: Place a unit or item at the point you want to check. You can then immediatly compare its position to where you placed it. If it is at the same position the point is pathable, if not the unit/item was moved, because there was no space on the original position.
You can use an item if you want to ignore units and only check for the pathing map.
A unit lets you also check, if there is a ground unit blocking the point.
 
Level 3
Joined
Jun 21, 2017
Messages
31
You can check, if the terrain is pathable, however this only affects terrain and ignores doodads, buildings and units.
The most common way is to use path checkers: Place a unit or item at the point you want to check. You can then immediatly compare its position to where you placed it. If it is at the same position the point is pathable, if not the unit/item was moved, because there was no space on the original position.
You can use an item if you want to ignore units and only check for the pathing map.
A unit lets you also check, if there is a ground unit blocking the point.
Thanks a lot i just tried it and using units that way solved quite a couple of my others problems as well
 
Level 13
Joined
Oct 12, 2016
Messages
769
I remember there's a GUI condition to check if a point is walkable.
It basically checks the pathing at the location.
I use this in a few jump/knockback systems. Let me see if I can find it.
 
Status
Not open for further replies.
Top