0 votes

What I wish for is to have nodes that will gain completely unique behaviors in unique circumstances. I want them to reform their own functions or create new ones when those circumstances are met. I wish to keep these circumstances along with whole code lines in JSON. This is because I plan to have hundreds of various behaviours and I don't think it is convenient to have single ready script with all of them being switched with booleans.

For example : when blue node collides with red node I want the nodes script to expand ( create new script dynamically based on originals script copy ) and add whole line of code from JSON containing whole new Input event() function in form of string.

Is this possible in Godot ??

Godot version godot 3.2 stable
in Engine by (7,925 points)

I don't think that adding code on runtime is a viable option imo, with what you are describing you are better off with a behavior tree.

It is possible to do this as a node's script can be set and changed during runtime so if a template is setup to receive JSON data then it can be created as needed.

The above mentioned is ill advised as it breaks proper coding conventions and makes your intentions look malicious in nature

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.