delay time

This forum is currently in read-only mode.
0 favourites
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • when i make an event (button, colission, etc...) and then make an action, for example make object visible. but i want this object to be visible after 2 seconds, not immediately. is it possible? I think it can be done with time delta, but i dont know exactly how

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi I have found your solution >> Plugin! <img src="smileys/smiley36.gif" border="0" align="middle">

    You can download the Wait plugin here

    Download

    Enjoy! <font color="red">It is in (.rar) Format ok</font>

  • I hate the wait object <img src="smileys/smiley17.gif" border="0" align="middle" />

    While it is convenient, at the same time it leads to bad maintainable event sheets, whose logic is not easy to find out.

    If someone wants to delay something without the wait object, here's how:

    wait 2 seconds before making the object visible. Create a pv "timestamp" to the object of interest. Timer is a system expression (find it under System/Time/Get timer)

    + On button clicked

    -> objectofinterest: Set 'timestamp' to Timer

    + objectofinterest: Value 'timestamp' Less or equal Timer - 2000

    + Trigger once

    -> objectofinterest: Make visible

    Instead of 2000, you may set any time to wait in milliseconds, e.g 3.5 seconds = 3500, 12 seconds = 12000, etc.

    btw: Isn't the wait object part of the standard install of CC?

  • tulamide

    Far be it of me to question someone with your far greater knowledge and experience with CC, but if 'wait' isn't bugged in any way, then isn't it far more understandable just to put 'Wait: Delay 2000 ms' rather than what you have done?

    I've never had a problem with the wait command, but am willing to concede to you're experience if it is the case.

    zen

  • tulamide

    Far be it of me to question someone with your far greater knowledge and experience with CC, but if 'wait' isn't bugged in any way, then isn't it far more understandable just to put 'wait 2000' rather than what you have done?

    I've never had a problem with the wait command, but am willing to concede to you're experience if it is the case.

    zen

    <img src="smileys/smiley1.gif" border="0" align="middle" />

    It was just my personal opinion, nothing universally valid.

    I hate the wait object <img src="smileys/smiley17.gif" border="0" align="middle" />

    While it is convenient, at the same time it leads to bad maintainable event sheets, whose logic is not easy to find out.

    You see, I confirmed it being convenient, but at the cost of easier maintainance.

    + on button clicked

    -> create object

    -> wait 100 ms

    -> set color filter to red

    -> wait 2000 ms

    -> set color filter to blue

    -> wait 2000 ms

    -> set x to 40

    -> wait 1500 ms

    -> set x to 100

    -> wait 1000 ms

    -> set width to 300

    -> wait 50 ms

    -> set width to 280

    -> wait 50 ms

    -> set width to 260

    -> wait 50 ms

    -> set width to 240

    -> wait 50 ms

    -> set width to 220

    -> wait 50 ms

    -> set width to 200

    -> wait 4000 ms

    -> close application

    I find this horrible. But it is valid. The problem is, it indicates that these are actions to be done when a button is clicked, but it isn't. It is a set of actions that cover a sequence of over 12 seconds and is indeed a little program of its own, stuffed into one event.

    Now try to make changes. Like setting the color filter to blue only if another sprite is also blue...

    But again, this is only my personal opinion. Nothing to worry about. If something fits your needs then use it. Seriously.

  • thanks very much "wait" object in cc works good for me :)

  • hi all!

    wait timer works nicely but it seems whenever I put one in the execution the script just "forgets" which object it was applied to and applies the script to ALL object.

    Say for a on/off platform gameplay object;

    on collision

    wait timer 1000ms

    make invisible and disable collision

    it does all that to all instances of the objects so all platforms dissapear...

    but without the timer the private selection works just fine...

    thank you very much!

  • in fact both methods creates the same annoying result, even with the variable incrementation method, all instances seem to share the private value of the first platform that's been touched...

    even if I specify that with every touch, reset your own timer to zero!

    so there is clearly something I don't get with how construct selects instances and just how private those variables really are

  • found the timer behavior that you can apply an object but it doesn't seem to handle more than one timer. feels like bugs to me.

    If I execute a second timer when the first one is over, the game just crashes

    tried many other configurations but any timer that isn't the first one seems to be considered completed at the start.

    I simply want to make a platform that dissapear then reapear after a short while... spent all day trying to do that. XD oh well, going off to bed

    sorry for the spam!

    cheers!

  • + Platform: Value 'Trigger' Equal to "1"

    + System: Every 100 milliseconds

    -> Platform: Add 1 to 'Timer'

    + Platform: Value 'Timer' Equal 20

    -> Make Paltform invisible etc

    + Platform: Value 'Timer' Equal 50

    -> Platform: Set 'Timer' to 0

    -> Platform: Set 'Trigger' to 0

    -> Make Paltform visible

    http://dl.dropbox.com/u/12412965/Timer.cap

  • yes that method works fine for one plateform, but when you have multiple platforms they all seem to share the same private variable (timer) They can't just obey their own private timer, they'll all refer to the one of the first created instance, even if I use conditions like "pick closest" and such.

    It seems to work if the execution is "destroy" but not if it's "make invisible" and "disable collision"

    It says your file was saved with a newer version of construct? r1.2 is the latest version is it not?

    Thanks a lot for your time! I'm still searching...

  • Here.s what I tried so far

    With private timer

    With function delays

  • yes that method works fine for one plateform, but when you have multiple platforms they all seem to share the same private variable (timer) They can't just obey their own private timer, they'll all refer to the one of the first created instance, even if I use conditions like "pick closest" and such.

    It seems to work if the execution is "destroy" but not if it's "make invisible" and "disable collision"

    It says your file was saved with a newer version of construct? r1.2 is the latest version is it not?

    Thanks a lot for your time! I'm still searching...

    They don't share the same pv - it is the right picking that is missing. Please have a look at one of my earlier posts "Posted: 05 Aug 2011 at 2:01pm". It is the most simple and effective way to do it, because you don't need any timer object and you pick the right object by comparing the pv to the actual time.

  • Yes I already tried it and unfortunately it gives the same result. Works fine with one platform, but weird things happen with two or more.

    I would jump on the first platform then on the second but as soon as I touch the second it dissapears.

    I use debug texts to display the variables, I don't know if it's any indicatives but the value displayed is always the one of the first instance created, it'll never update if I touch another instance.

    Here's how I did it

    It's scary because that's how I intended to manage delays for the character animation's timing. She's getting annoyed that all of her animations are being interrupted all the time. XD :(

    Thanks again!

  • OMG I actually found a way but it's so archaic!

    this is insane...

    Creating and destroying objects seems the only way on the fly of forcing them to use their own pv's.

    Can't imagine how I can use such a process for my animations tho...

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