• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Dialog Problem

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,601
Hey.

I have problem with dialogs. When I press whatever button every single button is activated. I wonder why? And how do I fix this?

Should I do dialogs somehow differently so that they won't bug? Like what?

This type of system is working elsewhere, but not in this. I've tried remaking this dialog many times before but always the same bug occurs. Maybe these triggers are corrupted?

  • Kaza Enter
    • Events
      • Unit - A unit enters Kaza Leader <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Entering unit) Equal to AAAFradz
          • (Entering unit) Equal to AAAPhodom
    • Actions
      • Trigger - Turn off (This trigger)
      • Cinematic - Fade out over 0.50 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Unit - Pause all units
      • Wait 1.00 seconds
      • Set Kaza_Name = Kaza Leader
      • Set Kaza_Unit = Kaza Leader 0502 <gen>
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Kaza Dialog
    • Events
    • Conditions
    • Actions
      • Dialog - Change the title of Information_Dialog to |c0020C000Tell me.....
      • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01About you...
      • Set Information_Dialog_DB1 = (Last created dialog Button)
      • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01About you...
      • Set Information_Dialog_DB2 = (Last created dialog Button)
      • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01About the...
      • Set Information_Dialog_DB3 = (Last created dialog Button)
      • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01About Dra...
      • Set Information_Dialog_DB4 = (Last created dialog Button)
      • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01Your stud...
      • Set Information_Dialog_DB5 = (Last created dialog Button)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Information_Dialog_REQ[1] Equal to True
        • Then - Actions
          • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01Differenc...
          • Set Information_Dialog_DB6 = (Last created dialog Button)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Information_Dialog_REQ[2] Equal to True
        • Then - Actions
          • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01Chain of ...
          • Set Information_Dialog_DB7 = (Last created dialog Button)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Information_Dialog_REQ[3] Equal to True
        • Then - Actions
          • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01What now
          • Set Information_Dialog_DB8 = (Last created dialog Button)
        • Else - Actions
      • Dialog - Create a dialog button for Information_Dialog labelled |c00FFFC01Leave
      • Set Information_Dialog_DB9 = (Last created dialog Button)
      • Dialog - Show Information_Dialog for Player 1 (Red)
  • Who are YOU
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB1
    • Actions
      • Game - Display to (All players) the text: 1
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display I am the leader of .... Modify duration: Set to 16.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Who are RACE
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB2
    • Actions
      • Game - Display to (All players) the text: 2
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display We call ourselves K.... Modify duration: Set to 10.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Yes, we have brethr.... Modify duration: Set to 18.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Who are WAR
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB3
    • Actions
      • Game - Display to (All players) the text: 3
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Humans were and sti.... Modify duration: Set to 12.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display The opposing forces.... Modify duration: Set to 10.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display We Kazas took on th.... Modify duration: Set to 8.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display It is rather strang.... Modify duration: Set to 14.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Most of their tribe.... Modify duration: Set to 14.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Who are DRAGONS
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB4
    • Actions
      • Game - Display to (All players) the text: 4
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Dragons are vile, s.... Modify duration: Set to 16.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Now that we have sl.... Modify duration: Set to 8.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Who are STUDIES
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB5
    • Actions
      • Game - Display to (All players) the text: 5
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display I want you to know .... Modify duration: Set to 12.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display There are beings wh.... Modify duration: Set to 12.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Those who do not ha.... Modify duration: Set to 16.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Information_Dialog_REQ[1] = True
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Who are DIFFERENCES
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB6
    • Actions
      • Game - Display to (All players) the text: 6
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display The amount of power.... Modify duration: Set to 8.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display At the war, we stud.... Modify duration: Set to 10.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Why would the gods .... Modify duration: Set to 12.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Information_Dialog_REQ[2] = True
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Who are MYSTERY
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB7
    • Actions
      • Game - Display to (All players) the text: 7
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display This force is like .... Modify duration: Set to 8.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display This is the all I c.... Modify duration: Set to 16.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display This is the all I c.... Modify duration: Set to 2.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display This has not occurr.... Modify duration: Set to 18.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Many peaceful races.... Modify duration: Set to 10.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display I suspect the drago.... Modify duration: Set to 10.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Information_Dialog_REQ[3] = True
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Who are NOW
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB8
    • Actions
      • Game - Display to (All players) the text: 8
      • Dialog - Clear Information_Dialog
      • Set Cinematic = True
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 seconds
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Once I'm sure this .... Modify duration: Set to 14.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display I don't know if the.... Modify duration: Set to 8.00 seconds and Wait
      • Cinematic - Send transmission to (All players) from Kaza_Unit named Kaza_Name: Play No sound and display Enough! I've been s.... Modify duration: Set to 6.00 seconds and Wait
      • Cinematic - Turn cinematic mode Off for (All players)
      • Set Cinematic = False
      • Wait 1.00 seconds
      • Trigger - Run Kaza Dialog <gen> (checking conditions)
  • Quit
    • Events
      • Dialog - A dialog button is clicked for Information_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Information_Dialog_DB9
    • Actions
      • Game - Display to (All players) the text: 9
      • Dialog - Clear Information_Dialog
      • Cinematic - Fade in over 0.50 seconds using texture White Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 0.50 seconds
      • Unit - Unpause all units
      • Wait 2.00 seconds
      • Trigger - Turn on Kaza Enter <gen>
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
By the sound of the problem (have not looked at code) you have...
Your check to see which button was pressed is wrong, resulting in it always returning true whenever any button is pressed (why all buttons run). This can be caused by eithor dumb conditional logic (redesign needed to fix) or a bug with the button identification (variables do not contain values you expect them to).

You may also be making the dialog at map initialization which is not supported (will bug the dialog). Always make it any time after map initialization.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
By the sound of the problem (have not looked at code) you have...
Your check to see which button was pressed is wrong, resulting in it always returning true whenever any button is pressed (why all buttons run). This can be caused by eithor dumb conditional logic (redesign needed to fix) or a bug with the button identification (variables do not contain values you expect them to).

You may also be making the dialog at map initialization which is not supported (will bug the dialog). Always make it any time after map initialization.

Use:
  • Time - Elapsed game time is 0.01 seconds
 
Level 37
Joined
Aug 14, 2006
Messages
7,601

Okay, thanks. But how did you actually fix this? Just added one boolean variable? Did that fix everything? I would like to prevent this happening in the future.

By the sound of the problem (have not looked at code) you have...
Your check to see which button was pressed is wrong, resulting in it always returning true whenever any button is pressed (why all buttons run). This can be caused by eithor dumb conditional logic (redesign needed to fix) or a bug with the button identification (variables do not contain values you expect them to).

You may also be making the dialog at map initialization which is not supported (will bug the dialog). Always make it any time after map initialization.


I see. But I think I have prevented all those options.

Use:
  • Time - Elapsed game time is 0.01 seconds

I create the dialog every time it's needed.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Okay, thanks. But how did you actually fix this? Just added one boolean variable? Did that fix everything?

I made the dialog to be cleared only when necessary (when there's need to add a button). I moved the Dialog - Clear to right before Run Kaza Dialog line. Added the boolean also.

Note that the boolean must be true before creating the dialog the first time. But you could reverse the logic.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Remember that in multiplayer games, it is possible to send a dialog click order even if it is not visible for a player (so you need to make sure the buttons only do stuff when they should).

Proof of this is the use of GetLocalPlayer to show a dialog locally. It will not dsync the player despite with all logic from the other player's view point he should never be able to click the button. I do not know why someone has not made a hack for this yet as it could be used to seriosuly bug so many custom maps.
 
Status
Not open for further replies.
Top