Call functions

  • I wanna know if it is possible to call functions, or go and play some lines of my code, like C++ or something like that. I want to play my game and in some cases go and read again some lines above. Hope u can help me :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks!! but... where can i create those functions? I mean the manual is great but I dont find where is declarated the function.

    Thanks again :)

  • the actions in a event with the condition "on called function" will occur when you called the function, an exemple

    On called function "next level"

    Go to layout blablabla

    On some condition: Call function "next level"

  • But when I want to declarate a function what i have to do? Its like defining an event? I dont find it

    thanks again ^^

  • This is how you declare a function

    Event: Function.On Function("function_name"). <===== declared

    that's it. that's the deceleration. There is no more.

    That's how you call a function.

    Action: Function.Call("function_name")

  • You do have to include the Function plugin, like other plugins. It's not part of the System.

  • It is defining the event "on called function"

    That confuses me too the first time, but you just do

    On called function "next level"

    Go to layout blablabla

    To declare the function next level basically, when "next level" is called, the actions under "on called function" will be executed

  • Thanks a lot to all. I didnt know that its a plugin! I thought my Construct was broken :( I'll try, thanks a lot, really :D

  • Just to be precise, don't think of functions in C2 as "defined functions". It's more of an event called. You can have multiple "On function XXX" events, they will all trigger when you call the function. Functions are not defined, don't think of it as in JS for example.

  • In the examples I saw, its like a constructor of a class, referring to JS or C++, used to generate more objects of the same type without writing all the parameters that they have. I will investigate, thanks again

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