• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 73
Joined
Aug 10, 2018
Messages
7,895
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