lets say i have... a integer with 7 arrays called:
int[0, int[1]...int[6]
how do i "pick" a random int[x] of these, without being able to pick the same int twice?
tempBoolean is type "Boolean" with initial value of False
tempBoolean2 is an Array with a size of 7 and of type "Boolean" with initial value of False.
RandomInt is type "Integer" with initial value of 0
Trigger:
Custom script: loop
Custom script: exitwhen (udg_tempBoolean == true)
Set RandomInt = (Random integer number between 0 and 6)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
tempBoolean2[RandomInt] Equal to False
Then - Actions
Custom script: set udg_tempBoolean = true
Set tempBoolean2[RandomInt] = True
Else - Actions
Custom script: endloop
This was done free hand, if you'd like to know where to put your actions at to make this work for your game, feel free to PM me. And I'll make it look neater. (I'll make it JASS too.)
yes thats right, its just picking one and setting the last int in this list to this position. kind of permutation i think.
the example by failenx just picks a random slot until it hits a free slot. that can work, but it could also go horribly wrong, remember the random numbers in warcraft III are not really random...
well i dont think i have to make a jass example, the code is not too complicated and you can learn by doing
I'm on a page about incorrect corrections, and spent the better part of like two hours trying to get someone to understand that -5^2 = -25, not 25, and then that post had comments get reposted because that group is self sustaining, and that person was in turn trying to explain what I just explained to them. And I'm taking that as a victory
I will be AFK for a couple of days you guys hold down the fort while I am gone. I will be checking in on my phone but that will severly limit me. Be back saturday!
I just got to watch the video because even though I was there I was trying to work out tech problems with the chat since I was the social media guy so I was distracted but check it out guys the video is super fucking great!