• 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.

[Trigger] Detect Blocking in a TD

Status
Not open for further replies.
Level 2
Joined
Nov 17, 2008
Messages
4
I'm trying to make TD with strictly mazing, but have come across a problem with detecting blocking.

The only solution I can think of is to detect when a creep stops moving because it is unable to follow along a maze. This trigger actually works, but the unit typically follows the maze up until the dead end, runs back a short distance, returns to the dead end, and then it is finally recognized by the trigger. I'd like to find a way to detect the dead end on the spot so there is no build up of creeps going back and forth.

Thanks in advance.

  • Blocking
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set tempStuckCreeps = (Units owned by Neutral Extra matching (((Current order of (Matching unit)) Not equal to (Order(move))) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in tempStuckCreeps and do (Actions)
        • Loop - Actions
          • Set tempPoint = (Position of (Picked unit))
          • Set tempUnits = (Units within 100.00 of tempPoint matching (((Matching unit) is A structure) Equal to True))
          • Set tempPlayers = (Player group((Player((Custom value of (Picked unit))))))
          • Unit - Explode (Random unit from tempUnits)
          • Game - Display to tempPlayers for 0.50 seconds the text: Blocking detected!
          • Custom script: call DestroyForce( udg_tempPlayers )
          • Custom script: call DestroyGroup( udg_tempUnits )
          • Custom script: call RemoveLocation( udg_tempPoint )
          • Unit Group - Remove (Picked unit) from tempStuckCreeps
      • Custom script: call DestroyGroup( udg_tempStuckCreeps )
 
Status
Not open for further replies.
Top