Pick random Instance

Get help using Construct 2

Post » Tue Feb 10, 2015 10:01 pm

Hi
I spawn a family with 4 objects randomly = 40
I have a counter to count each object (Slice1,Slice2,Slice3,Slice4)

BUT I only want to have 2 of Slice4
So when my Counts of Slice4 > 2 random spawn (Slice1,Slice2,Slice3)

How can I do that

Cheers
B
28
S
15
G
10
Posts: 338
Reputation: 7,837

Post » Tue Feb 10, 2015 11:12 pm

Image

Something like this should work, although it may not be ideal because of its reliance on two families, one with 4 and one without.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388

Post » Tue Feb 10, 2015 11:29 pm

Ohh... Could I please try out your capx.

:-)
B
28
S
15
G
10
Posts: 338
Reputation: 7,837

Post » Wed Feb 11, 2015 12:51 am

I didn't save it sorry. It was just 4 coloured boxes. Two groups, one which had sprites 1-4 and another which had sprites 1-3. Then what you see in the screenshot is all I did.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388

Post » Wed Feb 11, 2015 3:09 pm

Okay ..

So I tried to do your way but cant set the

> spritew4 > ID = 4


Hope you will ive it a go .. here is capx
RandomSpritesControlled.capx
You do not have the required permissions to view the files attached to this post.
B
28
S
15
G
10
Posts: 338
Reputation: 7,837


Return to How do I....?

Who is online

Users browsing this forum: lucstanislash, RetroSpock and 11 guests