Clever Choose

Get help using Construct 2

Post » Sun Oct 21, 2012 5:58 pm

With the Choose("1","2","3") Command, is it possible to set it up so that it never repeats the same thing multiple times in a row?
B
41
S
12
G
8
Posts: 598
Reputation: 7,194

Post » Sun Oct 21, 2012 7:32 pm

You could do something like this:

every tick
   set oldval to var
   set var to Choose("1","2","3")

while
var=oldval
   set var to Choose("1","2","3")



You could also do the following:
variable choices="1,2,3,"
variable value="1"

set value to tokenat(replace(choices, value & ",", ""),int(random(tokencount(choices,",")-2)),",")
B
85
S
27
G
84
Posts: 5,060
Reputation: 57,354


Return to How do I....?

Who is online

Users browsing this forum: DJKeefy, Lordshiva1948, Momio, NgTrent, oddreal and 10 guests