Stop commands for a period of time?

Get help using Construct 2

Post » Wed Jan 11, 2012 12:29 pm

[QUOTE=Ashley] I think a much easier way might be to use the system 'Wait' action!

+ On some event
-> Set ignoring input
-> Wait 1 second
-> Set not ignoring input[/QUOTE]


It's good and it actually seem to work well for my purpose ;)
and since I can't see any sort of bug for now and I've ended the event limit for the free version of the program, this is way shorter and suitable than the other ;P

Thank You!!

[I don't know what kind of issue the wait function may generate btw but I couldn't see any problem untill now]
B
5
G
1
Posts: 32
Reputation: 939

Post » Wed Jan 11, 2012 12:33 pm

I don't see how 'Wait' can be hard to understand, Its pretty self explanatory     
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Wed Jan 11, 2012 12:58 pm

[QUOTE=smitchell] I don't see how 'Wait' can be hard to understand, Its pretty self explanatory     [/QUOTE]

...sure, as long as you do not use it in LOOPS.....

But this seems to be just me
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Wed Jan 11, 2012 4:31 pm

@Weishaupt, you can use Wait in loops, the problem is most people do this:

+ Repeat 10 times
-> Do something
-> Wait 1 second

This doesn't work. I've tried explaining this a few times now, but maybe one more time: 'Wait' actually means 'set up a timer to run the rest of this event in X seconds'. So if there's nothing after the Wait action it will have no effect at all. This event says "repeat 'do something' 10 times, then wait 1 second and do nothing 10 times". Instead what you usually want is:

+ Repeat 10 times
-> Wait loopindex seconds
-> Do something

This works, because loopindex goes 0, 1, 2, 3... so each iteration waits a different amount of time. The end result is the action is run one second apart for ten seconds, which is probably what you wanted. In other words, the event says "starting from now, wait 0 seconds then do action, wait 1 second then do action, wait 2 seconds then do action...".

You probably think of 'Wait' as pausing the entire game for an amount of time. It would be useless if it did that! The entire game would freeze while the loop was running. It's only useful to have it work this way round. I hope you can see how it works better now :) I'm not aware of any bugs in the Wait action, it's just people assume it means 'pause game'.Ashley2012-01-11 16:33:31
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Jan 11, 2012 5:29 pm

I think I have now "completly" understood how it works. Thank you for your patience.
May I suggest renaming "WAIT" to "WAIT to exec the FOLLOWING".....or something similar - sorry english is not my mothertongue
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Previous

Return to How do I....?

Who is online

Users browsing this forum: zenox98 and 23 guests