• 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.

[Trigger] There's a trigger, but it doesn't work

Status
Not open for further replies.
Level 19
Joined
Jan 12, 2011
Messages
1,523
Trigger 1
  • Initialization
    • Acontecimientos
      • Map initialization
    • Condiciones
    • Acciones
      • -------- Those values are calculated based on a 12 player map and is not calculated for Single player map --------
      • Set MAXP = 11
      • -------- 2 Teams - Team 1 --------
      • Set NPlayers_In_Team_1[1] = 1
      • Set NPlayers_In_Team_1[2] = 2
      • Set NPlayers_In_Team_1[3] = 2
      • Set NPlayers_In_Team_1[4] = 3
      • Set NPlayers_In_Team_1[5] = 3
      • Set NPlayers_In_Team_1[6] = 4
      • Set NPlayers_In_Team_1[7] = 4
      • Set NPlayers_In_Team_1[8] = 5
      • Set NPlayers_In_Team_1[9] = 5
      • Set NPlayers_In_Team_1[10] = 6
      • Set NPlayers_In_Team_1[11] = 6
      • -------- 3 Teams - Team 1 --------
      • Set NPlayers_In_Team_1[12] = 0
      • Set NPlayers_In_Team_1[13] = 1
      • Set NPlayers_In_Team_1[14] = 2
      • Set NPlayers_In_Team_1[15] = 2
      • Set NPlayers_In_Team_1[16] = 2
      • Set NPlayers_In_Team_1[17] = 3
      • Set NPlayers_In_Team_1[18] = 3
      • Set NPlayers_In_Team_1[19] = 3
      • Set NPlayers_In_Team_1[20] = 4
      • Set NPlayers_In_Team_1[21] = 4
      • Set NPlayers_In_Team_1[22] = 4
      • -------- 4 Teams - Team 1 --------
      • Set NPlayers_In_Team_1[23] = 0
      • Set NPlayers_In_Team_1[24] = 0
      • Set NPlayers_In_Team_1[25] = 1
      • Set NPlayers_In_Team_1[26] = 2
      • Set NPlayers_In_Team_1[27] = 2
      • Set NPlayers_In_Team_1[28] = 2
      • Set NPlayers_In_Team_1[29] = 2
      • Set NPlayers_In_Team_1[30] = 3
      • Set NPlayers_In_Team_1[31] = 3
      • Set NPlayers_In_Team_1[32] = 3
      • Set NPlayers_In_Team_1[33] = 3
      • -------- 2 Teams - Team 2 --------
      • -------- Don't Care; checking will be done for Team 1 only --------
      • -------- 3 Teams - Team 2 --------
      • Set NPlayers_In_Team_2[12] = 0
      • Set NPlayers_In_Team_2[13] = 1
      • Set NPlayers_In_Team_2[14] = 1
      • Set NPlayers_In_Team_2[15] = 2
      • Set NPlayers_In_Team_2[16] = 2
      • Set NPlayers_In_Team_2[17] = 2
      • Set NPlayers_In_Team_2[18] = 3
      • Set NPlayers_In_Team_2[19] = 3
      • Set NPlayers_In_Team_2[20] = 3
      • Set NPlayers_In_Team_2[21] = 4
      • Set NPlayers_In_Team_2[22] = 4
      • -------- 4 Teams - Team 2 --------
      • Set NPlayers_In_Team_2[23] = 0
      • Set NPlayers_In_Team_2[24] = 0
      • Set NPlayers_In_Team_2[25] = 1
      • Set NPlayers_In_Team_2[26] = 1
      • Set NPlayers_In_Team_2[27] = 2
      • Set NPlayers_In_Team_2[28] = 2
      • Set NPlayers_In_Team_2[29] = 2
      • Set NPlayers_In_Team_2[30] = 2
      • Set NPlayers_In_Team_2[31] = 3
      • Set NPlayers_In_Team_2[32] = 3
      • Set NPlayers_In_Team_2[33] = 3
      • -------- 2 Teams - Team 3 --------
      • -------- Immpossible --------
      • -------- 3 Teams - Team 3 --------
      • -------- Don't Care; checking will be done for Team 1 and Team 2. --------
      • -------- 4 Teams - Team 3 --------
      • Set NPlayers_In_Team_3[23] = 0
      • Set NPlayers_In_Team_3[24] = 0
      • Set NPlayers_In_Team_3[25] = 1
      • Set NPlayers_In_Team_3[26] = 1
      • Set NPlayers_In_Team_3[27] = 1
      • Set NPlayers_In_Team_3[28] = 2
      • Set NPlayers_In_Team_3[29] = 2
      • Set NPlayers_In_Team_3[30] = 2
      • Set NPlayers_In_Team_3[31] = 2
      • Set NPlayers_In_Team_3[32] = 3
      • Set NPlayers_In_Team_3[33] = 3
      • Detonador - Run Determine the Players <gen> (checking conditions)
