brushfe's Forum Posts

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • It might be because you've put the string variable Target_exit in quotations. This means construct is looking for a layout called "Target_exit", instead of what the variable Target_exit represents.

    Try writing Go to layout -> Target_exit without the quotation marks.

  • Genius, that did it! Thanks to you both for the fast help.

  • Hey, I think you're right! That would explain why overwriting works, but not deleting.

    It didn't even cross my mind. So to clear an array of certain entries, you can't write:

    ----

    Array -> For each X element

    Array -> If value at CurX = 1 ... Delete index CurX from X axis

    ----

    because the element index number is out of sync with the entries?

    I suppose you'd have to use loops and a variable that keeps up with the deleting of entries?

  • I've noticed in my code that deleting array entries doesn't always seem to work.

    Since I'm new-ish to arrays, I didn't want to assume this is a bug. If anyone has a moment to test this, I've attached a file that reproduces the problem.

    It creates an array of random numbers (0-1). Then it scans the array for entries with the number 1, and deletes them. But it only deletes a few (it should delete them all), so it makes another scan, and deletes a few more (again, should delete them all).

    If you open the console you can see the results. Refreshing it a few times shows the inconsistency

    Note: There's an option in here to overwrite the array entry, instead of deleting it. Overwriting the entries works every time, but deleting the entry is inconsistent.

    Thanks for any insight!

    https://drive.google.com/file/d/11wroFtK9fc-pG82ruW2j4dWti96KhdEy/view?usp=sharing

    Tagged:

  • Ah sorry! I missed your topic when I was looking around.

    It does seem unnecessary. I'm not sure the fear of clogged-up function lists is worth taking away flexibility or imposing a coding style.

  • If I understand right, it just means you can't call a return-value function without caring about its return value (Logical, sure, but C2 gave you a lot more flexibility)

    In C2 I'm sure that I could call this function without worrying about its return value:

    But in C3, it seems like I have to do this:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the quick reply!

    But if these functions can only be called as expressions, doesn't that mean they can't be used for anything else (actions like changing animation, adjusting effects, etc)?