Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Function getting stack overflow error and I don't know why.

    Beginners
    6
    14
    657
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dave
      Dave Fuze Team last edited by Dave

      Steve - you're doing nothing wrong and we are aware of this error. It is fixed and will be added in an upcoming patch.

      For the time being, could you try doing the c = controls(0) in your main loop? I set up my programs this way and it doesn't seem to trigger the stack overflow for me.

      c = controls(0)
      
      // main loop
      loop
          c = controls(0)
          clear()
          getinput()
          update()
      repeat
      
      function getinput()
          // don't call controls() here
      return void
      

      I'm interested to see if this works for you.

      1 Reply Last reply Reply Quote 1
      • SteveZX81
        SteveZX81 F last edited by SteveZX81

        Thanks Dave, sadly it's still giving me the error. weird huh?
        Maybe I'll just take the code out of the function and stick it in the main loop and see if it still does it.

        Hells bells.. I even get the error when the code is in the main loop and not in a function.
        (I find it more than a little strange that its giving me 'too many functions called' when my code is now not calling any functions at all.)

        1 Reply Last reply Reply Quote 0
        • Martin
          Martin Fuze Team last edited by Martin

          Try changing it so that (in pseudo-code)

          increment = 0
          if c.a then increment = 3
          if c.b then increment = -3
          setspriterotation(sprite, r + increment)
          

          That way the setspriterotation is not called within a conditional block

          1 Reply Last reply Reply Quote 0
          • SteveZX81
            SteveZX81 F last edited by

            It seems this is a rare bug in Fuze. I've even tried commenting out each part and testing it (ie the rotate part, then move, then draw) but it crashes every time regardless.
            so it's a case of wait for the next patch. Thanks anyway everyone!

            1 Reply Last reply Reply Quote 0
            • SteveZX81
              SteveZX81 F last edited by

              Could some kind and possibly bored person type in the example code at the bottom of this page.
              https://fuzearena.com/help/view/getSpriteSpeed

              I tried to use that instead of my code and I'm still getting stack overflow and now I'm beginning to suspect an issue with my Switch itself.

              pianofire 1 Reply Last reply Reply Quote 0
              • pianofire
                pianofire Fuze Team @SteveZX81 last edited by

                @SteveZX81 There is no need to type it. You can copy it from the help page and then paste it into your code. I have just done this and I'm afraid it is working for me

                1 Reply Last reply Reply Quote 0
                • SteveZX81
                  SteveZX81 F last edited by

                  It does work but did you leave it running for like 30 secs? if you did then I guess I do have a switch problem. Thanks anyway

                  pianofire 2 Replies Last reply Reply Quote 0
                  • pianofire
                    pianofire Fuze Team @SteveZX81 last edited by

                    @SteveZX81 I will try that now

                    1 Reply Last reply Reply Quote 0
                    • pianofire
                      pianofire Fuze Team @SteveZX81 last edited by

                      @SteveZX81 Seems OK to me. I assume that you have the patch installed? Have you tried it after a restart of Fuze?

                      1 Reply Last reply Reply Quote 1
                      • SteveZX81
                        SteveZX81 F last edited by

                        Yes and yes. I even did a hard reset earlier. Thanks anyway. I think we've found the problem.

                        1 Reply Last reply Reply Quote 1
                        • Martin
                          Martin Fuze Team last edited by

                          Steve. Please let me try this later also as I still fail to see how this can be a problem with your Switch. Given we’re seeing the same issues elsewhere I’m really curious now!

                          1 Reply Last reply Reply Quote 1
                          • ITzTravelInTime
                            ITzTravelInTime F last edited by

                            Same prolem with my game, i think i will just wait for the patch since it will mean apply too mutch changes to the code

                            1 Reply Last reply Reply Quote 1
                            • First post
                              Last post