Hi. I am trying to figure out how to make 1 attack wave out of 3 be randomly chosen and that chosen attack wave to have additional units added to it through the If Then Else :action inside each of the 3 attack waves. I dont know how to make this Random Integer work exactly but I need it to work multiple times producing random results. What and where do I need to link to this Random Integer to for the If Then Else action to work?
I got something working but it does not work as desired. I thought that running a while loop trigger would make the Variable reset its value and produce a random value from 1 to 3 every time the trigger loops but it appears that is not the case. It appears that the Variable selects a value from 1 to 3 and then it set in stone. I guess I got to make more variables as random integers to implement a random selection among the three attack waves. Would this be the right way to go about this?
Also out of the eight times that I tested the randomization process. It has chosen 3 six times, 1 twice and the number 2 never has been selected. Now this is just eight test I've done so far not really a big number. If this trend continues. I will make a post on it.
I finally got my trigger to work as desired. I got rid of the While loop trigger and went back to step one which was the Random Integer variable as describe in that Thread above and I made it in to an array. Making it in to an array did the trick.
X=RandomInteger=(Randomintegerbetween1and3)<Integer[4]>TriggerMeleeInitializationEventsGame-MapinitializationLocalVariablesConditionsActionsTrigger-RunProtossWave1GDown(CheckConditions,Don't Wait until it finishes)Trigger-RunProtossWave1GLeft(CheckConditions,Don't Wait until it finishes)Trigger-RunProtossWave1GRight(CheckConditions,Don't Wait until it finishes)Variable-SetRandomInteger[1]=(Randomintegerbetween1and3)Variable-SetRandomInteger[2]=(Randomintegerbetween1and3)Variable-SetRandomInteger[3]=(Randomintegerbetween1and3)Variable-SetRandomInteger[4]=(Randomintegerbetween1and3)ProtossWave1GRightEventsLocalVariablesConditionsActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfRandomInteger[1]==1Thenaddadditionalunitstoattackwave
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi. I am trying to figure out how to make 1 attack wave out of 3 be randomly chosen and that chosen attack wave to have additional units added to it through the If Then Else :action inside each of the 3 attack waves. I dont know how to make this Random Integer work exactly but I need it to work multiple times producing random results. What and where do I need to link to this Random Integer to for the If Then Else action to work?
Edit:Scratch that I Found it. If any problem comes up I will make a post about it. http://www.sc2mapster.com/forums/development/triggers/19577-pick-one-integer/#p3
I got something working but it does not work as desired. I thought that running a while loop trigger would make the Variable reset its value and produce a random value from 1 to 3 every time the trigger loops but it appears that is not the case. It appears that the Variable selects a value from 1 to 3 and then it set in stone. I guess I got to make more variables as random integers to implement a random selection among the three attack waves. Would this be the right way to go about this?
Also out of the eight times that I tested the randomization process. It has chosen 3 six times, 1 twice and the number 2 never has been selected. Now this is just eight test I've done so far not really a big number. If this trend continues. I will make a post on it.
I finally got my trigger to work as desired. I got rid of the While loop trigger and went back to step one which was the Random Integer variable as describe in that Thread above and I made it in to an array. Making it in to an array did the trick.