Page 1 of 1

Time Expressions

PostPosted: Wed Nov 19, 2014 3:05 pm
by Nesteris
@Ashley
I wanted to PM you about this but I didn't find a PM button.

Anyway, I'm working on a game and I have a Time Attack Mode in which I want the camera scroll to speed up at time goes on, but if I use the "time" or "wallclocktime" expression its the total time the entire game has been running, I just want the time since the layout started, so it goes back to zero when the layout restarts. I checked the Layout and Time Sections in System Expressions and can't find them.

Is there a "Layout Time" or "Local Time" expression in Construct2? Or maybe a way to find the time since the layout has started (that resets along with the layout when the layout resets)?

Re: Time Expressions

PostPosted: Wed Nov 19, 2014 3:27 pm
by hundredfold
Hi Nesteris. You could set a counter variable and then increment it every second.

Re: Time Expressions

PostPosted: Wed Nov 19, 2014 3:34 pm
by Aphrodite
The way to do it is to set a variable (lets call it begintime) to the Time system expression At the start of the layout

Then you just measure the difference (time - begintime) to have the current layout time, in seconds.

Re: Time Expressions

PostPosted: Wed Nov 19, 2014 3:38 pm
by Nesteris
@Aphrodite
Thanks I'll use that!

Edit - Works perfectly, thanks!

Re: Time Expressions

PostPosted: Wed Nov 19, 2014 5:04 pm
by hundredfold
Thanks Aphrodite, that's a better way to go. I haven't used the time system expression yet. I'll check that out.

Re: Time Expressions

PostPosted: Wed Nov 19, 2014 6:43 pm
by Ashley
Thanks for also perfectly demonstrating why I have disabled my PMs. Loads of people can help you here on the forum! When I had them enabled I was inundated with private support requests which could easily have been answered by someone else on the forum. You don't even really need to tag me for this kind of thing.

Re: Time Expressions

PostPosted: Thu Nov 20, 2014 12:04 am
by Nesteris
@Ashley
Thanks? Lol At least I can be the poster boy for all the new users so they know what mistakes not to make :P
Good to be helpful in some capacity.