trigger 2
  • Determine the Players
    • Acontecimientos
      • Tiempo - Elapsed game time is 0.00 seconds
    • Condiciones
    • Acciones
      • Grupo de jugadores - Pick every player in (All players) and do (Actions)
        • Bucle: Acciones
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • ((Picked player) controller) Igual a (==) Usuario
              • ((Picked player) slot status) Igual a (==) Está jugando
            • Entonces: Acciones
              • Grupo de jugadores - Add (Picked player) to MainPlayerGroup
            • Otros: Acciones
      • Set NumOfPlayers = (Number of players in MainPlayerGroup)
trigger 3
  • Setting Up teams
    • Acontecimientos
      • Tiempo - Elapsed game time is 0.00 seconds
    • Condiciones
    • Acciones
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • NumOfPlayers Menor que o igual a (<=) 2
        • Entonces: Acciones
          • Set N_Teams = 2
          • -------- 2 players only in game. so 1 vs 1 --------
          • Detonador - Run Two Teams <gen> (ignoring conditions)
        • Otros: Acciones
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • NumOfPlayers Igual a (==) 3
            • Entonces: Acciones
              • Set Label_2_Teams = 2 Teams: 2 vs 1
              • Set Label_3_Team = 3 Teams: 1 vs 1 vs 1
              • Diálogo - Create a dialog button for Dialog labelled Label_2_Teams
              • Set Dialog_Button_2_Teams = (Last created dialog Button)
              • Diálogo - Create a dialog button for Dialog labelled Label_3_Team
              • Set Dialog_Button_3_Teams = (Last created dialog Button)
              • Diálogo - Mostrar Dialog for Jugador 1 (rojo)
            • Otros: Acciones
              • Set temp_i = (NumOfPlayers - 1)
              • Set Label_2_Teams = ((2 Teams: + (String(NPlayers_In_Team_1[temp_i]))) + ( vs + (String((NumOfPlayers - NPlayers_In_Team_1[temp_i])))))
              • Set temp_i = (10 + NumOfPlayers)
              • Set Label_3_Team = ((3 Teams: + (String(NPlayers_In_Team_1[temp_i]))) + ( vs + ((String(NPlayers_In_Team_2[temp_i])) + ( vs + (String((NumOfPlayers - (NPlayers_In_Team_1[temp_i] + NPlayers_In_Team_2[temp_i]))))))))
              • Set temp_i = (21 + NumOfPlayers)
              • Set Label_4_Team = ((4 Teams: + (String(NPlayers_In_Team_1[temp_i]))) + ( vs + ((String(NPlayers_In_Team_2[temp_i])) + ( vs + ((String(NPlayers_In_Team_3[temp_i])) + ( vs + (String((NumOfPlayers - (NPlayers_In_Team_1[temp_i] + (NPlayers_In_Team_2[temp_i] + NPlayers_In_Team_
              • Diálogo - Create a dialog button for Dialog labelled Label_2_Teams
              • Set Dialog_Button_2_Teams = (Last created dialog Button)
              • Diálogo - Create a dialog button for Dialog labelled Label_3_Team
              • Set Dialog_Button_3_Teams = (Last created dialog Button)
              • Diálogo - Create a dialog button for Dialog labelled Label_4_Team
              • Set Dialog_Button_4_Teams = (Last created dialog Button)
              • Diálogo - Mostrar Dialog for Jugador 1 (rojo)
  • Two Teams
    • Acontecimientos
      • Diálogo - A dialog button is clicked for Dialog
    • Condiciones
      • (Clicked dialog button) Igual a (==) Dialog_Button_2_Teams
    • Acciones
      • Set N_Teams = 2
      • Set index = (((N_Teams - 2) x MAXP) + (NumOfPlayers - 1))
      • Grupo de jugadores - Pick every player in MainPlayerGroup and do (Actions)
        • Bucle: Acciones
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • (Number of players in Team_1) Menor que (<) NPlayers_In_Team_1[index]
            • Entonces: Acciones
              • Grupo de jugadores - Add (Picked player) to Team_1
            • Otros: Acciones
              • Grupo de jugadores - Add (Picked player) to Team_2
  • Three Teams
    • Acontecimientos
      • Diálogo - A dialog button is clicked for Dialog
    • Condiciones
      • (Clicked dialog button) Igual a (==) Dialog_Button_2_Teams
    • Acciones
      • Set N_Teams = 3
      • Set index = (((N_Teams - 2) x MAXP) + (NumOfPlayers - 1))
      • Grupo de jugadores - Pick every player in MainPlayerGroup and do (Actions)
        • Bucle: Acciones
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • (Number of players in Team_1) Menor que (<) NPlayers_In_Team_1[index]
            • Entonces: Acciones
              • Grupo de jugadores - Add (Picked player) to Team_1
            • Otros: Acciones
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • (Number of players in Team_2) Menor que (<) NPlayers_In_Team_2[index]
                • Entonces: Acciones
                  • Grupo de jugadores - Add (Picked player) to Team_2
                • Otros: Acciones
                  • Grupo de jugadores - Add (Picked player) to Team_3
  • Four Teams
    • Acontecimientos
      • Diálogo - A dialog button is clicked for Dialog
    • Condiciones
      • (Clicked dialog button) Igual a (==) Dialog_Button_2_Teams
    • Acciones
      • Set N_Teams = 4
      • Set index = (((N_Teams - 2) x MAXP) + (NumOfPlayers - 1))
      • Grupo de jugadores - Pick every player in MainPlayerGroup and do (Actions)
        • Bucle: Acciones
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • (Number of players in Team_1) Menor que (<) NPlayers_In_Team_1[index]
            • Entonces: Acciones
              • Grupo de jugadores - Add (Picked player) to Team_1
            • Otros: Acciones
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • (Number of players in Team_2) Menor que (<) NPlayers_In_Team_2[index]
                • Entonces: Acciones
                  • Grupo de jugadores - Add (Picked player) to Team_2
                • Otros: Acciones
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si: Condiciones
                      • (Number of players in Team_3) Menor que (<) NPlayers_In_Team_3[index]
                    • Entonces: Acciones
                      • Grupo de jugadores - Add (Picked player) to Team_3
                    • Otros: Acciones
                      • Grupo de jugadores - Add (Picked player) to Team_4
 
1. for your triggers Two Teams, Three Teams and Four Teams check your conditions. You check for only button 2 on every one of your triggers that you check when you click one of your dialog buttons.
Just change your conditions to match what event you want you want to happen when of click each one of your buttons.

2. it would help if you can use a full English world editor for when you post triggers on this forum.

3. I can see what you are trying to achieve here, although it would help if you explain what you want your triggers to do.
 
What you are doing here is adding players to player groups, not actually setting alliances. Although this can be an extra step towards doing it right.
You want every team to be enemies against each other right and everything on the same team as an alliance.
when you want to initialize these teams do it like this.
First make every player an enemy against each other than make everyone that is on the same team have an alliance. Like so.
  • Actions
    • Player Group - Make (All players) treat (All players) as an Enemy
    • Player Group - Make Team_1 treat Team_1 as an Ally with shared vision
    • Player Group - Make Team_2 treat Team_2 as an Ally with shared vision
    • Player Group - Make Team_3 treat Team_3 as an Ally with shared vision
This way it won't matter what team alliances are set when this is triggered.
 
Status
Not open for further replies.
Top