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

Drop Down Dialog Event/Condition

Status
Not open for further replies.
Level 4
Joined
Aug 14, 2007
Messages
66
So I am trying to create a drop down list dialog that allows players to choose 1 of 5 options: Random, Protoss, Terran, Zerg, and None.

The aesthetics work just fine but I cant get the game to recognize what the player has actually selected and I realized that the game thought that the player had chosen every single one of the options whenever the player configured the drop down menu and selected an item. since random is the last one in my dialogue event trigger it ends up being the one selected every time.

If anyone could take a quick look and tell me what event/condition I need to differentiate which one is selected that would be awesome.

  • Setup
    • Events
      • Timer - Elapsed time is 1.0 Game Time seconds
    • Local Variables
    • Conditions
    • Actions
      • Player Group - Pick each player in Players and do (Actions)
        • Actions
          • Dialog - Create a Modal dialog of size (500, 200) at (0, -100) relative to Center of screen
          • Variable - Set OptionMenu[(Picked player)] = (Last created dialog)
          • Dialog - Create a Pulldown for dialog OptionMenu[(Picked player)]
          • Variable - Set OptionMenu_RaceList[(Picked player)] = (Last created dialog item)
          • Dialog - Move OptionMenu_RaceList[(Picked player)] to (0, 50) relative to Bottom of dialog for (Player group((Picked player)))
          • Dialog - Set OptionMenu_RaceList[(Picked player)] tooltip to "Select your race preference to opt ..." for (Player group((Picked player)))
          • Dialog - Add list item "Random" to OptionMenu_RaceList[(Picked player)] for (Player group((Picked player)))
          • Variable - Set OptionMenu_RaceList_Random[(Picked player)] = (Last created dialog item)
          • Dialog - Add list item "Protoss" to OptionMenu_RaceList[(Picked player)] for (Player group((Picked player)))
          • Variable - Set OptionMenu_RaceList_Protoss[(Picked player)] = (Last created dialog item)
          • Dialog - Add list item "Terran" to OptionMenu_RaceList[(Picked player)] for (Player group((Picked player)))
          • Variable - Set OptionMenu_RaceList_Terran[(Picked player)] = (Last created dialog item)
          • Dialog - Add list item "Zerg" to OptionMenu_RaceList[(Picked player)] for (Player group((Picked player)))
          • Variable - Set OptionMenu_RaceList_Zerg[(Picked player)] = (Last created dialog item)
          • Dialog - Add list item "None" to OptionMenu_RaceList[(Picked player)] for (Player group((Picked player)))
          • Variable - Set OptionMenu_RaceList_None[(Picked player)] = (Last created dialog item)
          • Dialog - Show OptionMenu[(Picked player)] for (Player group((Picked player)))
  • Select Race
    • Events
      • Dialog - Any Dialog Item is used by Player Any Player with event type Any
    • Local Variables
    • Conditions
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • OptionMenu_RaceList_None[(Triggering player)] == (Used dialog item)
        • Then
          • UI - Display "None Selected" for (All players) to Subtitle area
          • Variable - Set PlayerOpt[(Triggering player)] = false
          • Variable - Set SelectedRace_Random[(Triggering player)] = false
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • OptionMenu_RaceList_Protoss[(Triggering player)] == (Used dialog item)
        • Then
          • UI - Display "Protoss Selected" for (All players) to Subtitle area
          • Variable - Set SelectedRace[(Triggering player)] = Protoss
          • Variable - Set SelectedRace_Random[(Triggering player)] = false
          • Variable - Set PlayerOpt[(Triggering player)] = true
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • OptionMenu_RaceList_Terran[(Triggering player)] == (Used dialog item)
        • Then
          • UI - Display "Terran Selected" for (All players) to Subtitle area
          • Variable - Set SelectedRace[(Triggering player)] = Terran
          • Variable - Set SelectedRace_Random[(Triggering player)] = false
          • Variable - Set PlayerOpt[(Triggering player)] = true
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • OptionMenu_RaceList_Zerg[(Triggering player)] == (Used dialog item)
        • Then
          • UI - Display "Zerg Selected" for (All players) to Subtitle area
          • Variable - Set SelectedRace[(Triggering player)] = Zerg
          • Variable - Set SelectedRace_Random[(Triggering player)] = false
          • Variable - Set PlayerOpt[(Triggering player)] = true
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • OptionMenu_RaceList_Random[(Triggering player)] == (Used dialog item)
        • Then
          • UI - Display "Random Selected" for (All players) to Subtitle area
          • Variable - Set SelectedRace_Random[(Triggering player)] = true
          • Variable - Set PlayerOpt[(Triggering player)] = true
        • Else
 
This is far too complicated and tiring.
The way you need to set your dialogues is much simpler.

Create a dialogue item, such as the background box, and set it to a variable.
Create the buttons, and assign them to variables as well.
The reason you set it to variables is to turn them off / on when needed.

Create an event that when a dialogue is used, specific recalling the variable, then create an action.
I've already made a map with a very similar setting.
I've uploaded it to this post.
Play the game to understand how it works, and then look at the triggers I've used.

Edit: Seems I've already uploaded this file before and the server wont let me do it again.
Use this link and go to the second post (my first post) to download the file FleetCraft.SC2MAP
 
Level 4
Joined
Aug 14, 2007
Messages
66
solved the problem, too anyone who is curious dr super good is right they are not considered dialogue items and cannot be stored in a variable as such, instead they are assigned an integer value based on the order they are added to the drop down list and in order to check the value you use the condition "Selected List Item" as such:

  • (Selected list item of (Used dialog item) for 1) == 1
The "for 1" refers to a player which confused me the first time I saw it, since im so use to wc3, but at a second glance its much more obvious.
 
Level 5
Joined
Aug 27, 2008
Messages
126
solved the problem, too anyone who is curious dr super good is right they are not considered dialogue items and cannot be stored in a variable as such, instead they are assigned an integer value based on the order they are added to the drop down list and in order to check the value you use the condition "Selected List Item" as such:

  • (Selected list item of (Used dialog item) for 1) == 1
The "for 1" refers to a player which confused me the first time I saw it, since im so use to wc3, but at a second glance its much more obvious.
Thx man! I was really confused.
 
Status
Not open for further replies.
Top