Wait Function please!

This forum is currently in read-only mode.
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • 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.

  • 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?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes the devs will often read peoples minds to know how they think something should work.

  • Yes the devs will often read peoples minds to know how they think something should work.

    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.

  • 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.

  • 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.

  • its strange how the normal function call has a forget and remember picked objects but the delay one does not.....

  • its strange how the normal function call has a forget and remember picked objects but the delay one does not.....

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)