WAIT Action

0 favourites
  • 14 posts
From the Asset Store
11 loops of RPG, chiptune/8-bit music. Suitable for any pixel art game.
  • I would like to ask a "redesign" of the "WAIT"-Command. To my mind, it is quite unpredictable how to use it. What I am unable to grasp is, why cant it allways does what you expect it to do?!

  • If you're asking for a re-design, you will need to provide a much clearer reason for it, preferably with example(s). At the moment, it just looks like you don't like the way it works, which is hardly a good reason for change.

  • Extract from the system actions manual entry

    Wait

    Wait a number of seconds before continuing on to the next action or sub-events. Other events continue to run in the meantime. See also the tutorial on How to use the System 'Wait' action.

    At first I was a bit lost too, but after having read the 'Wait' action tutorial, I think I finaly grasped how it works.

    It's tricky at first, but imo needs no re-design. It works as expected when used properly.

  • It has a well defined and predictable way of working, you probably are just assuming it does something else.

    'Wait' means 'pause the current event and come back to it after a delay'. The rest of the events keep running in the mean time. So if you use 'Wait' in a loop, the loop finishes instantly, because 'Wait' doesn't stop the rest of the events running. Any actions after the 'Wait' complete as scheduled.

    I think people keep assuming it stops running the rest of the events during the wait. It can't possibly do that, because it would make it nearly useless - the whole game would hang during the wait...

  • I think the function is not universal. Depending on the "position" within the "codestream" it will be executed or not. And it seems, that you just can not use it to slow down loops....

  • espercially the loop part seems akward to me....

    I am compiling an SimonSays Tutorial right now, and slowing down the "playback" loop with WAIT just didnt work...

  • In the case of a Simon you have to think at the tick level.

    On the start tick of the turn, the computer computes the sequence order.

    Then for the following ticks, it will playback the sequence. During those ticks, the user must not input anything (or you don't take it into account).

    Then for the following ticks, it will wait for the player's input.

    On the tick the player's input is done, you compare the inputed sequence to the computed sequence.

    If the two matches, you go to the next turn and compute a new sequence.

    If the two doesn't match, you reset the inputed sequence and allow for the user to input a new sequence.

    It's not a matter of wait action here, but of state/status of the intended step of the behaviour of your logic.

    A capx to illustrate (not flawless, but should help with the methodology)

  • Oh, I came up with a solution and the tutorial is done. Anyhow, "WAIT" jsut does not feel consistant to me....

  • Wait always works exactly the same no matter where it is placed. Can you post an example of 'Wait' not doing what you want?

    You can actually use Wait to space out loops - try this:

    + Repeat 10 times

    -> Wait loopindex seconds

    -> Do something

    The loop runs instantly, but sets up 10 "Wait 0 seconds then do something... Wait 1 seconds then do something... Wait 2 seconds then do something..." so the rest of the actions complete as if the loop was spaced out in time.

  • <img src="http://quak.laurig.de/loop01.png" border="0" />

    Based on "normal" programming experiece I would expect the sprite to flash - it doesn't....

    This is the first thing I really don't understand, even thou I have no problems with the event based concept - I think <img src="smileys/smiley22.gif" border="0" align="middle" />

  • i had the same issue whit this instructions...

    event->repeat 15 times

    actions ->player set invisible

              system wait 0.1 seconds

              player set visible

    i expect to the player flash too, but just disappear one time and appear after 1.5 secs

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Loops run instantly, so instead of set invisible, wait 0.1 then set visible, you have set invisible 15 times, wait, set visible, 15 times.

    Try a variable

    Counter is less than 15, sprite is visible, set invisible, wait 0.1, set visible, add one to counter.

  • "Wait" action within a function is very weird.

    1 After the "Wait" action is executed, Funttion.Param(x) are reset to zero

    2 Actions inside the Function folowing the "Wait" action are executed more than once, a random number of times.

    That can make a programmer crazy.

  • "Wait" action within a function is very weird.

    1 After the "Wait" action is executed, Funttion.Param(x) are reset to zero

    2 Actions inside the Function folowing the "Wait" action are executed more than once, a random number of times.

    That can make a programmer crazy.

    Rather than resurrecting a long dead 6 year old thread, you might want to start your own thread and ask for help. IMO it looks like you may be assuming how wait works incorrectly, but without more info it is hard to tell.

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