mcopeland's Recent Forum Activity

  • Thank you! Great suggestions. Subevents did it. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am brand new to Construct 2 (been using it since Friday). I'm having a heck of a time getting if-then statements to work. The simple version:

    -I'm in a repeat loop that goes to 5.

    -Each time through the loop, I am randomly assigning a number between 1 and 15 to the variable 'Pick'.

    -I want to assign the contents of 'Pick' to one of 5 text fields. The text fields are labeled B1, B2, B3, B4, B5.

    -Each time through the loop, I want to detect what the loop index # is and assign 'Pick' to a specific field. So if the loopindex = 1, I would assign Pick to B1. If loopindex = 2, I would assign Pick to B2, etc...

    If I was writing this in other scripting languages, I would write something like this:

    if (loopindex == 1) then

    B1.text = Pick;

    if (loopindex == 2) then

    B2.text = Pick;

    Basically, an if-then, with no 'else'. But, from what I can tell, the conditional statements in Construct 2 keep forcing me to add an 'else' to it (really frustrated with this). So, when I'm in the loop, I put in an action to set the B1 text to:

    loopindex = 1 ? Pick : ""

    However, when loopindex doesn't equal 1, it obviously erases what is in B1. How do I not put something after the colon? Is there a 'null' or 'do nothing' command I can put there (couldn't find find one)?

    Thanks in advance for any help!

    -Matt

mcopeland's avatar

mcopeland

Member since 4 Nov, 2014

None one is following mcopeland yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies