brushfe's Recent Forum Activity

  • 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.

brushfe's avatar

brushfe

Member since 21 Jul, 2013

Twitter
brushfe has 2 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • RTFM Read the fabulous manual
  • x10
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x3
    Lightning Draw First person to up-vote a new Construct 3 release
  • x3
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

21/44
How to earn trophies