Integer A and Integer B are used for all GUI loops, so yes, they can interfere with each other. But it is rare for them to interfere; it is not as simple as you might think.
First things first, how does wc3 handle triggers that run "at the same time"? Let's say you have two triggers that run when a unit dies, trigger 1 and trigger 2. They both use an Integer A loop. Will they interfere?
No. Why? In wc3, triggers don't actually run at the same time. There is always some order to it. So there are two possibilities:
Trigger 1 runs -> then trigger 2. OR
Trigger 2 runs -> then trigger 1.
So the loops won't interfere with each other. The GUI loop is set up so that it can be used multiple times throughout many triggers.
However, there is one case where using Integer A can cause problems. Let's say you have these triggers:
-
Trigger 1
-
Events
-
Time - 0.00 seconds elapsed (game-time)
-
Conditions
-
Actions
-
Game - Display text to (All players): "Killing..."
-
Unit - Kill Mountain King 0002 <gen>
-
Game - Display text to (All players): "Trigger 1"
-
Trigger 2
-
Events
-
Conditions
-
Actions
-
Game - Display text to (All players): "A unit died."
As you can see, trigger 1 will kill a unit, and that will cause trigger 2 to fire. But when does it fire? Well, test this out, and in what order will you receive the messages?
The answer: "Killing..." -> "A unit died." -> "Trigger 1"
What happened? Trigger 1 fired, and it killed the unit. Then trigger 1
paused its actions, jumped over to trigger 2, did those actions, and then it
jumped back and resumed trigger 1 (to display the last message). Weird, huh? This is actually a very useful fact in a lot of cases, but it can also cause really weird problems. For example:
-
Trigger 1
-
Events
-
Time - 0.00 seconds elapsed (game-time)
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 10 do (Actions)
-
Loop - Actions
-
Unit - Kill SomeUnitArray[(Integer A)]
-
Trigger 2
-
Events
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 10 do (actions)
-
Loop - Actions
-
Game - Display text to player "lol"
This seems like a simple trigger setup. It looks like it should kill 10 units in some unit array named "SomeUnitArray". This will fire Trigger 2, which will display "lol" 10 times. As such, you should expect
100 game messages. But what really happens?
It turns out, you only kill SomeUnitArray[1], and "lol" is displayed only 10 times. What happened? Well, based on the rule described above, Trigger 1 killed SomeUnitArray[1] and jumped over to trigger 2. This loop ran (Integer A) from 1 to 10 to display "lol", so this brings Integer A up to 10! So when we jump back to Trigger 1, it finishes the loop immediately since we only designed the loop to run from 1 to 10.
This is a bit complicated to grasp, and it is a rare case, so it is up to you whether you want to worry about it. To fix it, most people will use their own custom integer variable for looping. You only need 1 separate variable per trigger (sometimes you can share them, but you should know what you're doing).
-----
TLDR; they may affect each other, but it is rare.
How much time need game engine to perform simple "for each variable" cycle from 1 to 12?
Is there any delay in game? Or it's just depends of machine?
It does depend on the machine, but you can consider it instant. Computers are amazingly fast, and a simple 12-iteration loop is really really easy for them. It can depend on the machine or what you're doing inside of the loop, but in most cases you should be fine. There won't be any delay, but if you're doing something really expensive (such as creating 1000 special effects) then there will be some framerate drop. The actual loop itself is incredibly cheap.