Can you use the wait action for a event?

Get help using Construct 2

Post » Mon Jul 06, 2015 10:18 am

I am trying to have it so a action happens after a number of seconds. But you are supposed to delay the events by a couple of seconds by clicking on a certain object. The farthest i got in this is the wait action. The problem is that it only can delay actions placed after it. Not events. The X seconds, the event that makes the action happen is a event and not a action. Can you somehow affect a event using the wait action?
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Mon Jul 06, 2015 10:25 am

Yes, you can. Add wait and then add a sub-event. See screenshot bellow:
Image
B
32
S
7
G
4
Posts: 398
Reputation: 4,591

Post » Mon Jul 06, 2015 11:13 am

Not sure if that resolved your issue but you might want to deal with dt and a variable to solve this. Below is a link. Wait does allow for a delayed event but I'm not sure if you can continue to delay that event by pressing the button again or hitting the object.

Use this link start at where the bold says every x seconds. It explains exactly what you are talking about.

https://www.scirra.com/tutorials/450/timers
B
8
Posts: 23
Reputation: 360

Post » Mon Jul 06, 2015 11:44 am

grigrizljac wrote:Yes, you can. Add wait and then add a sub-event. See screenshot bellow:
Image


I did that but it makes the event that is supposed to happen after a number of seconds never happen. Even if don't click on the object to delay the event it never occurs. Appearently the x seconds and go to layout doesn't work as a sub event.
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Mon Jul 06, 2015 12:00 pm

Message: Calfuso is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Xore wrote:Not sure if that resolved your issue but you might want to deal with dt and a variable to solve this. Below is a link. Wait does allow for a delayed event but I'm not sure if you can continue to delay that event by pressing the button again or hitting the object.

Use this link start at where the bold says every x seconds. It explains exactly what you are talking about.



What i am trying to implement is that after 10 seconds you go to a different layout. But when you click on a object it delays that whit 4 seconds. That tutorial may show how to do that successfully but i may just not be skilled enough to understand how it shows that.
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Mon Jul 06, 2015 1:44 pm

Option 1 will load the next layout 4 seconds after you hit the button, but you can't keep hitting it to reset the timer. This doesn't appear to be what you are looking for as you want to add time to a current timer. So give me a min I'll upload some fixes.

http://imgur.com/Dd2yzg5
B
8
Posts: 23
Reputation: 360

Post » Mon Jul 06, 2015 2:09 pm

Option 2 will do what you desire just have to change some conditions around =)

http://imgur.com/V8JF8Ti
B
8
Posts: 23
Reputation: 360

Post » Mon Jul 06, 2015 2:13 pm

Be careful when playing stuff, things like putting destroy sprite before layout could prevent anything from changing as the sprite was destroyed so it didn't finish all of it's commands.

If you want it to change layout when score hits 1000, be sure to use defensive scripting and do
When score > 999 instead of when score = 1000, if they have 999 score and get 2 points you never actually hit 1000 so the event doesn't trigger.
B
8
Posts: 23
Reputation: 360


Return to How do I....?

Who is online

Users browsing this forum: ChoosyZerk and 63 guests