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

Triggered Line of Sight, how?

Status
Not open for further replies.
hey everyone, i tried to make a trigger that checks if between the two units there is a something that blocks pathing and make them stop, but it's not working and I cant figuire out why.

Ideas?

  • Line of Sight Spells
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Target unit of ability being cast) Not equal to No unit
    • Actions
      • -------- --------------------- --------
      • -------- --------------------- --------
      • Set LOS_PointCaster = (Position of (Casting unit))
      • Set LOS_PointTarget = (Position of (Target unit of ability being cast))
      • Set LOS_Distance = (Distance between LOS_PointCaster and LOS_PointTarget)
      • Set LOS_Angle = (Angle from LOS_PointCaster to LOS_PointTarget)
      • -------- --------------------- --------
      • -------- --------------------- --------
      • For each (Integer A) from 1 to (Integer((LOS_Distance / 5.00))), do (Actions)
        • Loop - Actions
          • Set LOS_TempPoint = (LOS_PointCaster offset by ((Real((Integer A))) x 5.00) towards LOS_Angle degrees)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain pathing at LOS_TempPoint of type Buildability is off) Equal to True
            • Then - Actions
              • Unit - Order (Triggering unit) to Stop
            • Else - Actions
          • Custom script: call RemoveLocation(udg_LOS_TempPoint)
here check every point like 0 5 10 15 25 etc. until the other unit is reached

but it's not working!
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,540
Use Text Messages/Special Effects to visualize and debug problems like these.

Create a message displaying Integer A inside of your loop.

Create special effects at TempPoint.

Create a message when your unit is ordered to Stop.

Also, you're checking Buildability, which is not the same as "blocked pathing".
 
Status
Not open for further replies.
Top