How do I reset every x seconds when the layout start

Just started using Construct 2? Post your questions here

Post » Sun Nov 02, 2014 5:10 am

Hi, Every X seconds keep running after i change to other layouts and when I come back to that layout it is a mess. How could I make every X seconds start only when I start the layout?
B
3
Posts: 5
Reputation: 185

Post » Sun Nov 02, 2014 6:02 am

That's weird, it should always reset after every start of the event sheet.

I think sharing a screenshot would be effective so we can get a better idea of what the problem is.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Sun Nov 02, 2014 4:45 pm

Here is the screenshot of the every x seconds event.
Btw I'm really new to Construct 2 so I think it might be some trivial things that I forget :)
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 5
Reputation: 185

Post » Mon Nov 03, 2014 1:38 am

Haha no worries squaresmile, we've all been there....actually I might still be there!

Hmm...that's weird, it looks ok to me. Just want to check, but when you go to other layouts, do those layouts use the same variables and do they change the variables? If yes, than without resetting all the variables, they will carry the values forward. Try adding a reset global variables on the start of layout and see if it fixes your problem.

Just a humble opinion, it might be a good idea to use a variable to start your game. For example, varS. On start of layout, wait 1 second than set varS to 1. Than for all the other events, put them as a sub event to the event if varS = 1. You have more control over it and allows you much more leeway later if you want to make changes to when the game should start. Doing this should also resolve your problem if you are still facing it.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Mon Nov 03, 2014 3:36 am

Am I doing it right because it doesn't resolve my problems.
My other layout is only a start layout with a start button and high score and doesn't use any variable.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 5
Reputation: 185

Post » Mon Nov 03, 2014 7:10 am

Ok that's weird. So even with these, each time you go to another layout, and than return, everything is messed up still? I see you are using two event sheets so the game events sheet should reset each time you enter the game layout.

If you are willing to share your capx, I will quickly take a look and see what I can do. If not, I will try to recreate this, but might take some time.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Mon Nov 03, 2014 3:45 pm

This is my game Thanks for taking a look. I want every time I play like the first time which is the ball coming out slowly.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 5
Reputation: 185

Post » Mon Nov 03, 2014 4:16 pm

I am really sorry, I really can't seem to understand why we are getting some different results for the timing each time we restart. I will try taking a few cracks at it again to better understand. I think it must be something simple that I am missing.

In case you are in a hurry and it takes longer than I expected, I did edit your capx, and created a manual trigger. It has more lines of events though, but the game now works how you want it to.
https://www.dropbox.com/s/czmgik4fhl8i82j/my%20gameEdited.capx?dl=0
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Mon Nov 03, 2014 5:44 pm

Many thanks for fixing it for me. I'm fine with it now. You don't need to work more with my mess :)
B
3
Posts: 5
Reputation: 185

Post » Tue Nov 04, 2014 5:53 am

Haha ok, good luck on your game.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests