The player array is pointless. The "player" is actually a player's index number, not the name or some other type of identifier. In the above code you posted this is what is going on in the array:
Create a function (it's called: action) that does that for a given player (parameter) and execute everything for the player#. Just like in Java...
Functions are your friends. Use and love them! I've like 25 triggers for 300 functions in my map. Use a switch, if your actions differ for each player. But you can use an array and just read something out of the array based on the player#. I'm using "p#-1" (player number - 1) in nearly every function I've created.
hi,
I'm doing a micro tournament map for 8 Players..
Round1 triggers
Camera - Pan the camera for player 1 to spieler1 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 2 to spieler2 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 3 to spieler3 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 4 to spieler4 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 5 to spieler5 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 6 to Spieler6 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 7 to Spieler7 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 8 to Spieler8 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Unit - Create 8 Zergling for player 1 at spieler1 using default facing (No Options)
Unit Group - Add (Last created unit) to EinheitenGruppeSpieler1
Unit - Create 8 Zergling for player 2 at spieler2 using default facing (No Options)
Unit Group - Add (Last created unit) to EinheitenGruppeSpieler2
Unit - Create 8 Zergling for player 3 at spieler3 using default facing (No Options)
Unit Group - Add (Last created unit) to EinheitenGruppeSpieler
It seems to me very bad way of working with triggers cause the whole code duplicated.
I mean in e.g. Java i make a function and call it if i need the code. I can't imagine that this solutions isnt implicated in the galaxy editor
Yea i already solved it but forgot to say so
anyways thanks!
@FuzzYD: Go
thanks i'll try
hm not working
The PlayerArray got size 5
Do i've to add more params?
I attached the map.
I pasted the pan camera code to the initialization. The other things are in the folder Round 1
Can you paste just an example code plz ?
hi,
I'm doing a micro tournament map for 8 Players..
Round1 triggers
Camera - Pan the camera for player 1 to spieler1 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 2 to spieler2 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 3 to spieler3 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 4 to spieler4 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 5 to spieler5 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 6 to Spieler6 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 7 to Spieler7 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Camera - Pan the camera for player 8 to Spieler8 over 0.3 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Unit - Create 8 Zergling for player 1 at spieler1 using default facing (No Options)
Unit Group - Add (Last created unit) to EinheitenGruppeSpieler1
Unit - Create 8 Zergling for player 2 at spieler2 using default facing (No Options)
Unit Group - Add (Last created unit) to EinheitenGruppeSpieler2
Unit - Create 8 Zergling for player 3 at spieler3 using default facing (No Options)
Unit Group - Add (Last created unit) to EinheitenGruppeSpieler
It seems to me very bad way of working with triggers cause the whole code duplicated.
I mean in e.g. Java i make a function and call it if i need the code. I can't imagine that this solutions isnt implicated in the galaxy editor