Let's say I had a fighting game where 1 guy is controlled by you and the other guy is controlled by the computer. If the computer-controlled character had more than 2 different attacks, how would I be able to make the attack a random choice out of those attacks?
Offline
If (Random from 1 to 10) > 5
Set AttackMode = 1
Else
Set AttackMode = 2
"AttackMode" could be a variable that you set, as shown, or it could be a broadcast. You could make one attack type more likely by changing the number that you compare the random number to.
If (Random from 1 to 10) > 8 would not be "true" very often, and attackmode1 would be favored.
Does that help?
-MrEd
Offline