Simple Question, For Loop?

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
How do you use a for loop in starcraft 2 editor?

my code current:

Code:
bool gt_Set_Alliance_Func(bool testConds, bool runActions)
{
    if(!runActions)
    {
        return false;
    }
    //sets players 1-6 to team 1
    for(int i = 1; i<=6; i++)
    {
        PlayerGroupAdd(gv_team1, i);
    }
    //sets players 7-12 to team 2
    for(int t = 7; t<=12; t++)
    {
        PlayerGroupAdd(gv_team2, t);
    }
    
}

void gt_Set_Alliance_Init()
{
    gt_Set_Alliance = TriggerCreate("gt_SetAlliance_Func");
    TriggerAddEventMapInit(gt_Set_Alliance);
}

and it's indicating that for(int i = 1; i<=6; i++) is the porblem
 

Dave312

Censored for your safe viewing
Reaction score
269
If you create a for loop with GUI and then view the script, it actually uses a while loop.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top