Make an action run only once?

  • I've been searching the forum but can't find a simple answer for this problem I'm having.

    rm.inmobi.com/na/00_PLAYABLES/Chris_07/index.html

    I need to make the first two question mark icons (just above the topics) change to match what a user selected. This is my Event Sheet:

    postimg.org/image/3ng6xc963

    It's obvious that the first set of actions keeps firing because the turn variable gets changed on turn 2 but I can't make the first set trigger once then stop. I tried "trigger once" but it didn't work. Any help would be appreciated!

  • The issue isn't really about it running once, more that it's just not keeping the values because 'turns' changes and it looks like you are restarting the layout? You could do something like create a bunch of global variables for the questions i.e Q1, Q2, Q3. and then set Q1 to 0 by default, 1 if correct or 2 if wrong. Then you could say for ico1 set animation frame to Q1, for ico 2 set animation frame to Q2. So it will be 0 at the start (an X) then if you get Q1 correct it will set animation frame to 1, if Q 2 is wrong, it sets animation frame to 2 etc, using example animation frames. There are loads of ways you can do this.

  • Thank-you Plinkie! I will try that.

    Update: didn't work because the right/wrong variable always changes the first icon after second question is answered.

    I thought that when you had two conditions together - then ONLY those two would affect the action. Clearly thats not the case here?

    See my updated Event Sheet. I have a unique/separate Global Variable for the first time a user plays (turn1)

    rm.inmobi.com/na/00_PLAYABLES/Chris_07/index.html

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If turn1 always = 1 then changes to right_wrong variable when answering question 2 will affect question 1.

  • [quote:u6ysmwmp]If turn1 always = 1 then changes to right_wrong variable when answering question 2 will affect question 1.

    I didn't realize it was changing - I thought Construct was looking at those 2 items as 2 conditions that had to be met in order to trigger the action.

  • In each event yes both conditions have to be met, it looks like both the turns variables are always true but I can't see the rest of your logic. It's an easy fix, rework the logic like I mentioned in first response or feel free to send over C3 file so I can edit it.

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