Below are the triggers I used for my custom race map, and what I'm trying to do is to is that AIs will use the melee race and melee script, and players can choose from the custom races I made via dialog buttons and if they fail to choose right before the 10 second mark they are automatically randomed, and open slots wont get starting units. Can you guys please help me? I dont know much about triggers, and im just trying things out.
Edit: everything worked out perfectly except for the 10 second mark wherein everyone gets randomed, and open slots (or player slots without AI or user players) get custom race starting units too.
Melee Initialization Trigger
Edit: everything worked out perfectly except for the 10 second mark wherein everyone gets randomed, and open slots (or player slots without AI or user players) get custom race starting units too.
Melee Initialization Trigger
-
Events
- Map initialization
- Conditions
-
Actions
- Melee Game - Use melee time of day (for all players)
- Melee Game - Limit Heroes to 1 per Hero-type (for all players)
- Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
- Melee Game - Set starting resources (for all players)
- Melee Game - Remove creeps and critters from used start locations (for all players)
- Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
-
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 Computer
-
Then - Actions
- Melee Game - Create (Race of (Picked player)) starting units for (Picked player) at ((Picked player) start location) (Include Heroes)
- Melee Game - Run melee AI scripts (for computer players)
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Game - Display to (All players) the text: You have 10 seconds...
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
- Player - Set (Picked player) Available free Heroes to 1
- Player - Limit training of Sea Emperor to 1 for (Picked player)
- Player - Limit training of Tidal Terror to 1 for (Picked player)
- Player - Limit training of Sea Druid to 1 for (Picked player)
- Player - Limit training of Snapper to 1 for (Picked player)
-
Loop - Actions
-
Events
- Time - Elapsed game time is 10.00 seconds
- Conditions
-
Actions
- Custom script: call MeleeVictoryDefeat()
-
Events
- Time - Elapsed game time is 0.00 seconds
- Conditions
-
Actions
- Dialog - Change the title of Dialog to Pick a Race
- Dialog - Create a dialog button for Dialog labelled Horde of the Sunken...
- Set Button[1] = (Last created dialog Button)
- Dialog - Create a dialog button for Dialog labelled Horde of the Swamps
- Set Button[2] = (Last created dialog Button)
- Dialog - Create a dialog button for Dialog labelled Horde of the Conque...
- Set Button[3] = (Last created dialog Button)
- Dialog - Create a dialog button for Dialog labelled Horde of the Frozen...
- Set Button[4] = (Last created dialog Button)
- Set PlayerGroup = (All players controlled by a User player)
-
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
-
Loop - Actions
- Dialog - Show Dialog for (Picked player)
-
Loop - Actions
-
Events
- Dialog - A dialog button is clicked for Dialog
- Conditions
-
Actions
- -------- Horde of the Sunken Ruins --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Clicked dialog button) Equal to Button[1]
-
Then - Actions
- Unit - Create 1 Sunken Hall for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Unit - Create 5 Shorewalker (Sunken Horde) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Player Group - Remove (Triggering player) from PlayerGroup
-
Else - Actions
- Do nothing
-
If - Conditions
- -------- Horde of the Swamps --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Clicked dialog button) Equal to Button[2]
-
Then - Actions
- Unit - Create 1 Great Hut for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Unit - Create 5 Gatherer for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Player Group - Remove (Triggering player) from PlayerGroup
-
Else - Actions
- Do nothing
-
If - Conditions
- -------- Horde of the Conquered Lands --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Clicked dialog button) Equal to Button[3]
-
Then - Actions
- Unit - Create 1 Bastion for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Unit - Create 5 Laborer for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Player Group - Remove (Triggering player) from PlayerGroup
-
Else - Actions
- Do nothing
-
If - Conditions
- -------- Horde of the Frozen Barrens --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Clicked dialog button) Equal to Button[4]
-
Then - Actions
- Unit - Create 1 Icy Hall (Frozen Horde) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Unit - Create 5 Worker (Frozen Horde) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
- Player Group - Remove (Triggering player) from PlayerGroup
-
Else - Actions
- Do nothing
-
If - Conditions
-
Events
- Time - Elapsed game time is 9.99 seconds
- Conditions
-
Actions
-
Player Group - Pick every player in (All players controlled by a None player) and do (Actions)
-
Loop - Actions
- Player Group - Remove (Picked player) from PlayerGroup
-
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked player) is in PlayerGroup) Equal to True
-
Then - Actions
- Dialog - Hide Dialog for (Picked player)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 4) Equal to 1
-
Then - Actions
- Unit - Create 1 Sunken Hall for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Unit - Create 5 Shorewalker (Sunken Horde) for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Player Group - Remove (Picked player) from PlayerGroup
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 3) Equal to 1
-
Then - Actions
- Unit - Create 1 Great Hut for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Unit - Create 5 Gatherer for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Player Group - Remove (Picked player) from PlayerGroup
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 2) Equal to 1
-
Then - Actions
- Unit - Create 1 Bastion for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Unit - Create 5 Laborer for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Player Group - Remove (Picked player) from PlayerGroup
-
Else - Actions
- Unit - Create 1 Icy Hall (Frozen Horde) for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Unit - Create 5 Worker (Frozen Horde) for (Picked player) at ((Picked player) start location) facing Default building facing degrees
- Player Group - Remove (Picked player) from PlayerGroup
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Loop - Actions
-
Player Group - Pick every player in (All players controlled by a None player) and do (Actions)