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

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,183
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