[SOLVED] No If statements?

0 favourites
  • You should really take a while and have a thorough look at the interface, conditions and actions. Read the manual, whatever. The actions and events are there, you're just not looking for them in the right place, I guess.

    Cheers.

  • Thanks for your replies.

    brunopalermo I really am, looking at the manual before posting here.

    My problem is that i am thinking about it the way you would normal code and the manual doesn't really explain that you need to chain multiple events like this.

  • Yeah, it's different if you are used to normal coding, but you can still apply your coding knowledge to what you see in Construct, but you need to sort of wrap your head around it and start thinking Construct 2 way. I was actually surprised how easy it was. I only did that basic tutorial and read a few things from the manual, then just look up the rest as needed..

    Found only one case where it can't do what I want it to do without making things complicated compared to what I used to do in Flash.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok... Short explanation.

    Most events are IF statements on themselves (while something is true, do something). Some, the ones with a green arrow on the gear, are Triggers (when something happens, do something once). Others, the ones with a symbol similar to a reload icon on the gear, are Loops (do something a given number of times) and a few, like Trigger once while true or Every X seconds, are instructions (the first one converts an IF statement into a trigger event and the other is basicaly a timed loop).

    You can put more than one event together. This would be the coding equivalent of a AND block. Also, if you right click the event block you can change it into an OR block, by selecting Make 'Or' block. IF statements can be turned into IF NOT statements by right-clicking them, not the block, and selecting Invert. You can add an Else statement by right-clicking an IF statement and selecting Add> Add Else. You can also nest conditions.

    Lastly, actions are the stuf that happens if the conditions are true, the triggers are triggered or the loops are run. They're listed on the rightmost column and are performed in top-down order.

    Most things you can do with actual coding can be done in Construct if you understand how it works and you're creative to work-around some of the limitations a visual coding framework would necessarily have.

    Hope this helps. Cheers!

  • Yes, i agree with both of you.

    While i may seem like i am asking basic questions here, the event sheet of my first app shows that i have managed to figure out quite a decent amount.

    The problem is how to think about things, mainly about how to stop things happening since its all being executed in one tick or to speak in a Unity way, within the update function where there is only one function that is executed on each frame update. Others are triggered with events that don' t have to be "every-tick-proof".

    It is one of the bugs/features of visual coding, even Scratch makes you think differently.

    I think i am getting there, thanks for both of your help!

  • You can control flow quite a bit using groups that you activate and deactivate as needed to compartmentalize things you don't want activating until you want.

  • Yeah, there are plenty of ways to control the flow of events - using triggered events, Wait, Wait for signal, Every x second, Timer, Trigger Once, event groups.

    What I love (and sometimes hate) the most about C2 is its picking system. It takes time to fully understand how it works, but it's a really powerful stuff.

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