• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

dialog array

Status
Not open for further replies.
Level 17
Joined
Aug 19, 2007
Messages
1,377
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.
 
Status
Not open for further replies.
Back
Top