How do I prevent random picks choosing last created?

Get help using Construct 2

Post » Wed Apr 23, 2014 5:37 pm

Image

I have an object (thought) which spawns multiple copies.
I want these to start destroying these at random (via the fade-out) as you can see above.

My problem is that when using 'pick random instance' the engine will only choose the most recently generated instances. Whilst that's okay sometimes, at the moment it's working on a last-in-first-out basis, rather than random!

When using the 'pick instance using IID' (using the generated 'temp' value), for some reason none of them get picked and none of them get destroyed.

So how could I actually pick an instance at random? Is there something wrong with the order of logic above?

Hope that all makes sense.

Many thanks in advance!
B
6
S
2
Posts: 56
Reputation: 616

Post » Wed Apr 23, 2014 5:50 pm

I think I know why it's not happening as you intend.... (I'm a bit max'd by the color scheme ;) ) As you have it, in the last condition group C2 is only considering the one thought object that was last created. So, just add a system 'Pick All - thought' at the top of that condition group. That will ensure C2 will pick from all of the thought objects that meet the subsequent conditions.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832

Post » Fri Apr 25, 2014 1:00 pm

That's great @colludium! That worked.

It's been bugging me for ages and I couldn't work out why it was happening. I'll keep the pick system in mind in future.

Thanks again!

BTW, the colour scheme is like that because other programs like Virtual Studio etc. are easier to use for long periods of time with those colours schemes. They don't hurt your eyes as much as 'bright' colour schemes.
B
6
S
2
Posts: 56
Reputation: 616

Post » Fri Apr 25, 2014 1:13 pm

@Psynaptik - glad it worked. I tried to emulate that color scheme a while ago but perhaps my aging eyes need the higher contrast of the standard scheme!
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,205
Reputation: 43,832


Return to How do I....?

Who is online

Users browsing this forum: DharmaOne and 19 guests