• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] race selection

Status
Not open for further replies.
Level 3
Joined
Apr 16, 2009
Messages
30
hi.

i wanted to use some sort of trigger where at the start of the game a window pops up without pausing for you to choose to spawn a type of barracks (example, human, undead, orc, night elf, ect.)

however i don't know how to do this, can someone please tell me what i need to do (aswell as giving some instructions on the hard parts if possible) if you can tell me it would be a great help.
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
You need the trigger actions "dialog".

1.) Create a variable called "Dialog" (or something else)
2.) Create a "dialog - buttons" array with one button for every race.
3.) Create the trigger:

Event: Gametime is 5 min... (or whatever you want)
Action:
Create a new dialog
set "yourDialogVariable" = last created dialog
Create 1 button for "yourDialogVariable" called Human
set buttonArray[0] = last created button
Create 1 button for "yourDialogVariable" calleld Orc
set buttonArray[1] = last created button

... so on for every race.
at the end: dialog - show "yourDialogVariable" to all players
Then you need another trigger:

Event: Dialog button is pressed for "yourDialogVariable"
Action:
dialog - hide "yourDialogVariable" for trigg player
If(pressedButton = buttonArray[0])
then: create one "Human" mainbuilding at startposition of triggering player (trigg player should work here but I am not sure)
create 5 workers for trigg player at start pos of trigg player
elseif(pressedButton = buttonArray[1])
Create one "nightelf" mainbuilding at ...

one if for every race.
ALWAYS create mainbuilding and start units
 
Level 3
Joined
Apr 16, 2009
Messages
30
erm.... i'm not quite sure how to do this:

Action:
Create a new dialog
set "yourDialogVariable" = last created dialog
Create 1 button for "yourDialogVariable" called Human
set buttonArray[0] = last created button
Create 1 button for "yourDialogVariable" calleld Orc
set buttonArray[1] = last created button

... so on for every race.
at the end: dialog - show "yourDialogVariable" to all players
 
Level 3
Joined
Apr 16, 2009
Messages
30
AH! but theres the problem, in my new action-dialog submenu i only have:
show\hide
change title
create dialog button
clear

i can't find: Create new dialog anywhere.......
 
Level 3
Joined
Apr 16, 2009
Messages
30
The youtube vid was great help, but i'm not quite sure how to convert that over to spawning units instead of creating a timer....
 
Level 3
Joined
Apr 16, 2009
Messages
30
i've come to a small problem... how do i make it so that creates units for a different player other than player red, because it only makes it for that player
 
Level 4
Joined
Apr 25, 2008
Messages
75
Well you have to show the dialog box to every player and make a new trigger:
Event: Dialog - A Dialog Button is Clicked
Conditions: (Clicked Dialog Button) Equal to (Undead/Human/etc)
Actions: Create x for (Triggering Player) at x

Of course if your making them all at same position something will glitch because you can't build buildings on top of each other.

Maybe consider making a unit that can build the building instead of the building itself? But of course the unit dies after building (like a Wisp building an ancient). Good Luck!
 
Status
Not open for further replies.
Top