- Joined
- Apr 7, 2007
- Messages
- 48
My other thread got buried so I'll try this again.
I have reworked this quite a bit, I removed the rest of the leaks and changed my team distribution function to check for even or odd and then add the last player in. I'm fairly certain that this spawns for every player since I switched Players to AllPlayers and it spawned 6 heros on each side but failed to ally any of us and it didn't appear to put us in a team group. (The respawn trigger put us all at the 2nd teams base)
Help is reeeellllyyyy appreciated, half the content I have planned for the game rides on my ability to team people up.
I have reworked this quite a bit, I removed the rest of the leaks and changed my team distribution function to check for even or odd and then add the last player in. I'm fairly certain that this spawns for every player since I switched Players to AllPlayers and it spawned 6 heros on each side but failed to ally any of us and it didn't appear to put us in a team group. (The respawn trigger put us all at the 2nd teams base)
Help is reeeellllyyyy appreciated, half the content I have planned for the game rides on my ability to team people up.
-
TDM Start
- Events
- Conditions
-
Actions
- Game - Display to (All players) for 20.00 seconds the text: |CFFFF0000Get ready...
- -------- Distribute Players --------
- Set tmp_teamplayers = Players
- Set n = (Number of players in tmp_teamplayers)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (((Real(n)) / 2.00) - (Real((Integer(((Real(n)) / 2.00)))))) Less than or equal to -0.50
-
Then - Actions
-
For each (Integer A) from 1 to ((n - 1) / 2), do (Actions)
-
Loop - Actions
- Set tmp_player = (Random player from tmp_teamplayers)
- Player Group - Add tmp_player to RedTeam
- Player Group - Remove tmp_player from tmp_teamplayers
- Set tmp_player = (Random player from tmp_teamplayers)
- Player Group - Add tmp_player to BlueTeam
- Player Group - Remove tmp_player from tmp_teamplayers
-
Loop - 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
- Set tmp_player = (Random player from tmp_teamplayers)
- Player Group - Add tmp_player to RedTeam
- Player Group - Remove tmp_player from tmp_teamplayers
-
Else - Actions
- Set tmp_player = (Random player from tmp_teamplayers)
- Player Group - Add tmp_player to BlueTeam
- Player Group - Remove tmp_player from tmp_teamplayers
-
If - Conditions
-
For each (Integer A) from 1 to ((n - 1) / 2), do (Actions)
-
Else - Actions
-
For each (Integer A) from 1 to (n / 2), do (Actions)
-
Loop - Actions
- Set tmp_player = (Random player from tmp_teamplayers)
- Player Group - Add tmp_player to RedTeam
- Player Group - Remove tmp_player from tmp_teamplayers
- Set tmp_player = (Random player from tmp_teamplayers)
- Player Group - Add tmp_player to BlueTeam
- Player Group - Remove tmp_player from tmp_teamplayers
-
Loop - Actions
-
For each (Integer A) from 1 to (n / 2), do (Actions)
-
If - Conditions
- -------- End Distribution --------
- Set tmp_spawn = (Center of Red Team Spawn <gen>)
- Player Group - Remove all players from tmp_teamplayers
- Set tmp_teamplayers = RedTeam
-
For each (Integer A) from 1 to (Number of players in tmp_teamplayers), do (Actions)
-
Loop - Actions
- Set tmp_player = (Random player from tmp_teamplayers)
- Unit - Create 1 Heros[(Random integer number between 0 and (TotalHeros - 1))] for tmp_player at tmp_spawn facing Default building facing degrees
- Hero - Create |CFFFF8A00Stock|r and give it to (Last created unit)
- Unit - Change color of (Last created unit) to Red
- Camera - Pan camera for tmp_player to tmp_spawn over 0.00 seconds
- Player Group - Remove tmp_player from tmp_teamplayers
-
Loop - Actions
-
Player Group - Pick every player in RedTeam and do (Actions)
-
Loop - Actions
- Set tmp_player = (Picked player)
-
Player Group - Pick every player in RedTeam and do (Actions)
-
Loop - Actions
- Player - Make tmp_player treat (Picked player) as an Ally with shared vision
-
Loop - Actions
-
Player Group - Pick every player in BlueTeam and do (Actions)
-
Loop - Actions
- Player - Make tmp_player treat (Picked player) as an Enemy
-
Loop - Actions
-
Loop - Actions
- Custom script: call RemoveLocation(udg_tmp_spawn)
- Set tmp_spawn = (Center of Blue Team Spawn <gen>)
- Player Group - Remove all players from tmp_teamplayers
- Set tmp_teamplayers = BlueTeam
-
For each (Integer A) from 1 to (Number of players in tmp_teamplayers), do (Actions)
-
Loop - Actions
- Set tmp_player = (Random player from tmp_teamplayers)
- Unit - Create 1 Heros[(Random integer number between 0 and (TotalHeros - 1))] for tmp_player at tmp_spawn facing Default building facing degrees
- Hero - Create |CFFFF8A00Stock|r and give it to (Last created unit)
- Unit - Change color of (Last created unit) to Blue
- Camera - Pan camera for tmp_player to tmp_spawn over 0.00 seconds
- Player Group - Remove tmp_player from tmp_teamplayers
-
Loop - Actions
-
Player Group - Pick every player in BlueTeam and do (Actions)
-
Loop - Actions
- Set tmp_player = (Picked player)
-
Player Group - Pick every player in BlueTeam and do (Actions)
-
Loop - Actions
- Player - Make tmp_player treat (Picked player) as an Ally with shared vision
-
Loop - Actions
-
Player Group - Pick every player in RedTeam and do (Actions)
-
Loop - Actions
- Player - Make tmp_player treat (Picked player) as an Enemy
-
Loop - Actions
-
Loop - Actions
- Trigger - Turn on XP Ticker <gen>
- Trigger - Turn on TDM Death <gen>
- Trigger - Turn on Creep Spawn <gen>
- Custom script: call RemoveLocation(udg_tmp_spawn)
- Custom script: call DestroyForce(udg_tmp_teamplayers)