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

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

  • 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)?

  • (I'm still getting used to the C3 functions, so I may be missing something obvious)

    I have a function called "SetNextRoom" which (among other things) is supposed to return a number. I've set its return type to "Number.

    But when I try to reference this function, it doesn't appear on the function list with the others.

    And when I set the return type to "None", it suddenly appears on the list.

    I'm used to this in C2 — am I missing something?

    Tagged:

  • You do not have permission to view this post

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