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

Status
Not open for further replies.
Level 6
Joined
Apr 1, 2009
Messages
201
I'm trying to make a trigger when you enter a region, a dialog menu pops up and when you click one of the buttons it moves your unit somewhere. I made the trigger where the unit enters the region and it displays the dialog, but I'm not sure how to figure out to move the unit with the dialog button that was clicked. Here's the first trigger, I'll also display the second trigger but it doesn't work at all. Whats wrong with the second trigger is that it doesn't know where to get the triggering unit from because a dialog button was clicked, but I'm not sure how to fix it so it can.

  • Elevator
    • Events
      • Unit - A unit enters Elevator Enter <gen>
      • Unit - A unit enters Floor 1 Exit Spot <gen>
      • Unit - A unit enters Floor 2 Exit Spot <gen>
      • Unit - A unit enters Floor 3 Exit Spot <gen>
    • Conditions
      • (Owner of (Entering unit)) Not equal to Player 12 (Brown)
    • Actions
      • Dialog - Clear Elevator
      • Dialog - Change the title of Elevator to Elevator
      • Dialog - Create a dialog button for Elevator labelled First Floor
      • Set ElevatorButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Elevator labelled Second Floor
      • Set ElevatorButton[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for Elevator labelled Third Floor
      • Set ElevatorButton[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Elevator labelled Lobby
      • Set ElevatorButton[4] = (Last created dialog Button)
      • Dialog - Show Elevator for (Owner of (Entering unit))
  • Elevator Button
    • Events
      • Dialog - A dialog button is clicked for Elevator
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to ElevatorButton[1]
        • Then - Actions
          • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Floor 1 Enter Spot <gen>) over 0.00 seconds
          • Unit - Move (Triggering unit) instantly to (Center of Floor 1 Enter Spot <gen>)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to ElevatorButton[2]
            • Then - Actions
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Floor 2 Enter Spot <gen>) over 0.00 seconds
              • Unit - Move (Triggering unit) instantly to (Center of Floor 2 Enter Spot <gen>)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to ElevatorButton[3]
                • Then - Actions
                  • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Floor 3 Enter Spot <gen>) over 0.00 seconds
                  • Unit - Move (Triggering unit) instantly to (Center of Floor 3 Enter Spot <gen>)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Clicked dialog button) Equal to ElevatorButton[4]
                    • Then - Actions
                      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Elevator Exit <gen>) over 0.00 seconds
                      • Unit - Move (Triggering unit) instantly to (Center of Elevator Exit <gen>)
                    • Else - Actions
 
Level 6
Joined
Apr 1, 2009
Messages
201
The trigger doesn't work and when a unit enters one of the four regions the dialog pops up but when you click a button nothing happens
 
Ok, I fixed it. To make it support multiple players now, just make "Unit" variable array-enhanced and use Set Unit[Player number of (Owner of (Triggering unit))] = (Triggering unit). Obviously, you will need to modify the second trigger too, which currently shares the variable "Unit". To refer to the unit in the second trigger, use "Unit[Player number of (Triggering player)]". I just sent you the map back.
 
Status
Not open for further replies.
Top