LBramley1996's Recent Forum Activity

  • I've created a for loop as a sub-event when the function 'SetQuestions' is called. I've also included a local variable and added 1 to this after the question is set but it's still not changing the question.

    Is there a particular value I need to set the local variable to?

    The text is currently set to: tokenat(QuestionsArrayShuffled.At(loopindex),0,";") - is this something I also need to change?

  • I'm creating a multi-answer quiz game and after selecting the answer, I've set the game to call function 'SetQuestions' to show the next question. But for some reason it changes the question only once, so it's only showing a maximum of two questions. Any ideas why it won't change to questions 3,4,5 and so on?

    I've attached an image of the function, is there anything that needs to be changed?

  • Thanks so much for your help Lionz! I'VE DONE IT!!!

    Can't tell you how grateful I am for that, really appreciate it as I've been stuck on this for so long.

    This is how I've done it:

  • Wow! Thanks so much Lionz - I really appreciate your help.

    I'm almost there with it now but have a couple of questions:

    1. How do I pull the questions like you have done? I have 50 of them and they're stored in a text file. I am familiar setting at X of an array but have never used the 'pull' action like you have. I can't figure out how to populate the array using this method.

    2. I then tried setting at X of the array (as I'm familiar with this) and managed to populate it using a for loop and local variable number but when setting at X of the shuffled array using the formula given in your example - QuestionsArray.At(AdvancedRandom.Permutation(loopindex)), it randomised the order but there are quite a few empty gaps in the shuffled array, any idea why this could be?

  • Are you able to show me how this is done in events and actions? I tried so many ways before using the permutation table and couldn't get it to work properly.

    Sorry, I'm still new to using Construct and have no previous background of game dev.

  • I'm creating a quiz game and I need the questions to appear in random order and not repeat. I followed a tutorial on YouTube and the values appear randomly but so far they're just numbers. I have the questions in a text file, so I need to use this to populate the array but how do I do this? So far, the equation I've used - tokenat(AJAX.LastData,i,"|") only shows the questions in ascending order, not randomly. (For your reference, 'i' is a local variable and '|' is the separator in my questions file.

    I've been stuck on this about 2 weeks and no matter what I've tried it hasn't worked, so any advice would be amazing.

    I've attached an image of my events and actions - hopefully, this makes it clear to see where I'm going wrong.

  • OK thanks - I've had a look into permutation tables and they don't look too scary. Can you tell me how I pull the data from my array into the permutation table?

    Also, I've tried to select the answer button to turn green when the correct one is pressed using UID but all of them are turning green or red at the same time, depending on whether a right or wrong answer was selected. Can you tell me how I'd lay this out correctly in the event sheet, so only the correct answer turns green?

  • Thanks for this. I've managed to get the questions to appear in a random order, so there's no issues here but how do I get it to not repeat a question once it's been asked? I'm using an array to store the questions.

    Secondly, I understand how to get the button to set to green but how do I get the button to set to green on the correct answer? The function checks for the answer using the text object, not the button (sprite). I'm thinking maybe by comparing the Y of the text against the Y of the button but I'm not sure. Any ideas?

    Here's an image if it helps:

  • I'm creating a multi-answer quiz game and I'm stuck on a couple of things:

    1. I've used an array to store my questions and answers and have set the questions to appear on screen in a random order but some questions are repeating which I obviously do not want. Is there a way I can tell the array not to pick a question if it's already been used?

    2. When the user presses an answer, how do I get the correct one to turn green and the others to turn red?

    I've attached an image to show how the correct answer is chosen.

    I've been trying to do this for about a week and had no success, so any help would be amazing.

    Thanks.

  • You're good at this - it worked! Thanks so much! :)

  • Thanks a lot - I've done this and it worked but how do I stop the global variable going below 0? It makes the game glitch when it gets to 1 minute 30 seconds.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm creating a dodging game where the player must avoid red balls falling from the top and bottom of the layout. To start with the objects are created every 3 seconds but how do I set it so the object is created every 2 seconds after 30 seconds and then every 1 second after 1 minute to make it harder?

LBramley1996's avatar

LBramley1996

Member since 30 Jan, 2021

None one is following LBramley1996 yet!

Trophy Case

  • 3-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies