Delays/time

Get help using Construct 2

Post » Wed Feb 13, 2013 1:36 pm

Hey guys.

Was wondering if anybody could help me, I'm a little confused with the events when using the time actions. If someone could lend a hand, that would be much appreciated.

just before I ask I would like to mention that I have already spend a few hours looking for the answer myself but there are many forum posts here and many of them are too complex for me to understand. I'm not a smart person, I don't learn quickly so where as this may seem like a very simple question, for me it isn't.

It's regarding time and actions. Here's my game: I have a playerbox which jumps in a platform game. What I'd like to do is set a condition that, when the sprite lands, (or collides with another object, but there is already a condition to say the sprite has landed) I would like to disable a button for .5 seconds. Then I would like normal control to resume after said half a second.

I just don't understand time (or how to stop function to a specific direction in the 8 direction behavior).

Many thanks in advance guys, i appreciate your time.

B
6
S
2
G
3
Posts: 7
Reputation: 2,202

Post » Wed Feb 13, 2013 2:23 pm



This is what I have, and it was how I thought it would work.

Unfortunately I was wrong. Anyone know what I'm doing wrong?
B
6
S
2
G
3
Posts: 7
Reputation: 2,202

Post » Wed Feb 13, 2013 3:10 pm

Under System, there's an X Seconds Passed condition you can use to see when 0.5 seconds have passed.
I don't know of an action to disable a control, but you could set a variable to return a certain value when that half second is still ongoing, and not allow activation of the event utilizing that control during that time.
B
6
S
1
Posts: 67
Reputation: 986

Post » Wed Feb 13, 2013 3:44 pm

Thankyou.

I've been looking into variables (which is big and complex) and came to the conclusion that I can't even get the game to detect that the player has even landed. I've made events to say ON COLLISION WITH GROUND -> START IGNORING 8 DIRECTION USER INPUT. Alas there is no change in how the game works. :( Might upload my capx
B
6
S
2
G
3
Posts: 7
Reputation: 2,202

Post » Wed Feb 13, 2013 3:48 pm

https://www.dropbox.com/s/9jw2f7e4l0mflf7/dan2.capx

This is the file. Any help would be appreciated.

I keep going back to try and fix it however I end up tearing my hair out more and more :(
B
6
S
2
G
3
Posts: 7
Reputation: 2,202

Post » Wed Feb 13, 2013 4:43 pm

here is a modified capx that I think gets you what you want: https://dl.dropbox.com/u/38038537/examples/dan2_modified.capx

I think your main issue was that your input was being handled by the platform behavior, and not the 8-direction behavior. I removed the 8-direction behavior, and added some new events at the bottom of the sheet. I also added groups because it makes it easier for me to understand what's going on. :D

I hope this helps.
Don't see the fnords and they won't eat you!
B
75
S
16
G
12
Posts: 322
Reputation: 11,608

Post » Wed Feb 13, 2013 7:13 pm

HUUUGE HELP.

Wastrel, thanks so much. Helpful would have been replying. You gave me a new capx file to look upon which allows me to really play with and better myself. I've now gone in and taken a good look at the new file. I just have a couple more questions about the events if anyone can explain a few things?



I see the variables have changed to differentiate between the jump and before/after the jump.

However it is the "stop ignoring platform user input" that I struggle to understand. Does this create a consistent time gap from when the character lands to the point of the resume of control? Which leads to my further question of, is each sub-event consecutive in execution, starting from the top and working it's way down? So does the SYSTEM-EVERY 1 SECONDS event only happen after the rest or finished, or is that something that is forever happening in the game which it is running?

I know this is all sorts of questions but it's really helping me understand the engine.

Thanks in anticipation and help already given.

DanAx84722013-02-13 19:13:49
B
6
S
2
G
3
Posts: 7
Reputation: 2,202

Post » Wed Feb 13, 2013 9:41 pm

The solution I presented may not be the best solution, I was just trying to emphasize the platform behavior controls, and a possible way to implement a timed delay after landing. It was just a quick example.

Events are called from the top down, every tick. So the Stop Ignoring action is called every 60ish ticks, no matter what. It would probably be a good idea to stick another condition in there, so it's only called after the Start ignoring action has been called.

Regarding the event timing, after taking a look at the behavior code, it seems that it begins ignoring the input immediately, or within a couple of ticks, of the Start Ignoring action being called.

If that's the case, the actions probably could have been named more clearly, such as Ignore Input and Accept Input, or something like that.

I'm sure someone more knowledgeable than me will have an opinion if I am wrong.Wastrel2013-02-13 21:46:51
Don't see the fnords and they won't eat you!
B
75
S
16
G
12
Posts: 322
Reputation: 11,608


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, dieblume86, Kagubro and 2 guests