How do I only activate a condition on the 3rd attempt

Get help using Construct 2

Post » Sun Mar 16, 2014 5:18 pm

I have a series of events and sub events when the player dies before the game over/score screen shows. What I would like to do is only on 3rd time the player dies show a fullscreen Ad via cocoonJS.

I tried creating a global variable and adding 1 to it everytime the players dies then thought this would work...

System (Compare Variable) Restart Counter => 3 THEN CocoonJS (show fullscreen ad)

However because the variable stays at 3 until the the player restarts the level the fullscreen ad condition is always met and continues to try and loop showing a fullscreen Ad.

Any easy way to do this that im completely just missing?
B
8
Posts: 6
Reputation: 354

Post » Sun Mar 16, 2014 5:27 pm

The variable stays at 3 because you're not telling it to do otherwise. On the show ad event, add in an action to reset the variable to 0.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Sun Mar 16, 2014 6:05 pm

yeah tried that, it seems to cut the fullscreen ad off straight away as the variable resets
B
8
Posts: 6
Reputation: 354

Post » Sun Mar 16, 2014 7:54 pm

You're probably running the show ad action constantly, then. Rather set it to be at start of layout (assuming your score screen is its own layout) or any "On" condition rather than one that runs every tick.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223 and 50 guests