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

[Trigger] Dialog Help

Status
Not open for further replies.
Level 22
Joined
Jun 23, 2007
Messages
3,242
Ok, i cant seem to find my previous thread on dialogs, so i just made this one, but with a different question. so far i have this:

  • Picking a Race Red
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
      • (Player 1 (Red) slot status) Equal to Is playing
    • Actions
      • Dialog - Change the title of RaceChooseDialog to Choose Your Race
      • Dialog - Create a dialog button for RaceChooseDialog labelled Race1
      • Set RaceButtons[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChooseDialog labelled Race2
      • Set RaceButtons[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChooseDialog labelled Race3 Set RaceButtons[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for RaceChooseDialog labelled Race4
      • Set RaceButtons[4] = (Last created dialog Button)
      • Dialog - Show RaceChooseDialog for Player 1 (Red)
      • If ((Player 1 (Red) slot status) Equal to Is unused) then do (Do nothing) else do (Do nothing)
(I had 3 other triggers exactly like the above one, except the player 1(red)'s were all changed to their respective players.

Button Pressed
  • Events
    • Dialog - A dialog button is clicked for RaceChooseDialog
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to RaceButtons[1]
      • Then - Actions
        • Unit - Create 1 Outpost for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
        • Unit - Create 5 Engineer for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
        • Dialog - Hide RaceChooseDialog for (Triggering player)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Clicked dialog button) Equal to RaceButtons[2]
          • Then - Actions
            • Unit - Create 1 Provincial Command for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
            • Unit - Create 5 Mason for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
            • Dialog - Hide RaceChooseDialog for (Triggering player)
          • Else - Actions
(and so on)

Now my problem is this: whenever i play with all the "Picking a Race <player>" triggers, if i click a button, none of the units are created. However, if i disable all of the "Picking a Race <player>" triggers except for mine, pressing the buttons will create players.

Another thing would to create a multiboard where it displays player's names, a small icons of their race, what race theyve chosen, and who hasnt chosen a race yet, and when all playing players have chosen a race, the game will begin.

Another thing i would like to have help with is, having a "Random Race" button for my dialog, so if a player picks that, then he/she will be randomly assigned on of the pickable races. If a player picks "Random Race" then on the multiboard, it will just say "Random".

One last thing, i would like to know if theres an easier way to display the dialog to only players that are playing, so i dont need to have more than 1 trigger for creating/displaying the buttons and dialog.
 
Last edited:
Level 12
Joined
May 30, 2009
Messages
829
Alright, here's the solution to your 4th problem so you can use just one trigger to show your dialog to all the players.

  • Picking a Race
  • Events
    • Time - Elapsed game time is 0.01 seconds
  • Conditions
  • Actions
    • Dialog - Change the title of RaceChooseDialog to Choose Your Race
    • Dialog - Create a dialog button for RaceChooseDialog labelled Race1
    • Set RaceButtons[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for RaceChooseDialog labelled Race2
    • Set RaceButtons[2] = (Last created dialog Button)
    • Dialog - Create a dialog button for RaceChooseDialog labelled Race3
    • Set RaceButtons[3] = (Last created dialog Button)
    • Dialog - Create a dialog button for RaceChooseDialog labelled Race4
    • Set RaceButtons[4] = (Last created dialog Button)
    • Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) or (((Matching player) slot status) Equal to Is playing))) and do (Actions)
      • Loop - Actions
        • Dialog - Show RaceChooseDialog for (Matching player)
You can choose to create a temporary player group variable, set it to All players matching " " and use "Pick Every player in "Your Group" to show the dialog, and destroy it with
  • Custom script: call DestroyForce( udg_Your_Variable ) //Player Group
to avoid memory leaks, but since it's only one leak, it's your choice.

I chose not to solve your first, second, and third problems because this particular section of the forum is for people to help you, not to do your work for you. If you need triggering help, please refer to:
http://www.hiveworkshop.com/forums/tutorials.php
 
Status
Not open for further replies.
Top