Need Minor Trigger Help

Eyonix

TH.net Regular
Reaction score
16
First of all let me start by saying hi, im new to WE and to TH.

I decided to get into making maps because I like to play the custom games more than the normal game. So why is it this trigger doesn't work?

Code:
Spawn Units
    Events
        Time - Elapsed game time is 3.00 seconds
    Conditions
    Actions
        Set Integ = 0
        Set SpawnLocation[1] = Player 1 (Red)
        Set SpawnLocation[2] = Player 2 (Blue)
        Set SpawnLocation[3] = Player 3 (Teal)
        Set SpawnLocation[4] = Player 4 (Purple)
        Set SpawnLocation[5] = Player 5 (Yellow)
        Set SpawnLocation[6] = Player 6 (Orange)
        Set SpawnLocation[7] = Player 7 (Green)
        Set SpawnLocation[8] = Player 8 (Pink)
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                Unit - Create 1 Footman for SpawnLocation[(Integ + 1)] at (SpawnLocation[(Player number of SpawnLocation[Integ])] start location) facing Default building facing degrees
                Set Integ = (Integ + 1)

I've tried diffrent things but using the same basic idea and it will either make red's footman & blue's footman in red's starting zone and then teal's footman in blue's spot and purple in teal's spot etc.

Now when I change it around it does the same thing but it ever makes red and it still puts blue there.

Offtopic....

I herd its better to skip learning GUI and go straight to learning to trigger with JASS, is that true?
 

Zedzy

ℑΣÐℑΨ
Reaction score
41
It is because there is no SpawnLocation[0]. Try this

Code:
Spawn Units
    Events
        Time - Elapsed game time is 3.00 seconds
    Conditions
    Actions
        Set Integ = 0
        Set SpawnLocation[1] = Player 1 (Red)
        Set SpawnLocation[2] = Player 2 (Blue)
        Set SpawnLocation[3] = Player 3 (Teal)
        Set SpawnLocation[4] = Player 4 (Purple)
        Set SpawnLocation[5] = Player 5 (Yellow)
        Set SpawnLocation[6] = Player 6 (Orange)
        Set SpawnLocation[7] = Player 7 (Green)
        Set SpawnLocation[8] = Player 8 (Pink)
        For each (Integer A) from 2 to 8, do (Actions)
            Loop - Actions
                Unit - Create 1 Footman for SpawnLocation[(Integ + 1)] at (SpawnLocation[(Player number of SpawnLocation[Integ])] start location) facing Default building facing degrees
                Set Integ = (Integ + 1)
        Unit - Create 1 Footman for SpawnLocation[1] at (SpawnLocation[8] start location) facing Default building facing degrees

I am assuming SpawnLocation[#] is a player array. Correct?
 

Eyonix

TH.net Regular
Reaction score
16
That is correct, I'll give it a try.

EDIT: It didn't work

edit: got it working, Thanks naga
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
Well since your using the GUI loop you might as well just get rid of the variable integ and instead use ForLoopIntegerA. Just replace all the variables with the for loop integer and it should create a footman for each one.
 
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