• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

using integer A

Status
Not open for further replies.

007

007

Level 6
Joined
May 3, 2009
Messages
175
i once saw that integer A can be used for all players numbers. but how can i do that? do i have to set it like a variable? i want to use it for players 1-9.
 
Level 31
Joined
Apr 17, 2009
Messages
3,572
I doubt he will understand it like that.

Well, it depends on what you want to do with it.
It's basically that you create an integer variable with an array with the number of players.
So you have the variable for every single player.
Means PlayerFood[1] is for player one, PlayerFood[2] is for player two and so on.

Now if you set those variables, it's very helpful and time saving to use an Integer A Loop.
It starts at the number in the first gap and stops at the last ( in my example starts at 1 and ends at 12 (numbers of players).
Now the loop takes in every step (or loop round) the PlayerFood variable with array of the current number of the Integer A loop.

So it does step by step in a loop set the PlayerFood variable for every player.

  • Integer A Loop
    • Events
      • Zeit - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set PlayerFood[(Integer A)] = 100
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
no i mean is as an array. like

Condition:
Owner of triggering unit = player[integer A]

and i want it to work for players 1-9 instead of doing
Condition
Owner of triggering unit = player1
Owner of triggering unit = player2
...

ah now i see chillas post. i thnk i got it. ill try later. thanks!
 
Status
Not open for further replies.
Top