• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[JASS] How to exit loop?

Status
Not open for further replies.
From what I understand;


I believe you should use OR function, right ?
Either condition should be fine, exit loop either your picked unit has buff, or your Boolean is equal to True.

Or the other way around ?
Both must be true ? (Picked unit has buff + Boolean is True) ?

No, no seperate. Each is for different loops.
 
So you mean each condition is not meant for each other ?
So this is somewhat 2 separate function, eh ?

If you want to check a certain condition over-time, direct loop is never the answer.

You should use the Event Time - Periodic Event so that you can evaluate the condition each time.

The method you currently used is a direct looping which checks the condition for several times (but in a single period) where you should constantly checking the condition, that's why we use that Event.

Let's say we take a 0.10 second of Periodic Time event.

So, each 0.10 second pass, you make a check, this way you will evaluate those conditions per 0.10 second.
 
There is no limit to the number of "exitwhen" clauses a loop can have in WarCraft III.

In programming languages like C this is obtained by using the "break" statement (which JASS does not have). The use is to allow early exits from complex loops without having to reach the end.

In simple loops you can often tie the logic together using the logical "and" and "or" operators.
 
Status
Not open for further replies.
Back
Top