Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 39454
In Process

askthedev.com Latest Questions

Asked: April 24, 20252025-04-24T00:14:00+05:30 2025-04-24T00:14:00+05:30

How can I configure the BeehaveTree addon to add inherited nodes instead of modifying the base node in Godot 3.X?

anonymous user

I recently started using the BeehaveTree addon for Godot 3.X, and I’ve run into a bit of a snag that I can’t quite figure out. So, I managed to install the addon and everything seems to be working fine at a glance. But here’s the issue: when I try to add a new node (like an action or condition), it keeps adding the base BeehaveTree node instead of letting me create an inherited node.

Let me break it down a bit. I have this base node script:

“`gdscript
extends BeehaveTree

class_name BeehaveRoot, “res://addons/beehave/icons/tree.svg”

const Blackboard = preload(“../blackboard.gd”)

const SUCCESS = 0
const FAILURE = 1
const RUNNING = 2

enum ProcessMode {
PHYSICS_PROCESS, # … other options here
}
“`

This works great as my root class for the behavior tree structure. However, what I want to do is create new nodes that inherit from this base class. For instance, I’d like to create a new action node that extends `BeehaveRoot`. But instead of generating this new inherited node, it just keeps adding the base node.

The problem is that every time I add nodes like this, any changes I make in the script affect all instances of that base node. If I want to, say, change behavior for a specific action or condition, I don’t see how that’s sustainable. I need to have unique scripts for different nodes, but the way it’s currently set up, I’m just altering the original node over and over.

I suspect there might be something in the configuration that I missed or perhaps I’m not following the correct procedure to create these inherited nodes properly. Does anyone know how to set up the BeehaveTree addon so that it allows me to create new nodes that are inherited from the base class instead of just modifying the base one? Any tips or step-by-step guidance would be super helpful! Thanks!

  • -1
  • -1
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2025-04-24T00:14:01+05:30Added an answer on April 24, 2025 at 12:14 am

      Sounds like you’re dealing with a classic Godot inheritance issue! When you’re trying to create new nodes that inherit from your `BeehaveRoot`, you need to make sure you’re doing it correctly in the Godot editor.

      Here’s a step-by-step approach to help you create your inherited nodes:

      1. First, ensure your new script is extending the class correctly. For example:

        extends BeehaveRoot
      2. In the Godot editor, go to the FileSystem tab and right-click in the folder where you want to create your new node script.

      3. Select New Script and set the Inherits field to BeehaveRoot. This will ensure your new script inherits from your base class. Don’t forget to provide a unique name for your new script!

      4. After creating the new script, you can now create a new scene for your node. In the new scene, add a Node and set its script to your newly created inherited script.

      5. Now, when you want to add an action or condition, you should be able to choose your custom script instead of the base BeehaveRoot node. Be sure you’re using the scene where you’ve set your inherited node as the root.

      If you do this and it still doesn’t work, double-check where you are trying to add the nodes. Make sure you’re adding nodes in a context that recognizes your inherited scripts.

      This process should let you create unique behaviors for different actions or conditions without affecting the base node. Good luck, and keep experimenting!

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2025-04-24T00:14:02+05:30Added an answer on April 24, 2025 at 12:14 am

      The reason why you’re repeatedly getting the base node added instead of a properly inherited node is because Godot and the BeehaveTree addon recognize custom nodes through scripts with unique classes and registered node types. When you create a node that extends BeehaveRoot, make sure each inherited node has its class defined with a unique class_name and optionally its own icon path to differentiate it visually. For example, to extend your base class into specific actions or conditions, define each script like this:

      extends BeehaveRoot
      
      class_name SpecificAction, "res://addons/beehave/icons/action.svg"
      
      func tick(actor, blackboard):
          # your specific action logic here
          return SUCCESS
      

      Once you’ve defined your specialized classes clearly with unique class_name entries, reload your project in Godot or re-scan scripts so that the editor recognizes the newly added node types. Then, instead of creating instances of your base tree directly, you’ll be able to instance your specifically defined nodes from the “Create New Node” dialog or drag them from the FileSystem panel. This approach ensures each node has an independent behavior logic, preventing your issue where modifications affect every instance of the base node script.

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Sidebar

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.