Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add_child not working as intendent #179

Closed
GhostNr1 opened this issue Mar 20, 2024 · 2 comments · Fixed by #189
Closed

Add_child not working as intendent #179

GhostNr1 opened this issue Mar 20, 2024 · 2 comments · Fixed by #189
Labels
bug/confirmed Bug/regression has been confirmed. kind/bug A bug or regression in expected behavior.

Comments

@GhostNr1
Copy link

Describe the bug

When adding a node in the tree with add_child it's not giving a random number as described in the documentation https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-add-child instead it allways use the force_readable_name. Then you can only add one node then it will have a conflict in naming. Reflected in the documentation is also that if two siblings collide in naming a number should be added to avoid conflicts

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

  1. Create one scene with some nodes
  2. Create another scene with a script
  3. In a loop (use timer to not get to many created at a time) then instansiate the first scene and then call add_child
    image

Godot full version

4.2.1.stable

Orchestrator version

v2.0.rc1.official [551ed1f]

Additional information

No response

@GhostNr1 GhostNr1 added the kind/bug A bug or regression in expected behavior. label Mar 20, 2024
@GhostNr1
Copy link
Author

I was trying it out with gdscript to see how it behave and if nothing it should not use nice name it look like this when you run.

image

It just create a new node with @@ And if you use readble name it look like this instead
image

I also tried if I could use callv and use add_child but I get the same result as the add_child node

@Naros
Copy link
Member

Naros commented Mar 23, 2024

Hi @GhostNr1 so I think this is working, the issue is you've attached the Instantiate Scene output to the wrong input port. I suspect if you take a look in your debug window, you should see an error that says:

E 0:00:00:0842   add_child: Parameter "p_child" is null.
  <C++ Source>   scene/main/node.cpp:1486 @ add_child()

In this case, we should see whether we can exclude the Target node from being auto-wired. The target in this case is the current node the script is attached to, but it exists to allow nodes to manipulate the tree of other nodes.

I think what will also help is that for function calls, only the Target pin should have a (self) reference, the node should not, which should give an indication there is no default, as shown here:
image

@Naros Naros added the bug/confirmed Bug/regression has been confirmed. label Mar 23, 2024
Naros added a commit to Naros/godot-orchestrator that referenced this issue Mar 23, 2024
There are situations where a function signature may contain multiple pins
that would match the autowire criteria, and we should automatically skip
the `Target` pin because its generally never intended to be what will be
autowired.
Naros added a commit to Naros/godot-orchestrator that referenced this issue Mar 23, 2024
Naros added a commit that referenced this issue Mar 23, 2024
There are situations where a function signature may contain multiple pins
that would match the autowire criteria, and we should automatically skip
the `Target` pin because its generally never intended to be what will be
autowired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed Bug/regression has been confirmed. kind/bug A bug or regression in expected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants