- Joined
- Mar 24, 2013
- Messages
- 1,105
Hello, I'm in the midst of making a hero arena map, and I want to have an All Random game mode, meaning that with this choice selected at the start of each round all the players in the game get a random hero from the "bank" of possible heroes, I'm not entirely sure how to do this, and I am looking for some general guidance.
Right now I am putting all the heroes in a unit group and then randomly assigning them (at least I think I am, but maybe not cause when I test it I always "random" hero A).
Thanks for any help at all! Will definitely +rep!
Right now I am putting all the heroes in a unit group and then randomly assigning them (at least I think I am, but maybe not cause when I test it I always "random" hero A).
-
RandomSelected
-
Events
- Player - Player 1 (Red) types a chat message containing -random as An exact match
- Conditions
-
Actions
- Game - Display to (All players) the text: Random Was Selected...
-
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
- ((Picked player) slot status) Equal to Is playing
-
Then - Actions
- Player Group - Add (Picked player) to PlayerGroup
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Game - Display to (All players) the text: Got here
- Unit Group - Add Hero A <gen> to RandomHero
- Unit Group - Add Hero B <gen> to RandomHero
- Unit Group - Add Hero C <gen> to RandomHero
-
Unit Group - Pick every unit in (Random 1 units from RandomHero) and do (Actions)
-
Loop - Actions
- Unit - Change ownership of (Picked unit) to (Random player from PlayerGroup) and Change color
-
Loop - Actions
- Trigger - Turn off (This trigger)
-
Events
Thanks for any help at all! Will definitely +rep!