• 🏆 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!

Detecting Pathing

Status
Not open for further replies.
Level 4
Joined
Aug 22, 2008
Messages
100
Hello. I have created a spell where you use impale and then travel to the of the impale range. This works perfectly fine and all except when I want to stop this player from flying around the map haxing his way through all walls, doors and other obstacles. So my question is: How do I make a trigger to detect the pathing type of a line between the caster and the casting point? This is how far Ive come:
  • Admirals Assault
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Admirals Assault
    • Actions
      • Set AACaster = (Triggering unit)
      • Set AALevel = (Level of Admirals Assault for (Triggering unit))
      • Set AAPoint = (Position of (Triggering unit))
      • Set AAFacing = (Facing of (Triggering unit))
      • Set AAPoint = (AAPoint offset by 50.00 towards AAFacing degrees)
      • Unit - Create 1 AAdummy for (Owner of AACaster) at AAPoint facing Default building facing degrees
      • Set AADummy = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to AADummy
      • Unit - Set level of AABuff for AADummy to AALevel
      • Unit - Order AADummy to Orc Shaman - Bloodlust AACaster
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain pathing at AAPoint of type Walkability is off) Equal to True
            • Then - Actions
              • Set AAPoint = (AAPoint offset by 50.00 towards (180.00 - AAFacing) degrees)
              • Skip remaining actions
            • Else - Actions
              • Set AAPoint = (AAPoint offset by 50.00 towards AAFacing degrees)
      • Wait 0.10 seconds
      • Unit - Move AACaster instantly to AAPoint, facing AAFacing degrees
      • Special Effect - Create a special effect at AAPoint using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Custom script: call RemoveLocation(udg_AAPoint)
As you can see the trigger is quite sloppy and I will fix that later (so dont tell me to avoid waits and things like that)

This would work (I believe) if I only wanted to be stopped by cliffs but because the pathing condition does not count destructibles and doodads when checking if the terrain is walkable or not this is the only thing that will stop me.

Try to make sense of my rambling and then help me if you can. Thanks in advance.

(Also Im not sure if you can use a loop that way but I tested with a long chain of if then else aswell and that didnt work either)
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
The best way that I know of is to place an item. Items are kind of the smallest things that care about pathing.

This is how it's done for a single point:
Set location/coordinates to that point
Place an item
check if the item is where you placed it
If it is, then obviously ground pathing is enabled. Usually that's all you need.
 
Level 4
Joined
Aug 22, 2008
Messages
100
This seemed to work. Items does not share pathing with units am I right? So you can still charge through units? Anyway thanks it worked.
 
Status
Not open for further replies.
Top