• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] selection race but NOT for Computer

Status
Not open for further replies.
Level 2
Joined
May 15, 2018
Messages
4
hi all, i want to use this trigger for selection of race with the pop up window but i dont want to allow to computer to choose the race (computer choose only naga if i set human for computer and i dont want to) how can i do for pop up dialog title to players but NOT to computer?? ç_ç help please. something is wrong in the trigger.

  • Dialog Race Selector
    • Eventi
      • Tempo - Elapsed game time is 0.10 seconds
    • Condizioni
    • Azioni
      • Dialoghi - Clear DialogTitle
      • Dialoghi - Change the title of DialogTitle to Scegli la tua razza
      • Dialoghi - Create a dialog button for DialogTitle labelled Umani
      • Set Dialog_Button1 = (Last created dialog Button)
      • Dialoghi - Create a dialog button for DialogTitle labelled Orchi
      • Set Dialog_Button2 = (Last created dialog Button)
      • Dialoghi - Create a dialog button for DialogTitle labelled Elfi della Notte
      • Set Dialog_Button3 = (Last created dialog Button)
      • Dialoghi - Create a dialog button for DialogTitle labelled Non-Morti
      • Set Dialog_Button4 = (Last created dialog Button)
      • Dialoghi - Create a dialog button for DialogTitle labelled Naga
      • Set Dialog_Button5 = (Last created dialog Button)
      • For each (Integer A) from 1 to 8, do (Actions)
        • Giro - Azioni
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Se - Condizioni
              • ((Player((Integer A))) controller) Uguale a Utente
            • Allora - Azioni
              • Dialoghi - Mostra DialogTitle for (Player((Integer A)))
            • Altrimenti - Azioni
      • Trigger - Turn on Replace Race <gen>
  • Replace Race
    • Eventi
      • Dialoghi - A dialog button is clicked for DialogTitle
    • Condizioni
    • Azioni
      • Set Temp_Integer_1 = (Player number of (Triggering player))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Se - Condizioni
          • (Clicked dialog button) Uguale a Dialog_Button1
        • Allora - Azioni
          • Gruppo di unità - Pick every unit in (Units of type Bracciante) and do (Actions)
            • Giro - Azioni
              • Unità - Replace (Picked unit) with a Bracciante using Relative della vecchia unità life and mana
          • Gruppo di unità - Pick every unit in (Units of type Municipio) and do (Actions)
            • Giro - Azioni
              • Unità - Replace (Picked unit) with a Municipio using Relative della vecchia unità life and mana
          • -------- cambia razza agli UMANI --------
        • Altrimenti - Azioni
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Se - Condizioni
              • (Clicked dialog button) Uguale a Dialog_Button2
            • Allora - Azioni
              • Gruppo di unità - Pick every unit in (Units of type Municipio) and do (Actions)
                • Giro - Azioni
                  • Unità - Replace (Picked unit) with a Sala del Consiglio using Relative della vecchia unità life and mana
              • Gruppo di unità - Pick every unit in (Units of type Bracciante) and do (Actions)
                • Giro - Azioni
                  • Unità - Replace (Picked unit) with a Peone using Relative della vecchia unità life and mana
              • -------- cambia razza agli ORCHI --------
            • Altrimenti - Azioni
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Se - Condizioni
                  • (Clicked dialog button) Uguale a Dialog_Button3
                • Allora - Azioni
                  • Gruppo di unità - Pick every unit in (Units of type Bracciante) and do (Actions)
                    • Giro - Azioni
                      • Unità - Replace (Picked unit) with a Fuoco Fatuo using Relative della vecchia unità life and mana
                  • Gruppo di unità - Pick every unit in (Units of type Municipio) and do (Actions)
                    • Giro - Azioni
                      • Unità - Replace (Picked unit) with a Albero della Vita using Relative della vecchia unità life and mana
                  • Gruppo di unità - Pick every unit in (Units within 500.00 of ((Triggering player) start location)) and do (Actions)
                    • Giro - Azioni
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Se - Condizioni
                          • (Unit-type of (Picked unit)) Uguale a Miniera d'oro
                        • Allora - Azioni
                          • Unità - Replace (Picked unit) with a Miniera d'Oro Intrappolata using Relative della vecchia unità life and mana
                          • Unità - Change ownership of (Last replaced unit) to (Triggering player) and Cambia colore
                        • Altrimenti - Azioni
                  • -------- cambia razza agli ELFI DELLA NOTTE --------
                • Altrimenti - Azioni
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Se - Condizioni
                      • (Clicked dialog button) Uguale a Dialog_Button4
                    • Allora - Azioni
                      • Gruppo di unità - Pick every unit in (Units of type Bracciante) and do (Actions)
                        • Giro - Azioni
                          • Unità - Remove (Picked unit) from the game
                      • Gruppo di unità - Pick every unit in (Units of type Municipio) and do (Actions)
                        • Giro - Azioni
                          • Unità - Replace (Picked unit) with a Necropoli using Relative della vecchia unità life and mana
                      • Unità - Create 1 Ghoul for (Triggering player) at ((Triggering player) start location) facing Orientamento predefinito degli edifici degrees
                      • Unità - Create 3 Accolito for (Triggering player) at ((Triggering player) start location) facing Orientamento predefinito degli edifici degrees
                      • Gruppo di unità - Pick every unit in (Units within 500.00 of ((Triggering player) start location)) and do (Actions)
                        • Giro - Azioni
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • Se - Condizioni
                              • (Unit-type of (Picked unit)) Uguale a Miniera d'oro
                            • Allora - Azioni
                              • Unità - Replace (Picked unit) with a Miniera d'Oro Maledetta using Relative della vecchia unità life and mana
                              • Unità - Change ownership of (Last replaced unit) to (Triggering player) and Cambia colore
                            • Altrimenti - Azioni
                      • -------- cambia razza agli NON-MORTI --------
                    • Altrimenti - Azioni
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Se - Condizioni
                          • (Clicked dialog button) Uguale a Dialog_Button5
                        • Allora - Azioni
                          • Gruppo di unità - Pick every unit in (Units of type Municipio) and do (Actions)
                            • Giro - Azioni
                              • Unità - Replace (Picked unit) with a Tempio delle Maree using Relative della vecchia unità life and mana
                          • Gruppo di unità - Pick every unit in (Units of type Bracciante) and do (Actions)
                            • Giro - Azioni
                              • Unità - Replace (Picked unit) with a Schiavo Mur'gul using Relative della vecchia unità life and mana
                          • -------- cambia razza agli NAGA --------
                        • Altrimenti - Azioni
      • Dialoghi - Nascondi DialogTitle for (Player(Temp_Integer_1))
