• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

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