I don't understand:
And I think that every action in a "Unit Group - Pick every unit in GROUP and do (Actions)"-loop, is executed for the current "PickedUnit", until every unit was picked once. Or is this not even a loop?
But if I put a "Unit Group"-loop inside a "For each INT-loop, and ask for a variable VAR[INT] inside the "Unit Group"-loop, then VAR[INT] is cycled through a to b, despite the current value of INT in the "For each INT"-loop should be set to a fixed value, until the INT gets increased by one, after the Unit Group-loop is cycled through all it's units.
I want to circle dummy units around a hero. I use the "For each Integer loop_HumanplayerA"-loop to get the hero of every player, and the "Unit Group"-loop to get every dummy unit of that hero. The dummy units are inside an array of unit group variables.
Once I set temp_Location inside the "Unit Group"-loop, I ask for a_HA01_LocCaster[loop_HumanPlayerA] (point variable) which was set befor, outside the "Unit Group"loop. So with my understanding, the actual value of that point variable should stay the same, for each PickedUnit inside the "Unit Group"-loop.
But what realy happens is, that a_HA01_LocCaster[loop_HumanPlayerA] gets cycled through per PickedUnit! Therefor, only the point for a_HA01_LocCaster[1] does even exist (if I test it alone, no other player/hero), while all other values of a_HA01_LocCaster[loop_HumanPlayerA] are set to 0;0 - Center of Map, since there is no existing player_HERO[2-6]. Only the first unit in the group circles around my hero. Every other unit does this around the center of my map.
Setting a_HA01_LocCaster[loop_HumanPlayerA] to a_HA01_LocCaster[1] inside the "Unit Group"-loop, fixes my problem, but then it works only for player 1.
I realy hope you understand, what I want to tell you.
-
For each (Integer INT) from a to b, do (Actions)
-
Unit Group - Pick every unit in GROUP and do (Actions)
And I think that every action in a "Unit Group - Pick every unit in GROUP and do (Actions)"-loop, is executed for the current "PickedUnit", until every unit was picked once. Or is this not even a loop?
But if I put a "Unit Group"-loop inside a "For each INT-loop, and ask for a variable VAR[INT] inside the "Unit Group"-loop, then VAR[INT] is cycled through a to b, despite the current value of INT in the "For each INT"-loop should be set to a fixed value, until the INT gets increased by one, after the Unit Group-loop is cycled through all it's units.
-
My Trigger
-
Events
-
Time - Every x seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer loop_HumanPlayerA) from 1 to 6, do (Actions)
-
Loop - Actions
-
Set a_HA01_LocCaster[loop_HumanPlayerA] = (Position of player_HERO[loop_HumanPlayerA])
-
Unit Group - Pick every unit in a_HA01_DummyGroup[loop_HumanPlayerA] and do (Actions)
-
Loop - Actions
-
Custom script: set udg_temp_Key = GetHandleId(GetEnumUnit())
-
Set temp_Location = (a_HA01_LocCaster[loop_HumanPlayerA] offset by (Load h_HA01_Data_radius of temp_Key from HT_Ability_Data) towards (8.00 + (Load h_HA01_Data_angle of temp_Key from HT_Ability_Data)) degrees)
-
Unit - Move (Picked unit) instantly to temp_Location, facing a_HA01_LocCaster[loop_HumanPlayerA]
-
Hashtable - Save (8.00 + (Load h_HA01_Data_angle of temp_Key from HT_Ability_Data)) as h_HA01_Data_angle of temp_Key in HT_Ability_Data
-
Custom script: call RemoveLocation(udg_temp_Location)
-
-
-
Custom script: call RemoveLocation(udg_a_HA01_LocCaster[udg_loop_HumanPlayerA])
-
-
-
-
Once I set temp_Location inside the "Unit Group"-loop, I ask for a_HA01_LocCaster[loop_HumanPlayerA] (point variable) which was set befor, outside the "Unit Group"loop. So with my understanding, the actual value of that point variable should stay the same, for each PickedUnit inside the "Unit Group"-loop.
But what realy happens is, that a_HA01_LocCaster[loop_HumanPlayerA] gets cycled through per PickedUnit! Therefor, only the point for a_HA01_LocCaster[1] does even exist (if I test it alone, no other player/hero), while all other values of a_HA01_LocCaster[loop_HumanPlayerA] are set to 0;0 - Center of Map, since there is no existing player_HERO[2-6]. Only the first unit in the group circles around my hero. Every other unit does this around the center of my map.
Setting a_HA01_LocCaster[loop_HumanPlayerA] to a_HA01_LocCaster[1] inside the "Unit Group"-loop, fixes my problem, but then it works only for player 1.
I realy hope you understand, what I want to tell you.

Last edited: