cordac's Recent Forum Activity

  • Although I'm pretty sure you aren't using the smartest way to get to where you want to be the easiest way to do this in the way you've set things up would be:

    set text : choose(text1,text2,text3)

    You might want to take a look at the dictionary object, the array object, things like the expression tokenat() and other text expressions, though if you are going to have that much changeing text in your project, though..

    But the problem in my situation is the number of all the variables.

    The simpliest way to do it would be something like this:

    if(randomized_number==1) final_text=text1;

    if(randomized_number==2) final_text=text2;

    ...and so on.

    I'm trying to do sth more like that:

    if(randomized_number==number) final_text=textnumber;

    I'm struggling to figure out how, though.

    EDIT:

    ....but actually your way works fine. Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Let's say I have some text variables named for example text1, text2, text3.

    I pick a random number out of these three. Number 2 would mean that text2 was chosen. Now, how do I assign the text of text2 (using randomly chosen number) to another variable?

    I'm facing tons of such variables, so a simple switch won't do.

cordac's avatar

cordac

Member since 6 Jun, 2015

None one is following cordac yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies