0 votes

I'm currently creating a custom GUI which will allow me to write dialogue and export it to JSON, I know there are other options but I would prefer to use my own due to needing some specific functionality which other dialogue tools currently lack.

However, I am having a problem with adding slots via-code.

The Documentation says

To create the slot, add a Control-derived child to the GraphNode.

However, do to that would require some alterations to my node structure, and before I go through the effort or redesigning the GUI i'd like to know if there is a way to add GraphNode Slots via code, rather than the method described above.

Specifically, the problem is that I am adding control some nodes dynamically into a HBox Container, and only some of these nodes in that HBOX require slots. However, as they are grandchildren and not children of the root GraphNode, the additional slots are not created automatically.

The current code I am using is add a slot is:


Which runs whenever I add another "choice" to the dialogue.

However, as the documentation states, this only edits the available 0 slot, but it does not add slots as I would like, and there seems to be no obvious way to add extra slots as needed via the code.

Could anyone help me out? Or do I just have to re-design the GUI in these GraphNodes with this limitation in mind?


Godot version 3.3
in Engine by (59 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.