Action dependence chain

This forum is currently in read-only mode.
  • Hello.

    I am trying to invoke a chain of actions after I push a button. When the button is pushed I want to call a function that does something [creates objects] and then another action that does something with all the objects created.

    Here is a test cap:

    http://www.box.net/shared/9jhikb4xqm

    Here I simply create 5 objects and then count them and put the number in a message box to the user. The effect now is that the message box counts 0 object for the first time.

    What I want to achieve is to create the objects first and count the objects [do stuff with them] later but as the part of the button clickage.

    How do I do that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It seems that the sprites are created at the end of the frame or the beginning of the next frame. However, just update the count value the next frame. In your cap file this could be done for example by adding a global variable.

    Is global variable 'SomeName' equal to 1

    +[do the update]

    +System: Set global variable 'SomeName' to 0

    On Go clicked

    +System: Set global variable 'SomeName' to 1

    >For ...

    >(the expression from trigger once goes to [do the update], the event must be deleted here)

    But pay attention to the order, because if you place "Is global..." after "On Go..." it would be called in the same frame, and you would have the wrong count again

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