tommerbob
Minecraft. :D
- Reaction score
- 110
I got two triggers that are not working properly. They are for randomly selecting a hero for the players. A hero is selected, but the problem with the first trigger is that it always selects the same hero.
The second trigger is for players to repick a random hero. Again, it works, but it always repicks into the same hero.
I have a total of 14 heroes to be selected, yet both triggers always select the same heroes. Any ideas? Here's triggers:
TRIGGER #1 (Selects random hero for players 2-5)
TRIGGER #2 (Repicks a random hero for player)
The second trigger is for players to repick a random hero. Again, it works, but it always repicks into the same hero.
I have a total of 14 heroes to be selected, yet both triggers always select the same heroes. Any ideas? Here's triggers:
TRIGGER #1 (Selects random hero for players 2-5)
Code:
Random
Events
Conditions
Actions
Trigger - Turn off (This trigger)
For each (Integer A) from 2 to 5, do (Actions)
Loop - Actions
Set RandomPickInteger = (Random integer number between 1 and 14)
Set Herostart[(Integer A)] = ((Player((Integer A))) start location)
Unit Group - Pick every unit in (Random 1 units from (Units in Hero pick <gen> matching ((Point-value of (Unit-type of (Matching unit))) Equal to RandomPickInteger))) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to Herostart[(Integer A)]
Unit - Change ownership of (Picked unit) to (Player((Integer A))) and Change color
Unit Group - Remove (Picked unit) from HeroesPick
Unit Group - Add (Picked unit) to Heroes
Camera - Reset camera for (Player((Integer A))) to standard game-view over 0.00 seconds
Camera - Pan camera for (Player((Integer A))) to Herostart[(Integer A)] over 0.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player((Integer A))) slot status) Equal to Is unused
Then - Actions
Unit - Remove (Picked unit) from the game
Else - Actions
Wait 1.00 seconds
Trigger - Turn on Random pick message <gen>
Trigger - Run Random pick message <gen> (checking conditions)
Trigger - Turn on Repick hero <gen>
TRIGGER #2 (Repicks a random hero for player)
Code:
Repick hero
Events
Player - Player 2 (Blue) types a chat message containing -repick as An exact match
Player - Player 3 (Teal) types a chat message containing -repick as An exact match
Player - Player 4 (Purple) types a chat message containing -repick as An exact match
Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
Conditions
Actions
Trigger - Turn off (This trigger)
Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Set HeroesPick = (Units in Hero pick <gen>)
Set Herostart[(Player number of (Triggering player))] = ((Player((Player number of (Triggering player)))) start location)
Unit Group - Pick every unit in (Random 1 units from HeroesPick) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to Herostart[(Player number of (Triggering player))]
Unit - Change ownership of (Picked unit) to (Triggering player) and Change color
Unit Group - Remove (Picked unit) from HeroesPick
Unit Group - Add (Picked unit) to Heroes
Camera - Reset camera for (Triggering player) to standard game-view over 0.00 seconds
Camera - Pan camera for (Triggering player) to Herostart[(Player number of (Triggering player))] over 0.00 seconds


