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