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

0 favourites
  • 7 posts
From the Asset Store
In this template the music plays without looping in your game
  • 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.

  • Do a search on RandomArray.

  • 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:

  • .

  • blackhornet Amazing thanks! I really appreciate you taking the time to make an example like that. I'll add that to my project immediately

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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:

    This does work:

    Capx:

    https://drive.google.com/file/d/0B-5Zgs_yQiBiYV9zN1lxcnljRzQ/view?usp=sharing

  • You want AND not OR in event 2. More comments in CAPX.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)