Wait Function please!

New releases and general discussions.

Post » Tue Oct 20, 2009 11:13 pm

Currently the 1# problem I run across when working on Construct Is the lack of having nothing to create a delay. Such as If object X collides with Object Y It dies 3 seconds later. the ability to time events would immensely help everyone.

now, Yes I'm aware you can jerryrig a delay with the function object as well as manually using the delay method that would be written in once a wait function is implemented. But this isn't a help thread is an suggestion thread.

Please add wait, your fans will thank you.
B
2
G
3
Posts: 16
Reputation: 882

Post » Tue Oct 20, 2009 11:38 pm

There's timers, as well as a timeline object, and a timer behavior.
Just how would you want it implemented? Like the "call function after delay" of a function?
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Tue Oct 20, 2009 11:42 pm

[quote="zero_rogue":16y90vg1]now, Yes I'm aware you can jerryrig a delay with the function object as well as manually using the delay method that would be written in once a wait function is implemented. But this isn't a help thread is an suggestion thread. [/quote:16y90vg1]
B
2
G
3
Posts: 16
Reputation: 882

Post » Tue Oct 20, 2009 11:53 pm

Yes the devs will often read peoples minds to know how they think something should work.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Oct 21, 2009 12:09 am

[quote="newt":2fq2girw]Yes the devs will often read peoples minds to know how they think something should work.[/quote:2fq2girw]
I shouldn't have to say, Delay is a extremely simple thing. usually its written when the delay Is called the program takes the current time and stores it in a variable. Then once storedtime<Delay+storedtime. It triggers the evaluation.

If you still do not understand Ill explain the workaround im currently using in Construct.
I use three events and three variables(time, storedtime and trigger). the first event just adds 1 to time every second. The second event saves storedtime = time when I want the delay to start. The third just waits till storedtime+delay<time then turns trigger to 1 to activate the event.
B
2
G
3
Posts: 16
Reputation: 882

Post » Wed Oct 21, 2009 12:19 am

But as Newt suggested, why not just use the timer behavior? The timer behavior does what you're looking for without the hassle of doing this manually.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Wed Oct 21, 2009 10:47 am

It's a good idea for an inbuilt condition to be able to delay actions - it's something I'll look in to for Construct 2. I don't think it's really possible in Construct 1 - yes, I know I keep saying that - but its event engine architecture really isn't up to it. For now, the Function object's 'Call function after delay' is the standard way of implementing a wait.

I think what zero_rogue is talking about is a wait condition like so:

+ A collides with B
+ Delay actions 3 seconds
-> Destroy B

When A and B collide, 3 seconds later the actions run, and the B that was in the collision is destroyed. (For those in the know, the SOL from the original conditions is preserved when running the actions later on, with destroyed objects removed I guess.) At the moment, using the function object to implement a wait resets all object picking when running the function later on, so in this case, all Bs, including those not involved in any collision, are destroyed. This requires a 'destroy me' flag as a workaround to re-pick the intended B to destroy.

So, this would be a very handy condition. It's on my 'definitely do this in Construct 2' list.
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,228

Post » Sun Oct 25, 2009 1:30 am

its strange how the normal function call has a forget and remember picked objects but the delay one does not.....
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Sun Oct 25, 2009 8:35 am

[quote="Aeal5566":qu1i1wjw]its strange how the normal function call has a forget and remember picked objects but the delay one does not.....[/quote:qu1i1wjw]

I made a suggestion for it a while back, but Ash said there are a few issues, namely spawning. Like if someone were to destroy the object that was to be remembered in a separate tick, before the delay was called.... there would probably be an error.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest