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
42
S
12
G
8
Posts: 600
Reputation: 7,223

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
88
S
30
G
89
Posts: 5,113
Reputation: 60,337


Return to How do I....?

Who is online

Users browsing this forum: alajajm and 9 guests