How do I pause code execution

Get help using Construct 2

Post » Wed Aug 20, 2014 11:25 am

Hi guys,

Is there a way to completely pause the execution of code for a certain amount of time unlike the 'pause' action which causes other sub-events to continue to execute?

Thanks in advance!
Mega Game Studios is a tiny independent game studio run from our apartment in Melbourne, Australia. We're not quite sure what we do yet but we think it has something to do with apps, board games and plush toys.

www.megagamestudios.com
B
18
S
7
G
3
Posts: 85
Reputation: 2,920

Post » Wed Aug 20, 2014 11:33 am

You could put the code in a group and deactivate the group for the pause-time..
or ofcourse use variables and use them as condition..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Aug 20, 2014 11:50 am

Hmm interesting.

If I pause and deactivate the group, will the code continue executing where it left off when I unpause and reactivate the group again?

variables as conditions could get tricky since I need to pause the game for about 0.5 seconds in the middle of several loops.

Thanks for the quick reply!
Mega Game Studios is a tiny independent game studio run from our apartment in Melbourne, Australia. We're not quite sure what we do yet but we think it has something to do with apps, board games and plush toys.

www.megagamestudios.com
B
18
S
7
G
3
Posts: 85
Reputation: 2,920

Post » Wed Aug 20, 2014 1:14 pm

Events sheet are read top from bottom. So the tick you activate again your group, the whole group actions will be executed starting with the very first on top.

Perhaps you also want to have a look at the new "Wait for signal" system action that will allow you to only have a certain event run when a certain tag/signal is used/sent.

It sounds like you have an issue in your events organising and you should detail precisely what you're looking to achieve and provide/attach a capx so that we can help you "cut" and organise the events in the most efficient way.
Without your project to ponder about, it's guesses and shots in the dark.

I hope this helps.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86 and 8 guests