Choose(1,2,3,...) without duplicates and restart when done.

Get help using Construct 2

Post » Sun Feb 22, 2015 9:57 pm

Hello there.

Been trying to figure this out on my own for days now but I just can't. So hope someone here can put me in the right direction.
This is my setup:

Globalvariable 'layoutsdone' = (counts how many layouts you have cleared, gets +1 everytime you leave a layout)

Now I have whenever the player leaves a layout he goes to Choose(layout1,layout2,layout3,layout4) But right now is goes like this:
In order: layout1, layout2, layout2, layout3. And multiple other ways I don't want it to go.
How I want it:
in order: Layout2, Layout1,Layout4,layout3. or Layout4, Layout1, Layout3, Layout4. Or any other way, I just don't want any duplicate Layouts in the same run.
However when all the layouts have been had, and there are no unique ones left. I just want it to restart.

I also said I count the amount of layouts cleared with the global variable 'Layoutsdone'.
When 'Layoutsdone' =10 or 20 or 30 or 40. I want it to go to Layout5. After layout 5 I just want it to continue where it left off.

I hope I made clear what I want to achieve and someone can help me out.

PS: I looked at this tutorial but don't know if it can be of any use. https://www.scirra.com/tutorials/315/ge ... duplicates
I found this plugin. plugin-pattern-gen_t75255 but also don't know if I can use it in my case.
B
8
S
4
Posts: 120
Reputation: 1,266

Post » Sun Feb 22, 2015 10:08 pm

Do a search on RandomArray.
ImageImageImage
B
71
S
19
G
165
Posts: 3,425
Reputation: 95,561

Post » Mon Feb 23, 2015 1:13 am

I just did and found multiple capx that where based on handling cards. How would I go about and put the output of the array to the layout I have to go to?
I myself came up with this, But this will take a lot of events, and will just be very messy, but it should work:
Image
B
8
S
4
Posts: 120
Reputation: 1,266

Post » Mon Feb 23, 2015 2:08 am

.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
19
G
165
Posts: 3,425
Reputation: 95,561

Post » Mon Feb 23, 2015 2:24 am

@blackhornet Amazing thanks! I really appreciate you taking the time to make an example like that. I'll add that to my project immediately
B
8
S
4
Posts: 120
Reputation: 1,266

Post » Tue Feb 24, 2015 12:10 pm

So I got around and played a little with it, but again I'm struggling.
I tried to include an exception, when your going the the second layout and when you go to the third layout you go to a specific layout. However it only works with one of these.
This doesnt work:
Image

This does work:
Image

Capx:
https://drive.google.com/file/d/0B-5Zgs_yQiBiYV9zN1lxcnljRzQ/view?usp=sharing
B
8
S
4
Posts: 120
Reputation: 1,266

Post » Tue Feb 24, 2015 5:45 pm

You want AND not OR in event 2. More comments in CAPX.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
19
G
165
Posts: 3,425
Reputation: 95,561


Return to How do I....?

Who is online

Users browsing this forum: Mayfly and 7 guests