Extremely Weird Array Issue? Loop Limit?

0 favourites
  • 4 posts
From the Asset Store
For Adventure, Action, Heroes, Sci-fi and Action-RPG games.
  • I'm not sure how to explain this issue but with the following function below:

    And this is the array data:

    Now, if i try to call this function and search by parameter name "Level" on the LAST array in the list it will crash the layout.

    However, if i search by the first parameter in the array, "Name", this does not crash.

    And if I search by the third parameter in the array, "Prestige", it crashes.

    NOW

    If I MOVE this to the top of the function it runs without issue

    So at this point I thought maybe there was a limit to this while loop? So I created a duplicate function and removed all checks for other arrays

    This crashes the layout still.

    HOWEVER if i add a "dummy" check for any other DB below it, it will function

    Note that this function works perfectly fine with every other array, only specifically the FIFTH.

    Does anyone have any idea why this is happening?

    Link to a demo project file: dropbox.com/s/j6xfe23eb2etlyn/c3WeirdIssue.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to remove "Else" from event 17. Leave the condition part empty.

    Also, your project is crashing because While loop becomes infinite. If there is even a small chance to create an infinite loop, you should always include an "safeguard" exit condition to it! So add condition "loopindex<1000" to the while loop. It will stop the loop after 1000 iterations.

  • You need to remove "Else" from event 17. Leave the condition part empty.

    Also, your project is crashing because While loop becomes infinite. If there is even a small chance to create an infinite loop, you should always include an "safeguard" exit condition to it! So add condition "loopindex<1000" to the while loop. It will stop the loop after 1000 iterations.

    Ahh interesting, I'm assuming the issue was caused then because the function under else only will be triggered if the last function is false?

    Thanks for the help!

  • Yes, "Else" was only applied to the last condition - arrayName="playerCharacterDB".

    So when arrayName was "playerCharacterDB", Else block never triggered.

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