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

How to Kill Descructibles when Unit is within Range?

Status
Not open for further replies.
Level 31
Joined
Jun 27, 2008
Messages
2,557
Hello.

Title say it pretty much. How to kill destructibles when unit comes certain distance to it? For example, a Hero comes 150 range to destructible and destructible die.

I solved this problem in a very ugly way. I put a dummy unit in the position of destructible, when hero approach the dummy, I pick all destructibles around dummy and kill them. This was done to low amount of destructibles and and I need to do the same effect to way bigger numbers and now it would be problematic to do so.

Are there any cleaner way to deal with this?

Thanks.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
I'm in a hurry so I can't fix the leak atm but I belive you can do that eh?
  • Untitled Trigger 002
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Picked unit))
          • Destructible - Pick every destructible within 150.00 of Point and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
 
Status
Not open for further replies.
Top