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

Loop Until

Status
Not open for further replies.
Level 8
Joined
Dec 9, 2009
Messages
397
I want to create a trigger that loops 8 times, OR until condition is met.

Does using Skip remaining actions stop a loop?
 
Level 8
Joined
Dec 9, 2009
Messages
397
I have not created the trigger yet, I'm asking how i can stop a loop if I achieve what I wanted during. It could happen on first loop and if it does, i want it to stop. It could go all 8 times and not hit the conditions.
 
well actually i checked and that doesn't worked in GUI with a Pick units loop:/

But sure would do the job in JASS

Pick units loops of GUI behave differently in reality. They are not doing a formal loop through the units, they actually will do a ForGroup() into a separate function, and that function is called for each unit in the group. That's why an exitwhen won't work. (it might actually give an error)

For pick unit loops, you would just use an if-then-else condition before performing any actions if you need to prevent any actions from that point on. :)
 
Status
Not open for further replies.
Top