Apply actions to every picked unit (easy)

Status
Not open for further replies.
Level 3
Joined
Oct 5, 2016
Messages
53
Somehow I just can't figure out how to do this. For example, unit uses a spell. Triggers procs - pick every enemy unit and deal 10 dmg to any with interval like 1 sec. If I use regular unit group, trigger just stops when encounter "wait". The goal is to make trigger as compact as possible.
 
Using waits for such a thing is not really encouraged but you could:

loop from 1 to 10
wait 1 second
unit group - pick units in..
deal damage to picked unit
This would deal damage 10 times, with an interval of 1 second

Wouldn't it damage the same unit? My goal is to strike each unit once only.
 
I did not describe my issue correctly. The ability should damage every unit in area once with some interval. Damages unit 1 , wait 1 sec, unit 2, wait, etc.
 
I did not describe my issue correctly. The ability should damage every unit in area once with some interval. Damages unit 1 , wait 1 sec, unit 2, wait, etc.
Man, Chaosy showed you how to damage a group of units, exactly what you need. It will not strike the same unit 10 times. It's a GROUP, not a single unit.
 
It's a loop for God sake...read a tutorial please...
 
Probably but what you showed him will not damage the units only once...it's a loop. He seems not to understand it yet. I think he should read a tutorial.
 
Could do

Loop 1-10
wait 1 second
set my_group = whatever group you want
damage random unit in my_group
It should be altered slightly based on needs but that is one way to do it.
It would damage one random unit in the group every 1 seconds.
If you want to avoid hitting the same unit you move the group outside the loop and then remove the random unit from said group in the loop.
 
Could do

Loop 1-10
wait 1 second
set my_group = whatever group you want
damage random unit in my_group
It should be altered slightly based on needs but that is one way to do it.
It would damage one random unit in the group every 1 seconds.
If you want to avoid hitting the same unit you move the group outside the loop and then remove the random unit from said group in the loop.
ok thanks
 
Somehow I just can't figure out how to do this. For example, unit uses a spell. Triggers procs - pick every enemy unit and deal 10 dmg to any with interval like 1 sec. If I use regular unit group, trigger just stops when encounter "wait". The goal is to make trigger as compact as possible.
MUI
 

Attachments

Last edited:
Status
Not open for further replies.
Back
Top