Undefined function parameters return 0 instead of "" as in construct 2

0 favourites
  • 3 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • I was writing an entire project using this "feature" until it was changed from construct 2 to construct 3.

    This allowed me to make a get/set in the same function with the convenience of checking if additional parameters were empty or not. The issue with return 0 instead of "", is that I would never send a blank string as a variable to function -- but I WOULD pass zero as a parameter.

    Now I would not be able to say if param(x) == "", set variable to param(x).

    I have had to rewrite a thousand lines of code to redo all get/sets functions and calls. Which has been extremely frustrating, as well as making no sense.

    Why was this changed? How is this a benefit over how it was in C2?

    I guess the alternative could be:

    if param(x) == 0 && param(x+1) == "Set" >> set varaible to 0. But this sucks. It was better before. At least from my perspective.

    Why did this change?

  • Because "" could cause an error, and zero wont.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if param(x) == 0 && param(x+1) == "Set" >> set varaible to 0.

    Are you still using the old Function object? You really should update it to built-in functions. You will be able to name and set a proper type for each parameter.

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