Time Scale and Wait help please

Discussion and feedback on Construct 2

Post » Tue Jul 16, 2013 5:16 pm

Hi,
I am trying to get some dialogue in my game that pauses the game while it is being displayed, here is the code:


It pauses the game by using "Set time scale to 0" and it correctly displays the first dialogue part. Unfortunately it then stops at the wait statement and never goes on to the next line, despite my having set the time scale of the dialogue text box (which triggers the event) to 1.

I assume therefore that the Wait statement must be system specific (IE linked to the global timer) rather than event or object specific.

So my questions are 1) Is this expected behavior? and 2) Any ideas how to make this work as expected?

Cheers.RattyRat2013-07-16 17:17:46
B
15
S
4
Posts: 33
Reputation: 2,347

Post » Tue Jul 16, 2013 5:43 pm

Hi @RattyRat,

You're experiencing problems because you've added the wait action after setting the timescale to zero.

Setting the timescale to zero is like stopping the clock, so the system cannot measure the 2 second wait action, because the clock has stopped.

You can set each individual items/objects timescales to zero, so you could try that instead.

Hope that helps you to understand your problem a little better.
Blacksmith2013-07-16 17:46:26
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Tue Jul 16, 2013 5:49 pm

Alternatively rely on the wallclocktime system expression, which still increments at 100% timescale regardless of what the game timescale is.
Scirra Founder
B
383
S
225
G
86
Posts: 24,119
Reputation: 190,546

Post » Tue Jul 16, 2013 6:01 pm

Blacksmith - Thanks, I had realised that but had thought that setting the objects timer back to 1 might have fixed it.

Ashley - Cheers - that helped me fix it, I now set a global variable called dialogtimer to wallclocktime + 120 in the above event, then have a second event that checks for wallclocktime >= dialogtimer and adds one to the DialogueID when it does.

Thank you both for the swift replies, much appreciated.
RR.
B
15
S
4
Posts: 33
Reputation: 2,347


Return to Construct 2 General

Who is online

Users browsing this forum: plinkie and 8 guests