Time Expressions

Discussion and feedback on Construct 2

Post » Wed Nov 19, 2014 3:05 pm

@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)?
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Wed Nov 19, 2014 3:27 pm

Hi Nesteris. You could set a counter variable and then increment it every second.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Wed Nov 19, 2014 3:34 pm

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.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Wed Nov 19, 2014 3:38 pm

@Aphrodite
Thanks I'll use that!

Edit - Works perfectly, thanks!
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Wed Nov 19, 2014 5:04 pm

Thanks Aphrodite, that's a better way to go. I haven't used the time system expression yet. I'll check that out.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Wed Nov 19, 2014 6:43 pm

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.
Scirra Founder
B
397
S
236
G
88
Posts: 24,392
Reputation: 194,454

Post » Thu Nov 20, 2014 12:04 am

@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.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925


Return to Construct 2 General

Who is online

Users browsing this forum: mickeyboy and 12 guests