Select a random action?

Get help using Construct 2

Post » Thu Oct 24, 2013 6:42 pm

Hello,

I've been working with C2 on a game and i want it to randomly choose an action every 2 seconds ... See the picture:



I know it isn't hard but i haven't discovered it yet ..
It'd be great if someone can help. :)

Cheers,
Hadzy Hayman
B
27
S
10
G
2
Posts: 237
Reputation: 3,330

Post » Thu Oct 24, 2013 7:01 pm

if you have the personal edition of construct you could put the objects in a family and just create the family..

if not, you need a variable , set it to int(random(0,3))

and make events to check the variable
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 24, 2013 7:10 pm

@LittleStain .. I don't have a personal edition :/
But i don't get the other part .. I've tried to do it but it becomes 0 (Both global variable and Instance variable) ..
Can you explain a bit further?
B
27
S
10
G
2
Posts: 237
Reputation: 3,330

Post » Thu Oct 24, 2013 7:27 pm

you can simply activate group A or B or C,
for example:

choose("A", "B")

B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Thu Oct 24, 2013 7:30 pm

like this:


https://www.dropbox.com/s/dsr4hxw59wua0n9/run%20random%20action.pngghost2013-10-24 19:31:15
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Thu Oct 24, 2013 7:37 pm

I don't think i am doing very good ..
I've done this:

But only the green ones appear .. What should i change?

EDIT : Oh @ghost .. I didn't see the image .. I will try.

ANOTHER EDIT : Thank you very much @ghost for the picture .. It's working perfectly.elafreat2013-10-24 19:49:34
B
27
S
10
G
2
Posts: 237
Reputation: 3,330


Return to How do I....?

Who is online

Users browsing this forum: KTML5 and 19 guests