0 Favourites

How do I choose(several numbers from(1,2,3,4,5,6,24)

  • Dear community,

    I have created two buttons "question1" and "question2"

    I have also a variable "exercice"

    When I click on button "question1"

    variable "exercice" sets value to: choose(1,2,3,etc,24)

    so I have one value to find;

    What I want to do (but don't have the expression for)

    When I click to Button "question2"

    variable "exercice" sets value to choose2values(1,2,3,4,etc24)

    Is it possible to choose xvalues from () ?

    Thank you for your help,

    Stéphane

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You could use the system condition "repeat"

    on button "question2" clicked

    repeat 2 times

    add to variable "exercice" choose(1,2,3) etc.

    Depending on if the variable is a string or a number will get different results, eg if 1 and 3 is chosen in a string variable it will appear as "13", in a value it will add them together 1+3 = 4.

    If it's a string variable and you want to keep the numbers separate you can add a token eg, add to variable "exercice" choose(1,2,3)&"," so it will appear as "1,3," in the variable. You can then use the token system expressions later to manipulate them further.

  • If you're looking for 2 different choices on question 2 you could just use choose twice and store the second result in another variable. Then you can condition out for it to choose until choice 2 /= choice 1 variable.

  • Hey, thanks for your reply, Ethan and Chrisinfinger !

    I want a question with two numbers: ex 1 and 5, with answer that is 1 and 5 (not 6)

    So for now, I use 2 variables(1 and 2) when I click on the button question, it picks 2 numbers

    and for the answer, I've created another variable3 that is set to (variable1+2) that is compared to the solution text box

    Well... that's not very light, but it works !

    Btw this is for a solfege piano game

  • Literally choose(0,1,2,3,5)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
59 41,212
untune's avatar
untune
Unread hot topic
99 10,137
karshinkoff's avatar
karshinkoff
Unread hot topic
0 Favourites
Ludum Dare 24
25 2,650
PixelMonkey's avatar
PixelMonkey