0
\$\begingroup\$

I'm using Godot for my current project, and it's been going great; but there's a bug I don't understand. I have a certain very simple script on my title screen:

extends Node3D

func _input(event):
    if event.is_action("jump"):
        get_tree().change_scene_to_packed(preload("res://scene/Level.01.tscn"))

That's all of it, and its job is to simply change the scene to the preloaded first stage when the jump key is pressed. It does work.

However, I consistently get an error message, referencing C++ code, when I run my program (even though behavior is fine). It's triggered by this script.

E 0:00:03:0209   Title Screen.gd:6 @ _input(): Parameter "current->parent" is null.
  <C++ Source>   scene/gui/rich_text_label.cpp:3622 @ pop()
  <Stack Trace>  Title Screen.gd:6 @ _input()

If I had to guess, I'd say it was arguing that the current node's parent was not set. That actually almost makes sense, as it's on a root node for the title screen. However, I do not understand why changing a scene would require it to be set in the first place. I'm not asking about the parent.

I don't like to leave warnings and errors hanging, even if they don't seem to be causing any problems. Is this a quirk of Godot, or am I looking at an actual error in my code?

\$\endgroup\$
6
  • \$\begingroup\$ The sample code you gave is valid, the problem occurs elsewhere. It looks like the error occurs on line 6 in Title Screen.gd. Can you provide more information about the code? \$\endgroup\$
    – Mangata
    Commented Oct 31, 2023 at 1:53
  • \$\begingroup\$ @Mangata certainly! I abbreviated my code by cutting out two commented lines; the error is triggered by the change_scene_to_packed line, which is usually line six. I can't be sure which part. This script is on a root node, which may have something to do with it; but I don't know why that's necessary for a scene change. It specifically happens after I press jump, so it isn't likely the preload as that would run immediately. It should happen just as readily in other projects. Tomorrow's Halloween, but when I've got time I may try and isolate it. \$\endgroup\$ Commented Oct 31, 2023 at 3:55
  • \$\begingroup\$ I mean, According to the error message, the error occurred in rich_text_label.pop(), maybe it's because you have operated a RichTextLabel incorrectly elsewhere. Now that the error is triggered by the change_scene_to_packed line, can res://scene/Level.01.tscn be opened independently in the editor? \$\endgroup\$
    – Mangata
    Commented Oct 31, 2023 at 5:19
  • \$\begingroup\$ @Mangata Ah, that's interesting, as of yet I've been completely overlooking the rich text thing. I know that Level.01.tscn can be loaded independently, and I don't actually have any rich text labels in my title; but I do have one in my level for the end scene. I'm going to look over that closely. \$\endgroup\$ Commented Oct 31, 2023 at 9:48
  • \$\begingroup\$ @Mangata Honestly it's amazing that I missed it! Again, thank you. \$\endgroup\$ Commented Oct 31, 2023 at 9:49

1 Answer 1

4
\$\begingroup\$

Found it, thanks to @Mangata. It is a weird bug.

My help boxes had default text using [dropcaps] on a single letter, terminated immediately afterward; but the terminator seemed to fail to register that there was a parent. Harmless enough but non-zero, so I'll be testing and reporting it.

Additionally, it seems to have nothing to do with my title.

To be specific, the problem is that Godot is attempting to pop() a bbcode tag, but is not yet seeing one, so it is exiting with an error message but continuing business as usual. It should see one, and does in fact function correctly for dropcaps, so this is just a weird collection issue, if I had to guess.

\$\endgroup\$
1
  • \$\begingroup\$ As an update, the bug has evolved a little. It seems I was using [dropcaps], instead of [dropcap]; but I was still getting the same effect, and it wasn't popping properly. The same behavior comes from [dropcapA], but not [dropca]. I've reported it. \$\endgroup\$ Commented Nov 1, 2023 at 22:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .