• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Random & All Random idea needed

Status
Not open for further replies.
Level 22
Joined
Feb 3, 2009
Messages
3,292
Hello, so I'm trying to make modes -ar (all random) and -random (random hero).

The problem is that I don't know how to make it so if one hero is already picked or randomed, that it can't get picked and randomed again.

The simple way would be by putting all heroes somewhere in map and removing them when they're picked, but there must be a better way (reffering to dota).
 
or remove him from the pool and adjust the variables (something like recycling the index)... [that's what I saw from the old DotA template map]

doing it this way would ensure that there is no chance of randoming a picked hero, so you won't need to randomize again if ever the hero you randomized was already picked... (which is what you will do if you use the suggestion by Apoc, if the boolean is false, you randomize again)
 
Status
Not open for further replies.
Top