Start Splash Layout..

Get help using Construct 2

Post » Wed Dec 19, 2012 2:35 am

That just doesn't sound like correct behavior from the engine. I'd be curious to see your events, too, just to see what's going on. I've never had behavior like that out of my games.

And a .capx is the file extension for C2 files. On File>Save As ... You can choose to save as an all-in-one file (project.capx for example), or as a project with resource folders. If you save it as a capx, then you can share that single file and there won't be any file dependency issues. If you prefer it otherwise, don't worry, you can re-save to either format at any ime. I hope that helps!
Posts: 962
Reputation: 17,996

Post » Thu Dec 27, 2012 4:39 am

Hey Guys,

I wanna thank everybody for all their help..
Here's an update, I have 2 "Every X Seconds" loops on my MAIN game layout.

When my game starts on my SPLASH layout, I added a TEXT field to display a message following a global variable to show me if either of these loops has actually executed. So I'm sure that these loops do not execute until the MAIN layout starts.

However, what is definitely happening is that the timer for this function "Every X Seconds" has started and, upon starting the MAIN layout, BOTH loops execute IMMEDIATELY,

These loops are set as follows - "Every Random(10,30) Seconds".
So, I would expect that, upon the START of my MAIN layout, that there would be a MINIMUM of 10 seconds before the loop would begin.
However, it appears that the loop timer has fired and waiting for the MAIN layout to START then it executes IMMEDIATELY.

SO, it is true that the loop does NOT execute until the MAIN layout starts, however, the timer does begin already.

Any ideas???
Posts: 58
Reputation: 916

Post » Fri Dec 28, 2012 2:47 am


I have isolated this problem thru adding conditional global variables which do indeed prevent the "Every X Seconds" loops from starting..

However, I can confirm now that the "Every X Seconds" loop timers
do count off regardless as to anything i have tried.

"Every Random(10,30) Seconds" loop includes a conditional global variable that prevents it from executing until a START GAME button on the SPLASH layout is clicked.

However, upon the MAIN game layout starting, there "should" be a minimum 10 seconds before the "Every Random(10,30) Seconds" loop begins.
This loop executes immediately upon the START of the MAIN game layout.
This tells me that the timer has gone off and is simply waiting for my additional variable to be SET to execute the loop itself.

So, my question has been revised..

Is there a way to prevent the "Every Random(10,30) Seconds" timer from starting ONLY when my MAIN game layout is activated???

I hope this all makes sense. I've been programming for many years and I am NEW to using "Construct 2" so the environment and it's quirks are still new to me...
Posts: 58
Reputation: 916

Post » Fri Dec 28, 2012 2:52 am

I'd use a timer variable for these cases when you want precision - I generally reserve 'every X seconds' for simple foolproof cases.

To use a timer variable, just add dt to it every tick and it will up one increment every second. Then you can reset this and compare it at your whimsy.

Welcome to C2!
Posts: 3,191
Reputation: 32,679

Post » Fri Dec 28, 2012 5:37 pm

I will post my events sheet for each layout and hope I can find a solution..

Basically, I've had to add global variables to keep my MAIN game layout from executing. This works for now, but, I do want to solve this at some point..

Thank you for all the help :)
Posts: 58
Reputation: 916

Post » Sun Jan 06, 2013 4:53 pm

Ok guys,

Sorry it's taken me so long to get my act together here at Construct2.
Every programming language and environment seems to has it's own unique
quirks and eccentricities.

Anyway, here is my "For X Seconds" loop. It uses a random timer which
goes off and my character throws an object. My problem remains that the "For X Seconds" timer appears to be going off while my SPLASH layout is being viewed. When a use clicks the START GAME button and my main GAME layout displays this "For X Seconds" loop has already executed.

UPDATE: Since I'm new to C2, I finally got around to exporting my game to the actual HTML5 web files and I noticed that my Main Game layout is called "sheet0", and since I created my SPLASH layout afterward, it is called "sheet1".. I don't know if this matters...
Posts: 58
Reputation: 916


Return to How do I....?

Who is online

Users browsing this forum: luckyrawatlucky, nahima and 8 guests