[help] maximum call stack size exceeded

0 favourites
  • 14 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • imgur.com/cL59bNE

    imgur.com/V8SPPT5

    Event sheets are in the links, I know there is a problem with the if x-object is created create 3 more objects events, but I don't know how to fix them/ find the exact problem.

    Thanks in advance

    Niek Biesterbos

  • You have an infinite recursion, therefore you get a stack overflow.

    When you create your 'obstacle1green' then you also create an 'obstacle1purple' and that again created an obstacle1green and so on.

    The same with the other obstacles.

  • Asmodean got it, thanks. Do you have a suggestion too?

  • It depends on what you want to achieve. I don't really understand from the screenshots what you want to do.

  • Want to create a sort of color switch thing, 4 object on each other in 4 different colors but there must be changes in the pattern. So 1 is black white grey purple (example) and 2 is white black purple grey. When the stack of 4 object is created it needs to move to the left and then a new one needs to be created. The 4 object on each other form a obstacle in my game. The 4 objects fill the entire screen so the player needs to go through one object and the other 3 will let him die. So what I'm asking is how I create that obstacle in 4(or more) different patterns without getting that error. Thanks in advance

  • A rough example:

    drive.google.com/uc

    I don't know if it's really what you want.

  • Exactly, you're amazing thank you my friend!

  • Asmodean now if I want to change the speed of the obstacle's movement to a higher speed it created only 1 good obstacle, and the other obstacles are just one block on the bottom and the other 3 are missing

  • I have only a problem on the start, because of the way I destroy the sprites. I get one block but after that it's back to normal. What did you change?

  • Changed -1 pixel to -5, up untill -3 everything still works fine, after -3 it creates 1 good one at the start and then it fails

  • I changed to -20 and every 0.5 Seconds without problem. What Browser do you test it?

    Try to disable the the destroy event (Line 8), now the objects will add up but maybe it helps to figure out if that's the problem.

    Edit: I changed a litte bit, please have a look if it's know work better.

    drive.google.com/uc

    Up and Down-ArrowKeys for the Player.

  • The problem is in the destroy line because when I disabled it everything works.

  • A made a few changes, please have a look at the link above.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Asmodean worked! Thanks a lot for all your help!!

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