Can I use choose without repeat?

0 favourites
  • 11 posts
From the Asset Store
In this template the music plays without looping in your game
  • I know there are many asked/answered posts on non-repeating randomness, but they all seem to involve arrays. Is it possible with simple choose statements?

    choose ("red","yellow","blue"), etc.

    e.g. serve all items randomly, without repeat, once all have been served, do it again, forever)? I'm using choose a lot. Am I just out luck because choose is too simple a framework in which to have non-repeating behavior?

    Many thanks for any assistance.

    Tagged:

  • 1. You need Permutation Table feature of the AdvancedRandom plugin. See this demo:

    howtoconstructdemos.com/display-random-images-without-repetition

    Instead of the sprite frame you can pick an entry in an array, or a token in a string.

  • 1. You need Permutation Table feature of the AdvancedRandom plugin. See this demo:

    https://howtoconstructdemos.com/display-random-images-without-repetition/

    Instead of the sprite frame you can pick an entry in an array, or a token in a string.

    Thanks, I have now gotten it to work with text in a small sample project but it's proving too difficult for me to integrate it into existing projects that are complex. I will keep trying.

  • Here is how you use it with a list of words

  • Here is how you use it with a list of words

    Thanks very much! I can see what I was doing wrong now. This is very helpful.

  • This is how I'm making it "loop" per se. Do you think this is the best method? It seems to work well.

  • Event 4 is running on every tick, which is not great.

    Select event 3 and press X to add an "Else" condition - you should re-initialize permutation table there.

    Also, I made a mistake in my screenshot - "Add 1" action should go after the "Set text".

  • Event 4 is running on every tick, which is not great.

    Select event 3 and press X to add an "Else" condition - you should re-initialize permutation table there.

    Also, I made a mistake in my screenshot - "Add 1" action should go after the "Set text".

    I'm trying to understand how to have two lists feed into one text box - both triggered by the same action - and to repeat both forever even if they are of different lengths.

    So a three item list cycles twice during the same time as a six item list (but they wouldn't need to be multiples/factors of each other. Each list could be any number of items).

    Here's my perhaps closest attempt.

    dropbox.com/s/0fz1ywbzyjkbqca/Permutation%20two%20lists.c3p

    So in this example project file above (with two lists: [a,b,c] and [1,2,3,4,5,6]), six button clicks would return something like:

    a 3

    c 4

    b 1

    c 6

    a 5

    b 2

    ... and the next six different, forever.

    I've spent about six hours so far and I haven't gotten it so I'm going to reach out. Many thanks for any assistance! I really appreciate it.

  • Permutation is like shuffling a deck of cards. You need to do it once before you deal the cards, not while dealing each card.

    Looks like only one permutation table is supported at a time. So if you need two lists with non-repeating values, you would probably have to use an array. Create a permutation table for letters, copy them in random order into the array one by one in a loop. Then create/reshuffle the table for numbers, copy them into the same array.

    There may be an easier way to do this, if you could explain what you are trying to make.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Permutation is like shuffling a deck of cards. You need to do it once before you deal the cards, not while dealing each card.

    Looks like only one permutation table is supported at a time. So if you need two lists with non-repeating values, you would probably have to use an array. Create a permutation table for letters, copy them in random order into the array one by one in a loop. Then create/reshuffle the table for numbers, copy them into the same array.

    There may be an easier way to do this, if you could explain what you are trying to make.

    Thank you for the feedback. It's a bummer that only one table is supported at a time. More a bummer that there isn't built-in/default non-repeating behavior in the software. I can't imagine any users would want repeating behavior as opposed to non-repeating.

  • I need repeating random much more often than non-repeating.

    But it would be quite useful to have multiple permutation tables, under different tags. Similar to how we can create multiple probability tables.

    Nepeo Do you think it's possible?

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