this is a map of 8 players.. 4 users vs 4 computer but this trigger i want is available only for player human and not for computer.. thx for help.
 
Level 13
Joined
Oct 12, 2016
Messages
769
There's a condition for you to use in your if/then/else statements:
"Player controller is equal to user"

You can check if the player is a user or computer with that, then execute the actions if it is a user.
 
Level 2
Joined
May 15, 2018
Messages
4
  • For each (Integer A) from 1 to 8, do (Actions)
    • empty.gif
      line.gif
      joinbottomminus.gif
      if.gif
      Giro - Azioni
      • empty.gif
        line.gif
        empty.gif
        joinbottomminus.gif
        if.gif
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          joinminus.gif
          if.gif
          Se - Condizioni
          • empty.gif
            line.gif
            empty.gif
            empty.gif
            line.gif
            joinbottom.gif
            if.gif
            ((Player((Integer A))) controller) Uguale a Utente
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          joinminus.gif
          if.gif
          Allora - Azioni
          • empty.gif
            line.gif
            empty.gif
            empty.gif
            line.gif
            joinbottom.gif
            if.gif
            Dialoghi - Mostra DialogTitle for (Player((Integer A)))
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          joinbottom.gif
          if.gif
          Altrimenti - Azioni
  • empty.gif
    joinbottom.gif
    page.gif
    Trigger - Turn on Replace Race <gen>

i have this for check if the player is a user or computer but happen the same.. computer still choose the race and i dont know how it is possible...
maybe *integer A* IS incorrect????

if i set in the start menù computer enemy human, they become NAGA and i dont know how to fix this..
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,016
The computer players aren't interacting with the dialog at all. Their units are getting changed as a result of some bad/inconsistent unit group looping in your trigger. I don't speak Italian so it's a little hard for me to parse your trigger, but I believe the problem is that you're doing "Unit Group - Pick all units in (units of type Bracciante) and do (actions)" so it grabs ALL of the Bracciantes on the map. This will pick up the computer's units and replace them with some of your custom races. Instead of looping through all units of each type, or all units near the start point of each player (I see you do that at least once) what you want to do is use "units of type owned by player". Something like:

  • -------- At top of trigger --------
  • Set TempPlayer = (Owner of (triggering unit))
  • Set Temp_Integer_1 = Player number of (TempPlayer)
  • -------- When you need to replace units do this --------
  • Custom script: set bj_wantDestroyGroup = true //this cleans up a group leak that the line below this makes, you can read about leaks
  • Unit Group - Pick every unit in (Units owned by TempPlayer of type <your unit type to replace>) and do (Actions)
    • Loop - Actions
      • Unit - Replace (Picked unit) with a <new unit type> using the old unit's relative life and mana
Leaks Tutorial
I believe if you upload the map here my WE will display its triggers in English when I open it.
 
Status
Not open for further replies.
Top