A lot of AOS's use commands like -random to get a random hero, either becuase there's a benefit or because they're too lazy to pick their own. I was wondering how people actually did this. Someone mind telling?
I guess you could do something like:
When a person types -random, use the math - random function to pick a random number and then use a series of ifs to decide which hero to train based on that random number.
Fairly simple. Set all the heroes/hero types to an array, then select one with math - random int from 1 to X. Then proceed as normal for the map selection.
True, it's better then going through the long run, huh?
That's neat, but what if someone presses "?" when they mean that they're listening to someone or something? Or, what if they press that on accident? What if they got confused and put "?" ?
Then you just ad a sign thingy that pops up and says "are you sure you want to choose a random hero?" with the locigal choice of options "yes" or "no".