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!
How do I go about doing random between 1 and MyVar except it doesn't pick say 1 2 4 2 1 2 3 2 4 2, it would only be numbers that haven't been picked yet, then repeating again once all are picked.
Are you asking how to pick random numbers, but once a random number is picked, that picked number cannot be picked again? Like taking cards out of a deck?
Are you asking how to pick random random numbers, but once a random number is picked, that picked number cannot be picked again? Like taking cards out of a deck?
Use a static array and a dynamic array. That's what I do in iPool. Or you can just use iPool and remove the value once the value is randomly picked. IPool you can find in my vJass resources in my signature.
To make what you want in GUI, you would start with this template:
Init Array
Events
Map Initialization
Conditions
Actions
Set ArrayValue[0] = 1
Set ArrayValue[1] = 7
Set ArrayMax = 1 //the last index in the array
Trigger - Run Fill Stack from Array (ignoring conditions)
Fill Stack from Array
Events
Conditions
Actions
For each Integer A from 0 to ArrayMax, do
Loop - Actions
Set StackValue[StackCount] = ArrayValue[(Integer A)]
Set StackCount = (StackCount + 1)
Pop from Stack
Events
Conditions
Actions
Set StackCount = (StackCount - 1)
Set IntegerIndex = (Random integer number between 0 and StackCount)
Set IntegerValue = StackValue[IntegerIndex]
If - Multiple
If - Conditions
StackCount is Equal to 0
Then - Actions
Trigger - Run Fill Stack from Array (ignoring conditions)
Else - Actions
Set StackValue[IntegerIndex] = StackValue[StackCount]
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.