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

Creating a Race Choosing Dialog

Status
Not open for further replies.
Level 11
Joined
Feb 2, 2011
Messages
342
I want to create a dialog that allows users to choose between a Human or Blood Elf race in the beginning of the game. I want Human race to be the default. I want the correct starting units to be replaced upon the choice of the Blood Elf race.
 
Level 19
Joined
Oct 7, 2014
Messages
2,209
I would like the option to be available in the game creation window though, but that could get complicated.

I think I saw that in the tools section

But I can help you with the trigger.

  • Blood Elf Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • (Race of (Picked player)) Equal to Human
            • Then - Actions
              • Dialog - Change the title of Race_Dialog to Play as the Blood Elf
              • Dialog - Create a dialog button for Race_Dialog labelled Yes
              • Set Race_Dialog_Buttons[0] = (Last created dialog Button)
              • Dialog - Create a dialog button for Race_Dialog labelled No
              • Set Race_Dialog_Buttons[1] = (Last created dialog Button)
              • 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 - Show Race_Dialog for (Player((Integer A)))
                    • Else - Actions
            • Else - Actions
      • Trigger - Turn on Blood Elf Pick <gen>
      • Custom Script: udj Destroy Unit Group

  • Blood Elf Pick
    • Events
      • Dialog - A dialog button is clicked for Race_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Race_Dialog_Buttons[0]
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Town Hall
            • Then - Actions
              • Unit - Replace (Picked unit) with a (Custom Town Hall) using The new unit's default life and mana
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Peasant
            • Then - Actions
              • Unit - Replace (Picked unit) with a (Custom Worker) using The new unit's default life and mana
            • Else - Actions
 
Last edited:
Level 11
Joined
Feb 2, 2011
Messages
342
I think I saw that in the tools section

But I can help you with the trigger.

  • Blood Elf Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • (Race of (Picked player)) Equal to Human
            • Then - Actions
              • Dialog - Change the title of Race_Dialog to Play as the Blood Elf
              • Dialog - Create a dialog button for Race_Dialog labelled Yes
              • Set Race_Dialog_Buttons[0] = (Last created dialog Button)
              • Dialog - Create a dialog button for Race_Dialog labelled No
              • Set Race_Dialog_Buttons[1] = (Last created dialog Button)
              • 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 - Show Race_Dialog for (Player((Integer A)))
                    • Else - Actions
            • Else - Actions
      • Trigger - Turn on Blood Elf Pick <gen>
      • Custom Script: udj Destroy Unit Group

  • Blood Elf Pick
    • Events
      • Dialog - A dialog button is clicked for Race_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Race_Dialog_Buttons[0]
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Town Hall
            • Then - Actions
              • Unit - Replace (Picked unit) with a (Custom Town Hall) using The new unit's default life and mana
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Peasant
            • Then - Actions
              • Unit - Replace (Picked unit) with a (Custom Worker) using The new unit's default life and mana
            • Else - Actions

Thanks! This looks like it will work. I will try it.
 
Level 11
Joined
Feb 2, 2011
Messages
342
I think I saw that in the tools section

But I can help you with the trigger.

  • Blood Elf Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • (Race of (Picked player)) Equal to Human
            • Then - Actions
              • Dialog - Change the title of Race_Dialog to Play as the Blood Elf
              • Dialog - Create a dialog button for Race_Dialog labelled Yes
              • Set Race_Dialog_Buttons[0] = (Last created dialog Button)
              • Dialog - Create a dialog button for Race_Dialog labelled No
              • Set Race_Dialog_Buttons[1] = (Last created dialog Button)
              • 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 - Show Race_Dialog for (Player((Integer A)))
                    • Else - Actions
            • Else - Actions
      • Trigger - Turn on Blood Elf Pick <gen>
      • Custom Script: udj Destroy Unit Group

  • Blood Elf Pick
    • Events
      • Dialog - A dialog button is clicked for Race_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Race_Dialog_Buttons[0]
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Town Hall
            • Then - Actions
              • Unit - Replace (Picked unit) with a (Custom Town Hall) using The new unit's default life and mana
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Peasant
            • Then - Actions
              • Unit - Replace (Picked unit) with a (Custom Worker) using The new unit's default life and mana
            • Else - Actions

These triggers did not work and rendered my map unusable. I think it was the custom script.
 
@apcrabnightlive
Not there, the second trigger.
So, the second trigger look like this :
  • Blood Elf Pick
  • Events
  • Dialog - A dialog button is clicked for Race_Dialog
  • Conditions
  • (Clicked dialog button) Equal to Race_Dialog_Buttons[0]
  • Actions
  • Custom Script : set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Unit-type of (Picked unit)) Equal to Town Hall
  • Then - Actions
  • Unit - Replace (Picked unit) with a (Custom Town Hall) using The new unit's default life and mana
  • Else - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Unit-type of (Picked unit)) Equal to Peasant
  • Then - Actions
  • Unit - Replace (Picked unit) with a (Custom Worker) using The new unit's default life and mana
  • Else - Actions
Sorry for the messy script, I was on mobile.
 
Level 19
Joined
Oct 7, 2014
Messages
2,209
@apcrabnightlive
Not there, the second trigger.
So, the second trigger look like this :
Blood Elf Pick
Events
Dialog - A dialog button is clicked for Race_Dialog
Conditions
(Clicked dialog button) Equal to Race_Dialog_Buttons[0]
Actions
Custom Script : set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Town Hall
Then - Actions
Unit - Replace (Picked unit) with a (Custom Town Hall) using The new unit's default life and mana
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Peasant
Then - Actions
Unit - Replace (Picked unit) with a (Custom Worker) using The new unit's default life and mana
Else - Actions
Sorry for the messy script, I was on mobile.


So that is the only thing I should add?
 
Status
Not open for further replies.
Top