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

[FEATURE]: Ability to attach scripts to nodes #987

Open
TheColorRed opened this issue Dec 21, 2024 · 3 comments
Open

[FEATURE]: Ability to attach scripts to nodes #987

TheColorRed opened this issue Dec 21, 2024 · 3 comments

Comments

@TheColorRed
Copy link

I saw it in another gdextension library (J.E.N.O.V.A. for c++) that you can attach scripts to nodes instead of creating a whole new node, as it works just like you would attach a GDScript. This would be nice if that was supported.

image

@Bromeon
Copy link
Member

Bromeon commented Dec 21, 2024

This is partially supported through script instances, see godot::obj::script.

That said, it's not the primary workflow, and I personally won't be able to maintain scripting next to all the other priorities. In the past @TitanNano has helped a lot (and is the reason why so much exists at all right now 🙂). Would you be interested in working on these parts?

@TitanNano
Copy link
Contributor

There is also godot-rust-script that builds on gdext and allows for creating scripts in Rust.

@walksanatora
Copy link

walksanatora commented Dec 22, 2024

@TheColorRed you can add scripts to nodes. it just involves a whole process of making a ScriptLanguage, then you need to make a Script class for your language which creates ScriptInstances. an the Script also needs ResourceFormatSaver and ResourceFormatLoader (and if you mess up any of these classes the engine can and probally will crash. eg: The ResourceFormatLoader not detecting Script as a valid type so your script gets loaded as a TextFile and immedeatly casuing a nullref and crashing when it cast it to Script)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants