Trouble Learning Event Sheet Ordering

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • This will be very easy for you, I'm sure, but I'm having trouble with the following:

    What I'm trying to do is:

    1) Move a football icon across the field based on the NetGain variable (that's working fine in this random test setup)

    2) Update to show 1 for Down (textbox) and 10 for ToGo (textbox) if the random NetGain from the mouse click was greater than or equal to the ToGo variable (defaulted to 10).

    3) Similar to #2, but if the NetGain was less than ToGo, it would then add +1 to Down (variable) and subtract the NetGain from ToGo (variable).

    I'm guessing I just have a hierarchy issue or things tabbed in the wrong places.

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So... what's wrong?

    The event sheet runs from top to bottom. If actions in the first event make conditions in the second true, the second will run as well. Try using the "Else" condition instead.

  • Hey, sorry I don't seem to have notifications turned on for replies. Thank you for assisting me!

    I am exploring around a bit now with using else conditions, and while I understand the concept (and use them in other applications), mine always seem to be red/unreadable.

    I have read the tutorials a few times now, but the hierarchy of events is very confusing to me still.

    To use a simple example, how would I use an else condition for:

    If NetGain(v) is greater than or equal to ToGo(v), set ScoreboardDown(text) to 1 and ScoreboardToGo(text) to 10.

    //This basically just generates a new set of "1st and 10" for the team as they gained more than the yardage needed for a 1st down.//

    Else

    Subtract NetGain(v) from ToGo(v), set ScoreboardToGo(text) to ToGo(v).

    Add +1 to Down(v), set ScoreboardDown(text) to Down(v).

    If Down(v) is greater than 4, set ScoreboardDown(text) to 1 and ScoreboardToGo(text) to 10.

  • Here is a bit more detail of what I'm struggling with on these else statements:

    This image should change the down and distance from 1 and 10 to either 2nd and X (X being anything that is less than 10, in this case) or ELSE if the NetGain is greater than distance, it should reset down and distance back to 1 and 10.

    It should also reset to 1st and 10 (and switch directions aka which team has the ball) if down is greater than 4.

    Also, it will reset the ball to the 30 yard line if either team "scores," that is reaches one of these x positions that represent the position of my goalline.

    Above this the NetGain is being generated randomly.

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