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

[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