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

[Solved] Choices trogger type.

Status
Not open for further replies.
Level 9
Joined
Mar 2, 2017
Messages
229
Well ...
I made some kind of choices within my map, with dialogs.

Choice A you get item 1.
C
hoice B you don't get item 1.

Then you have another choice.

Choice C : use item 1.
Choice D : Break everything.

Problem :
When chosing choice B, you shouldn't have the choice C, but it appear whatever I.
I used the trigger.
If Dialog1Button1 = (Clicked Button) then set Dialog2Button1 = Use item 1, else do (Do Nothing.)

Why the Button "use Item 1" keep appearing ?!
 
Level 11
Joined
Jun 2, 2004
Messages
849
Well what I was suggesting was merely a guess anyway. Don't want to go make a video or bunch of screenshots if I'm wrong about what you're doing in the first place.

I suggest you post your triggers. You can get the trigger by right clicking on it in the trigger editor and selecting "copy as text" (specifically you need to right click on the line directly above "Events" in the trigger editor, where the trigger name is). Then you can paste into a post here on the forums (right click -> paste), and enclose it in trigger tags ([ trigger] pasted text [ /trigger], only without spaces inside the brackets). Do this for all relevant triggers so we can see them.
 
Level 9
Joined
Mar 2, 2017
Messages
229
night-elf-2-png.275962

night-elf-png.275963
Else do Nothing




Well, and now ?
 
Level 11
Joined
Jun 2, 2004
Messages
849
Ah, you're misunderstanding how the flow of trigger logic works.

You'll want to run Dialog 2 Inits after a button has been clicked for Dialog1, not at 0 seconds. Replace the event in Dialog 2 Inits with "Dialog - Dialog Button Click" and selecting Dialog1. It's the 4th option from the top. Then your code should work.


As a side note, it will generally make your life easier to use "If / Then / Else, Multiple Functions" over "If / Then / Else". Both work just fine, but the multiple functions one is far easier to modify.
 
Level 9
Joined
Mar 2, 2017
Messages
229
Ah, you're misunderstanding how the flow of trigger logic works.

You'll want to run Dialog 2 Inits after a button has been clicked for Dialog1, not at 0 seconds. Replace the event in Dialog 2 Inits with "Dialog - Dialog Button Click" and selecting Dialog1. It's the 4th option from the top. Then your code should work.


As a side note, it will generally make your life easier to use "If / Then / Else, Multiple Functions" over "If / Then / Else". Both work just fine, but the multiple functions one is far easier to modify.


So if I click button 2 Otherwise than Button 1 If Dialog1 the Button1 isn Dialog2 won't appear ?
 
Level 13
Joined
May 10, 2009
Messages
868
There are two problems actually:

1 - Your second dialog is being defined as soon as your map starts running. So, no matter what a player chooses on the first dialog, the second one is going to be displayed just like that.
2 - You are adding a button to the second dialog, then using an If-Block in order to assign that button to a variable. Whether it returns true or false, the button will be there; It's just not being referenced by a variable.

In order to fix it you need to do something like this:

Define/Create dialog 1
  • Define Dialog 1
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Title --------
      • Dialog - Change the title of Dialog[0] to Conversation
      • -------- Add buttons --------
      • Dialog - Create a dialog button for Dialog[0] labelled Check
      • Set Dialog_Button[0] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog[0] labelled Aye
      • Set Dialog_Button[1] = (Last created dialog Button)
      • -------- TEST --------
      • Dialog - Show Dialog[0] for Player 1 (Red)
We need to define/create dialog 2 when a player chooses any button from dialog 1
  • Define Dialog 2
    • Events
      • Dialog - A dialog button is clicked for Dialog[0]
    • Conditions
    • Actions
      • -------- Title --------
      • Dialog - Change the title of Dialog[1] to ???
      • -------- Add crystal button only IF a player has clicked on the first button from dialog 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Dialog_Button[0]
        • Then - Actions
          • -------- Do note that (Clicked dialog button) only returns true for a specific button if you use the proper event for it. --------
          • -------- Which is "Dialog - A dialog button is clicked for <var>". As for the other events, it will always return false. --------
          • Dialog - Create a dialog button for Dialog[1] labelled Crystal
          • Set Dialog_Button[2] = (Last created dialog Button)
        • Else - Actions
      • Dialog - Create a dialog button for Dialog[1] labelled Ballista
      • Set Dialog_Button[3] = (Last created dialog Button)
      • -------- Also, don't use "Clear Dialog" action before checking which button a player clicked on. Because, if you clear it, you're basically removing all of them, and you won't know which one a player chose. --------
      • Dialog - Clear Dialog[0]
      • -------- TEST --------
      • Dialog - Show Dialog[1] for Player 1 (Red)
  • Clear dialog 2
    • Events
      • Dialog - A dialog button is clicked for Dialog[1]
    • Conditions
    • Actions
      • -------- Do whatever you want to do here first. --------
      • -------- -------- --------
      • -------- -------- --------
      • -------- -------- --------
      • -------- -------- --------
      • -------- Then, you clear it. --------
      • Dialog - Clear Dialog[1]
 
Last edited:
Level 5
Joined
Aug 20, 2015
Messages
133
suggest to use timers with 0.01 sec to perform next button trigger
and also grab a pen and a list of paper, and make sone notes about trigger logic u want to see
 
Status
Not open for further replies.
Top