Bezier

  • Joined Oct 2, 2023
  • 0 best answers
  • Seems like it cannot find any classes.
    SCRIPT ERROR: Parse Error: Could not find type "CameraRigTP" in the current scope.
    SCRIPT ERROR: Parse Error: Identifier "AI" not declared in the current scope.

  • I went and looked at this:

    Try setting Depth Draw Mode to always.

    • xyz I suppose that writing "value", or just the word "variable" alone would have better carried what I meant.

      In any case, I was not aware that variables can be static now. This was pretty well hidden from search results with outdated answers that claim the opposite showing up instead. So in case anyone else stumbles here, Static variables: https://docs.godotengine.org/en/4.2/tutorials/scripting/gdscript/gdscript_basics.html#static-variables

      With this knowledge, we can get rid of most of our autoload code immediately.

      • xyz replied to this.
      • xyz Globals contains some mutable conf variables among other things. I've understood that autoloads are the way to do this.

        • xyz replied to this.
        • On 4.2.2. I want to set up a step on github CI to validate all gdscript in the project. There is a workaround to run --check-only on all scripts, but it fails:

          SCRIPT ERROR: Compile Error: Identifier not found: Globals 
          ...
          ERROR: Failed to load script "res://classes/example.gd" with error "Compilation failed".

          It doesn't know of the autoload and fails.

          So my questions are:

          • Is it possible to get my autoloads loaded before the script is compiled?
          • Is there another way to validate the scripts?

          Thanks.

          • xyz replied to this.
          • xyz Thanks. That solution isn't great, but it would work. I'll keep it in mind.

            • xyz replied to this.
            • I found a few people have asking this, but I haven't found a good answer.

              So my custom tool nodes can be dragged over each other in the editor to "connect" them. Now, when I delete one, I want the other nodes to forget it.

              Some things I've tried so far:

              • NOTIFICATION_PREDELETE:
                Not called. Nodes aren't actually freed when deleted in editor. https://github.com/godotengine/godot/issues/84366

              • tree_exited signal:
                Not enough as is. Covers node deletion, but also many other cases, like changing scene tabs. If I there's some additional "deleted in the editor" status that I can check, this would work.

              Any ideas?

              • xyz replied to this.
              • Bezier How about this. When node exits the tree, look for all existing connections, break those connection and store the connection info in the node itself. When node enters the tree, look if it has any stored connections and reconnect them if possible.

              • I see there's already an answer, but I'll finish mine anyway.

                The GPU is very good at running many threads of same code in parallel. Like in a game, running the same shader code for many pixels at the same time. Branches are not executed in parallel, but one at a time.
                If you do a simple if statement, the then branch is first executed, while the threads that take the elsebranch are just idling, and then vice versa. A switch with many cases could be catastrophic for performance.
                The processing time can be as if every pixel you're drawing takes every single branch.

                Note: After seeing the other answer, I'd like to point out that this will not matter with whatever you're doing in gdscript unless it's really bad or has to be really optimized for some insane reason. The only project where CPU branching was a bottleneck for me was pushing an interpreter emulator.

                • xyz replied to this.
                • Hi, anyone here experienced with 3d gizmo plugins or working with the editor viewport?

                  When setting and committing a handle, is there a way to detect if the handle is hovering over another node or its gizmo?
                  I essentially want to connect my custom nodes by dragging the handle over the other one.

                  Thanks.

                  I also asked about it here: https://programming.dev/post/3806068. There's a bit more context about my project.