Else on Construct 2

Not favoritedFavorited Favorited 0 favourites
  • 13 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Where are the else statement on the Construct 2 events?

    it was removed?

  • There is none, but you can use this plugin

    scirra.com/forum/plugin-branch_topic45712.html[url=http://www.scirra.com/forum/plugin-branch_topic45712.html%20][/url]

  • You can also set and check a variable to get the same effect.

  • thank you very very much drpool... this plugin solution my problems

  • Hi Arima,

    I am trying to use the set and check variable logic to decide which object to spawn in my game. However, I seem to be missing something because the condition occurring last in the chain always seems to be triggered. Can you help me understand what I am doing incorrectly?

    <img src="https://lh4.googleusercontent.com/-m-Onlv0xJf0/TvFdA-jPnWI/AAAAAAAAAEI/8lJXiR896XI/s800/C2%252520Logic.png" border="0" />

  • blueseth : check this tutorial.

    This is the same principle.

    You can also implement with putting a local variable between event 1 & 2 (this way the local variable's scope is limited to events at the level of event 2 and 3). This var is 0 by default.

    In event 2 & 3, add a condition to both being a compare localvariable = 0.

    In both events add an action set localvariable to 1.

    Remember C2 reads from top to bottom.

    At the moment, when Turn = 1 your actions get executed. This includes subrsacting 1 to Turn.

    So right after, Turn = 0, so the actions of this event would be executed.

    If you inverted the order of those events you would have the opposite. Turn = 1 would always be executing too.

    With the localvariable check, you are sure that only the proper event will execute its actions once per tick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I hope Else and Or get implemented on future versions. Creating variables for this is cumbersome at least.

  • Thank you, Kyatric. Your post helped me resolve my problem. I added a screen shot of the new working event sheet for any interested parties.

    <img src="https://lh4.googleusercontent.com/-M1HfWbirtkU/TvPajrUeTHI/AAAAAAAAAFg/44D9Qjzt82k/s800/If%252520Statement%252520using%252520Variables.png" border="0" />

  • Thank you very much for this.

  • studioG, this thread is from December. It is now out of date, 'Else' was recently added to Construct 2.

  • studioG, this thread is from December. It is now out of date, 'Else' was recently added to Construct 2.

    So where is it? i don't see it in System Conditions

    EDIT:

    Nevermind. It was gone due to bad placement. Found it.

  • Right mouse on condition and select 'Add - Else'.

    ninja'd

  • Irbis zenox98

    protip: x key

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