d
dibixel

Invalid call

Hi, ive been really careful not to miss any steps although i believe i have. When i press the "Ok" button to enter in a name and a score, i get an Invalid call in my debugger that looks like this: "Nonexistent function 'add_row' in base 'PanelContainer' can you lead me in the right direction as to where i can correct this issue? Ive checked back on all my notes and everything looks exactly as I was instructed throughout the code. Thank you in advance!

  • Nathan Lovato replied

    This sounds like perhaps you have some node that doesn't have the appropriate script attached to it. To help you more we would need to open your project in the Godot editor.

    Could you please zip your project files and upload the zip file to a website like google drive, then link the files here? We will open your project in Godot to find what you need to change exactly.

  • d
    dibixel replied

    Of course, thank you so much! I spent the last 24 hrs racking my brain looking through my notes to see where I could have gone wrong (I copy every step I make down, so I always have a reference point in case of mistakes like this) but I guess it was something I'd just majorly overlooked, I'm so appreciative for the timely response thank you again.
    https://drive.google.com/file/d/100tDGcaa0HtdsrxVx0NEvGYKrb2hDbQz/view?usp=sharing

  • Nathan Lovato replied
    Solution

    Thanks for the link. I just tested your scene in Godot, and the issue is that the scoreboard does not have its script attached to it. Notice how below the score form has a script icon but not the scoreboard, which I outlined in yellow.

    If you open the scoreboard scene you will notice that it doesn't have the script attached either.

    To solve your issue, you need to open the scoreboard scene and attach the Scoreboard.gd script to it.


    Then you will have another issue if you try to add a score to the form. You will get a stack overflow error. The cause is in the scoreboard script. Inside of the add_row() function you are calling the add_row() function, creating an infinite loop.

    The stack is a kind of special "array" in which your computer keeps track of function calls and local variables. It has a size limit and when a function calls itself in an infinite loop, you quickly go past that limit, hence the name of the error: stack overflow.

    Remove the line outlined above, and you won't have errors anymore. I hope this helps!

  • d
    dibixel replied
    Thank you so much! I really appreciate how thorough this fix was explained. I will fix everything now and post an update on the functionality. So, when I put the scoreboard over on the ScoreForm in the node area the way we were taught does it not come over with the script from the original ScoreBoard scene every time? Like if I was to do this in the future, I would need to copy the script over every time I do something that calls for the schene connection? Not sure if I'm using the correct terminology hoping you'd understand what I'm getting at.
  • Nathan Lovato replied
    Solution

    The issue was that the script was not attached to the scoreboard node inside the scoreboard scene. As a result, when you created an instance of the scoreboard scene in the score form, it did not have a script attached either.

    If you add the script inside of a scene, every time you create an instance of that scene, it will have the script attached.

    Does this answer your questions?

  • d
    dibixel replied

    Thank you, a ton for clearing everything up for me I'm still extremely new with all of this and it can be slightly confusing at times as I have trouble learning in traditional formats so I kind of need a nudge in the right direction on occasions. Thanks again for everything, the ScoreForm is operating exactly as it should and I will remember to check for these things in future lessons.

     

  • Nathan Lovato replied
    You're welcome, I'm glad I could help.