• 🏆 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!

[Solved] Dialog don't work

Status
Not open for further replies.
Level 2
Joined
Mar 10, 2021
Messages
15
Hello everyone! My first post, I should have joined a long time ago.

I'm presently making test maps just to try out whatever come to my mind.

Now I'm working on a tavern where a unit gets in and can buy drinks or have a chat with the tavernkeeper.

One of the ways I'm trying to do this is using dialogs, after testing my hand with Orc_Tamer's basic dialog tutorial (which works perfectly, as expected). Trouble is, mine don't work and I don't understand why. I used the same method and my first part (dialog box and buttons) works fine, but I can't get the buttons to work.

So first I made my variables:
TavernDialog, Dialog type
TavernButtons, Dialog button type, array of 7

Then I made my dialog:

  • Tavern 2 dialog
    • Events
      • Unit - A unit enters Tavern 2 <gen>
    • Conditions
    • Actions
      • Dialog - Clear TavernDialog
      • Dialog - Change the title of TavernDialog to Howdy! What can I serve you?
      • Dialog - Create a dialog button for TavernDialog labelled A Fortifying Ale (50 gold)
      • Set DialogButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for TavernDialog labelled I think I'll pass, thank you
      • Set DialogButton[7] = (Last created dialog Button)
      • Dialog - Show TavernDialog for Player 1 (Red)
It's incomplete right now because I wanted to try with less actions to make it work. It didn't.

I made a variable so the target of the "drinks" will be targeted at the unit in the tavern region
Unit, Unit type

With the corresponding trigger:

  • Set unit
    • Events
      • Unit - A unit enters Tavern 2 <gen>
    • Conditions
    • Actions
      • Set Unit = (Entering unit)
The first button:

  • Fortifying Ale
    • Events
      • Dialog - A dialog button is clicked for TavernDialog
    • Conditions
      • (Clicked dialog button) Equal to TavernButtons[1]
    • Actions
      • Player - Add -50 to Player 1 (Red) Current gold
      • Unit - Set life of Unit to 100.00%
      • Game - Display to Player Group - Player 1 (Red) the text: There you go, friend.
The last button:

  • Pass
    • Events
      • Dialog - A dialog button is clicked for TavernDialog
    • Conditions
      • (Clicked dialog button) Equal to TavernButtons[7]
    • Actions
      • Game - Display to Player Group - Player 1 (Red) the text: (You leave)
So, what did I miss? I would have made other dialogs for after the buttons had been clicked, but I went for the easy way seeing the buttons did nothing at all.
 
Last edited:
Level 21
Joined
Dec 4, 2007
Messages
1,473
I started like you, just messing around with tutorials and whatever came to mind - godspeed with that!

Now i don't see anything wrong here, wherefore i predict another trigger interfering.
You could upload the map for further investigation.
 
Level 2
Joined
Mar 10, 2021
Messages
15
I tried deleting the other triggers, but it didn't work. Here is the rebellious map...
 

Attachments

  • test-tavern.w3x
    27.8 KB · Views: 18
Level 20
Joined
Feb 23, 2014
Messages
1,264
You're using 2 Dialog Button Arrays and the one you assign buttons to is not the same as the one you check when a button is clicked:

  • Actions
    • Dialog - Create a dialog button for TavernDialog labelled A Fortifying Ale (50 gold)
    • Set DialogButton[1] = (Last created dialog Button) <- uses "DialogButton" Array
  • Fortifying Ale
    • Events
      • Dialog - A dialog button is clicked for TavernDialog
    • Conditions
      • (Clicked dialog button) Equal to TavernButtons[1] <- checks for "TavernButtons" Array
 
Status
Not open for further replies.
Top