• 🏆 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] Dialog problem

Status
Not open for further replies.
Level 5
Joined
Jun 12, 2016
Messages
74
I'm making a Menu options in my single player game, its like this:

Menu:
Camera Settings
Color Settings
Exit

If the player selects Camera Settings open another dialog:

Camera Settings:
Fixed Camera
Unfixed Camera
Camera Distance 1
Camera Distance 2
Camera Distance 3

And for some reason the second dialog buttons are ignored, here:


  • Menu options
    • Events
      • Dialog - A dialog button is clicked for temp_dialog
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to temp_dialog_button[0]
        • Then - Actions
          • Trigger - Turn on Menu changes for camera <gen>
          • Dialog - Clear temp_dialog
          • Dialog - Change the title of temp_dialog to Alterar Câmera:
          • Dialog - Create a dialog button for temp_dialog labelled Câmera Fixada
          • Set temp_dialog_button[0] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Câmera Livre
          • Set temp_dialog_button[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Distância 1
          • Set temp_dialog_button[2] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Distância 2
          • Set temp_dialog_button[3] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Distância 3
          • Set temp_dialog_button[4] = (Last created dialog Button)
          • Dialog - Show temp_dialog for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to temp_dialog_button[1]
        • Then - Actions
          • Trigger - Turn on Menu changes for collor <gen>
          • Dialog - Clear temp_dialog
          • Dialog - Change the title of temp_dialog to Alterar Cor:
          • Dialog - Create a dialog button for temp_dialog labelled Vermelho
          • Set temp_dialog_button[0] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Azul
          • Set temp_dialog_button[1] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Cerceta
          • Set temp_dialog_button[2] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Roxo
          • Set temp_dialog_button[3] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Amarelo
          • Set temp_dialog_button[4] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Laranja
          • Set temp_dialog_button[5] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Verde
          • Set temp_dialog_button[6] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Rosa (Original)
          • Set temp_dialog_button[7] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Cinza
          • Set temp_dialog_button[8] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Azul Claro
          • Set temp_dialog_button[9] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Verde Escuro
          • Set temp_dialog_button[10] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Castanho
          • Set temp_dialog_button[11] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Castanho Avermelhado
          • Set temp_dialog_button[12] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Azul Escuro
          • Set temp_dialog_button[13] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Turquesa
          • Set temp_dialog_button[14] = (Last created dialog Button)
          • Dialog - Create a dialog button for temp_dialog labelled Violeta
          • Set temp_dialog_button[15] = (Last created dialog Button)
          • Dialog - Show temp_dialog for Player 1 (Red)
        • Else - Actions
After clicking "Câmera Fixada" that is Fixed Camera:

  • Menu changes for camera
    • Events
      • Dialog - A dialog button is clicked for temp_dialog
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to temp_dialog_button[0]
        • Then - Actions
          • Game - Display to (All players) the text: 1
          • Trigger - Run Game Camera <gen> (checking conditions)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to temp_dialog_button[1]
        • Then - Actions
          • Game - Display to (All players) the text: 2
          • Trigger - Run Game Camera <gen> (checking conditions)
          • Camera - Lock camera target for Player 1 (Red) to Hero, offset by (40.00, 40.00) using The unit's rotation
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to temp_dialog_button[2]
        • Then - Actions
          • Set cameraheight_integer = 1
          • Set temp_point4 = (Target of current camera view)
          • Camera - Apply Game Camera 1 <gen> for Player 1 (Red) over 0.10 seconds
          • Camera - Pan camera for Player 1 (Red) to temp_point4 over 0.00 seconds
          • Custom script: call RemoveLocation (udg_temp_point4)
          • Game - Display to (All players) the text: (|cffF5A9A9Ajustando visão para câmera + ((String(cameraheight_integer)) + .|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to temp_dialog_button[3]
        • Then - Actions
          • Set cameraheight_integer = 2
          • Set temp_point4 = (Target of current camera view)
          • Camera - Apply Game Camera 2 <gen> for Player 1 (Red) over 0.10 seconds
          • Camera - Pan camera for Player 1 (Red) to temp_point4 over 0.00 seconds
          • Custom script: call RemoveLocation (udg_temp_point4)
          • Game - Display to (All players) the text: (|cffF5A9A9Ajustando visão para câmera + ((String(cameraheight_integer)) + .|r))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to temp_dialog_button[4]
        • Then - Actions
          • Set cameraheight_integer = 3
          • Set temp_point4 = (Target of current camera view)
          • Camera - Apply Game Camera 3 <gen> for Player 1 (Red) over 0.10 seconds
          • Camera - Pan camera for Player 1 (Red) to temp_point4 over 0.00 seconds
          • Custom script: call RemoveLocation (udg_temp_point4)
          • Game - Display to (All players) the text: (|cffF5A9A9Ajustando visão para câmera + ((String(cameraheight_integer)) + .|r))
        • Else - Actions
So, I have put an index:
  • Game - Display to (All players) the text: 0
  • Game - Display to (All players) the text: 1
This tell me in game what runs and what don't, so the only index that show is the "0", so it says that the seccond triggers runs until the if/then/else that for some reason it doesn't read it.

EDIT: More info:

The temp_dialog beign the same for both dialogs is not the problem since the seccond triggers do run for the temp_dialog, I have also tested with different variables for the temp_dialog_button with an temp_dialog_button2 but didn't run either. The problem is in the condition reading "(Clicked dialog button) Equal to temp_dialog_button[0]" for some reason it is not reading it.
 
Last edited:
Level 9
Joined
Jul 30, 2018
Messages
445
Why do you use so arbitrary variable names? Anyway, even though you say it's not because it's basically the same dialog (temp_dialog), that's really the only reason I could think of why it's not working. I don't think dialogs work very well, especially if you try to change them while they are being shown. That being said, you could try to hide the dialog, then change the title and buttons and showing it in the end.

But in general, I would recommend using their own dialog with dedicated buttons for everything, because, for example, even if you got that working now, it wouldn't work with multiple players.
 
Level 5
Joined
Jun 12, 2016
Messages
74
Ok, I'll try hiding and showing to see if that's the problem [NOTHING HAPPENED], also gonna try a second variable for dialog [PROBLEM SOLVED]. I know this don't work for multiplayer, the reason I'm using it that way is that it's a single player campaign.

[EDIT]: problem solved changing the dialog variable, it appears that follow ups dialogs can't change buttons variable name.
 
Last edited:
Status
Not open for further replies.
Top