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!
Why isnt there loop command in GUI options? I have checked all actions and there was no "loop"
also why doesnt my remove destructible trigger work? trigger should pick all destructibles in region and do action remove picked destructibles, those are path blockers
Because WC3 has rather poor GUI. It only allows you to do a "for integer" loop, or enumerations with forces, groups and destructible in a rect which are not strictly loops. Your only real solution is to write JASS script directly for access to the full loop syntax.
JASS:
loop
exitwhen boolean //exits when true, can be multiple
endloop
also why doesnt my remove destructible trigger work? trigger should pick all destructibles in region and do action remove picked destructibles, those are path blockers
It does not work as you have clearly done something wrong. What you did wrong I cannot tell you since I have no idea what you have done.
Some common things people do wrong...
Too much initialization script resulting in a op-limit thread crash of the initialization thread. This means that not all triggers and events are created so become unreachable code. This is commonly caused by setting GUI Variables (global variables) as arrays with a high index number since it loops through each index assigning a default value which counts as multiple operations. Arrays in JASS are not of a fixed size and will expand as required so there is no need to initialize huge sized variables unless you need to use the default value, which is virtually never the case. Can also happen if you have 1000s of GUI triggers with many events each but this will have other problems as well.
The removing thread crashes before all destructible can be removed. I am not sure if enumerations create new threads or not and so removing enough could possibly cause a thread crash preventing all from being removed. If none are removed this is not the case.
The rect used to remove destructibles has itself been removed. Since it has been removed it corresponds to no area on the map so no destructibles can be removed. This can happen if you use playable map area or such constant rects after you removed them by mistake.
The thread crashes before the destructibles are removed. This can be caused by a loop hitting op limit or even something silly such as a division by 0 or passing some natives invalid arugements.
You return from the function (in GUI this is skip remaing actions) before the destructibles are removed so the script is never executed.
There are no destructibles in the specified rect. Remember doodads are not destructibles. It is impossible to remove doodads using triggers, you can only order them to play certain animations. Destructibles extend widgets and are intractable game objects where as doodads form part of the terrain and have no physical impact on gameplay at all.
The rect you specified does not exist. You are using a variable for rect that has not been set to a rect yet.
For your information, a rect is a GUI "Region". A JASS region is completely different from a rect. GUI often confuses the two using adapters and is why a unit can trigger an enters region event (which uses a region made of cells from the given rect) yet not actually be inside the rect used to make the event.
Also, AFAIK (read somewhere in here when I still active), destructable selection loops work only for up to 64 destructables... so if it already picked 64 dests, it would stop...
Because WC3 has rather poor GUI. It only allows you to do a "for integer" loop, or enumerations with forces, groups and destructible in a rect which are not strictly loops. Your only real solution is to write JASS script directly for access to the full loop syntax.
TriggerHappy, if you go through the effort to "Custom script: set bj_forLoopAIndex = 8191" you can go through the effort to "Custom script: exitwhen true" and achieve the same result considerably faster. Why even make an integer A loop when you could just use "Custom script: loop" and then a "Custom script: endloop" to make the entire loop. While we are at it we could just make the whole thing in JASS and leave out silly GUI.
TriggerHappy, if you go through the effort to "Custom script: set bj_forLoopAIndex = 8191" you can go through the effort to "Custom script: exitwhen true" and achieve the same result considerably faster. Why even make an integer A loop when you could just use "Custom script: loop" and then a "Custom script: endloop" to make the entire loop. While we are at it we could just make the whole thing in JASS and leave out silly GUI.
Because the thread title clearly says "Loop command in GUI" and I specifically said custom scripts aren't needed, so your point of "Why not make it all custom script?" is irrelevant.
Yes clearly JASS is the way to go but for some people it's not what they want.
I was also just responding to your false statement, no need to get in to what's more efficient here.
Why doesnt this loop trigger work? nothing happens.
I want boss to cast blizzard every 10 seconds during encounter, event is finishes casting ability because I couldnt figure out better event for trigger
unit - lich king 0336 <gen> finishes casting an ability
custom script loop
custom script exitwhen udg_tempBool
if (((triggering unit is dead) equal to true) then do (set tempBool = true) else do (wait 10.00 seconds)
unit - add blizzard to Lich King 0336 <gen>
unit - order Lich King 0336 <gen> to human archmage - blizzard position of Lich King 0336 <gen>
Adding an ability that already exists on the unit simply does nothing. No problem~
But you could also remove the ability after a short delay to ensure the ability has been casted.
But first you should check if that really is the problem, e.g. do the same thing outside of a loop. Only "add ability" -> "cast ability" -> "remove ability" with for example with a "elapsed game time = 1 sec" event. If it doesnt work try it without removing the ability.
And yea thats a general concept about debugging. If your trigger doesnt work just try to remove single actions until you isolated the problem or broke it down to a much smaller area.
What also helps are game messages which display arbitrary text on the screen. If your trigger stops execution at some point you at least see which parts of the code get executed and which dont. You can also use game messages to check if a "if ... then ... else ... endif" branch is entered or not.
If you did this im sure you could have found your problem by now.
The loop has no terminating condition. As such it will hit op limit and kill the thread in a resource intensive way. I strongly advise adding a termination condition to the loop. Remember that JASS code will try and be executed instantaneously as far as the game state is concerned unless TriggerSleepAction (Non-polling Wait in GUI) is called, which will then perform an internet synchronization (variable latency) to re-schedule the JASS thread for continuation at a later time.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.