Problem with function

0 favourites
  • 6 posts
  • Hi, please, can anyone tell me why the text is not written ?.

    If you write the text this indicates that the parameter 0 is 0 but if you do the check, then it does not work.

  • From what I can see, you're not adding a parameter when you call the function.

    Your first line

    System: Every tick -> Function: Call "test" ()

    needs the text to passed between those brackets. For example:

    System: Every tick -> Function: Call "test" ("The Mnk")

  • Yes, I already know, but a function that does not receive any parameters has its parameters to 0 by default, so I'm checking that but it does not work.

    However, if I write the text indicating the value of the parameter (in the second image) this indicates that it is 0, as I said at the beginning in this same message.

    So.

    • A function has the default value 0 in its parameters.
    • If you check a parameter when the function does not receive any, the check does not work even though the parameter is 0 by default.
    • If you type the text to indicate the default value of a parameter, this indicates that it is 0.

    So, if the parameter is 0 by default, why does not the check work ?:

    Function.param (0) = 0

  • Its zero based, not zero default.

    There's no reason to think something that wasn't created should exist.

  • Newt is right. Nothing is different than zero. If there's no parameter, it can't have a value.

    The function is looking for a parameter, but if it doesn't find one, it doesn't assume 0. It throws an error (check your browser console, it should tell you there).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I understand, I read the documentation but I have not seen anything about it, thank you.

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