Trouble with random text generation and click-sequence game

0 favourites
  • 6 posts
From the Asset Store
Template for dungeon/maze generation, using wave function collapse
  • Hello friends,

    I'm trying to build the foundation for a learning game with this functionality.

    1. Separate text blocks are generated from an array, and randomly placed around the layout.
    2. The separate text blocks when taken as a whole create obvious sequences (e.g. 1,2,3, etc. or A,B,C, etc.)
    3. The user must click each one in the correct sequence to win.

    I seem to have parts 1 and 2 working, though perhaps not in the most proper way, I don't know. But I'm hung up on step 3. I know how to do this "click the items in order" functionality in a vacuum, but when combined with the random generation of the text from an array I can't get it working.

    I'd greatly appreciate any guidance. Here is the project file.

    dropbox.com/s/zvtgavehvezvgiy/Ordering%20texts%20arrays.c3p

    Many thanks!

  • Set listposition to array.at(loopindex+1) is a string, the data in the array, shouldn't that just be loopindex if I'm understanding it correctly.

    The other bug is the last event because it is 0 to start with it is already triggering and restarting the layout constantly. You can run that event elsewhere like after the text object being pressed you can add it in there as a sub event to check if there are now 0 objects remaining.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Lionz for the input. This helped with the second problem of the win action happening all the time, but the main mechanic still doesn't work.

    I am continuing to work with it, but I feel like I'm going in circles. I suspect that something is wrong with the list positions, but I can't check them since they are generated only when the program runs.

  • Did you change it to loopindex as I mentioned because it works for me. You can run the project in debug view, there you can see the variables and such for each instance.

  • Did you change it to loopindex as I mentioned because it works for me. You can run the project in debug view, there you can see the variables and such for each instance.

    Sorry, I see you meant just loopindex and nothing else. I was just removing the +1 but keeping the array.At.

    Yes, it does work! Wow, I'm encouraged and frankly amazed that I was so close otherwise. This was way over my head and my real current ability level, so I'm actually thrilled that my overall approach was valid except for this part.

    Thanks a lot for your help! Much appreciated.

  • Yes it was correct except the array.at is looking for data inside the array but you wanted the position or index of the array, in this case the loopindex, but you have the right idea yep nice one :)

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