HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Loops

12-07-2006, 10:38 PM#1
shadowange1
The question is "Is it possible to create while or do while loops in the GUI?"
What i mean by this is there any editor or something else that will let me do this.
OR can i simple just use a for/next and make it never reach the end but put a polled wait with a global var and checking that var every so often to see if it changes
If there is a more effecient way of doing this do tell please.
12-07-2006, 10:44 PM#2
shadow1500
It's possible to do "Do Until" loops in JASS, you can use them in GUI with custom script:
Trigger:
Custom Script: loop
Custom Script: exitwhen <condition>
--- Do some actions ---
Custom Script: endloop
Or, to make it even easier:
Trigger:
Custom Script: loop
Set BooleanVar = <Condition>
Custom Script: exitwhen udg_BooleanVar
--- Do some actions ---
Custom Script: endloop
12-07-2006, 10:52 PM#3
PipeDream
loop/endloop with exitwhen at the front is precisely a while() {}, with exitwhen at the end it's precisely a do{} while(). Somewhere in the middle you can call it a while(1) { ... if() { break; } ... }. Even the nesting behavior is the same (exitwhen & break both get you out of a single loop block)
12-08-2006, 11:03 PM#4
blu_da_noob
A crude method for GUI is to create your own global integer variable and do a for (your integer) equals 1 to 3 loop. Then each iteration, check your exit condition, if it is false, set your variable to 1, else set it to 4.
12-08-2006, 11:18 PM#5
Taur
WEU will let you
12-08-2006, 11:51 PM#6
shadowange1
Another Question related to that
Which method of any listed above would be the least laggiest, possible if multiple ones are running at the sametime?
12-09-2006, 12:22 AM#7
TaintedReality
Quote:
Another Question related to that
Which method of any listed above would be the least laggiest, possible if multiple ones are running at the sametime?

None would be noticeably laggy, even if you had a bunch running, it just depends on what you do within them.
12-09-2006, 12:25 AM#8
shadowange1
just damaging units through triggers.
other(s) will be moving regions around the map.
some will be creating dummy spell casters.
Which of the above would be most laggiest?
Also doing mere +- calculations and storing them
Also thank you everyone for your input thus far