• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

dialog array

Not open for further replies.
Level 17
Aug 19, 2007
Hi all,

I have a question about dialog arrays and dialog button arrays events (so when the button is pressed).

I now have the following code to create a dialog for every user (noob alert :cred:):

  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) controller) Equal to User
        • Then - Actions
          • Dialog - Clear RaceDialog[(Integer A)]
          • Dialog - Change the title of RaceDialog[(Integer A)] to Pick a race:
          • Dialog - Create a dialog button for RaceDialog[(Integer A)] labelled Human
          • Set RaceDialogButton1[(Integer A)] = (Last created dialog Button)
          • Dialog - Show RaceDialog[(Integer A)] for (Player((Integer A)))
        • Else - Actions
Now I want that when an user presses Human, starting units are created for him/her. Problem is though that I don't know which number I need to use for the array of the dialog button event (the [1] and (1) needs to be something else):

  • Human race selected
    • Events
      • Dialog - A dialog button is clicked for RaceDialog[1]
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Clicked dialog button) Equal to RaceDialogButton1[1]
    • Actions
      • Unit - Create 1 Town Hall for (Player(1)) at ((Player(1)) start location) facing Default building facing degrees
      • Unit - Create 4 Peasant for (Player(1)) at ((Player(1)) start location) facing Default building facing degrees
Thanks for taking the time.
Not open for further replies.