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!
Add all heroes to an intiger array and randomy select one and create it for a player while setting that index (layer) in boolean array to true. Repeate for the other players and if that layer (index) is true in the boolean it moves onto the next. Not truely random but random enough.
could u perhaps try and do something yourself, rather than just asking for a system to be done and then get an explanantion and still not attempt to do anything maybe rather than being super lazy and waiting around for an answer you could attempt DSG's recommendation
With a Unit Type array called RandomHeroes, this is the easiest way.
Initialization
Events
Map Initialization
Conditions
Actions
Set RandomHeroes[0] = Paladin
Set RandomHeroes[1] = Mountain King
Set RandomHeroes[2] = Blood Mage
Set RandomHeroes[3] = Archmage
(so on)
Random Hero
Events
Your Event Here
Conditions
Your Conditions Here
Actions
Unit - Create 1 RandomHeroes[(Random Integer Number between 0 and (the highest number you used in your array))] for (player) at (point) facing (degrees)
initialization: you need 3 global variables: RandomHeroes array (see above, make it 1-based), integer RandomMax (initialy set to 15 or how many heroes you have at start) and integer array RandomIndex[1..Max]. use a for-loop to set RandomIndex[a] to a (so that RandomIndex[3]==3, RandomIndex[4]==4 and so on)
now:
Actions
Set R = (Random Integer Number between 1 and RandomMax)
Unit - Create 1 RandomHeroes[RandomIndex[R]] for someplayer at wherever facing whatever
Set RandomIndex[R] = RandomIndex[RandomMax]
Set RandomMax = RandomMax -1
If RandomMax == 0
Then - Actions
we ran out of heroes (for next time; no error here).
do something to disable further selection...
there. every index (every number from 1 to max) can be selected only once because after that, we take the one from the end and put it in place of the selected element. simple.
When programing games in BB i found that you cant make true random things.
The triggers are Pro Random witch means that there is some sort of pattern.
you might make it so the player dose something to help generate the hero and miz them up for each player (like red kills blue so green get blood mage)
i tryed the way you showed here .. but it still doesnt create me a random hero .. the first time it gave me random heroes .. but all the time the same heroes ... i mean ... every time i had hero X and player 2 hero Y but never both the same hero ... and the second time i tried and nothing apeard .. could you please post a full triger bassed system ? i'm trying with 10 heroes for start ... please help me smbdy .. .ty
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.