• 🏆 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 damage units in a line through trigger(GUI)?

Status
Not open for further replies.
Level 5
Joined
Jan 23, 2014
Messages
152
What's the most efficient way? I need to trigger the damage because it depends on the unit's attribute
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
The most efficient way would be to pick units in a rectangle coming from the hero, but this will make the damage instant which you might not want if you're using a projectile.

A simpler method would be to spawn a dummy unit for the projectile, and use a looping trigger to move it forwards and damage units around it. After a unit has been damaged, add it to a unit group so that it won't be damaged again by this instance.
 
Level 5
Joined
Jan 23, 2014
Messages
152
Ohh I also thought of doing the simpler method you mentioned. But wont it cause lag because it uses 2 unit groups and it loops every x seconds?


Just out of curiosity, how do you do the rectangle method?
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
That method is fine, you can also create a dummy unit, order dummy unit to cast a carrion swarm, when a unit takes damage and if damager unit is carrion dummy also deal your damage based on attribute.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
Status
Not open for further replies.
Top