mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.6K
active users

Godot 4 Question
----------------
Context: Writing an Addon in gdscript.
Aim: Create scripts at runtime & have class_name registered.

I need to make scripts like:
class_name Foo
extends Resource

and:
class Bar
extends Foo

Hence Foo and Bar must be 'known' by Godot.

I can make, write and new() the scripts but Godot does not recognize the class names.

Any ideas? Super stuck. 😔

Florian :godot:

@dbat Have you tried not defining class_name, using a relative path for extends and in your plugin.gd called add_custom_type ?

@phlowrient Hi. Thanks for the idea, but the scripts I am making are not 'part' of the actual addon, they will be in res://someplace and can't be preloaded.

I am actually trying to make a graph-node thing that lets me make classes and extend them.

My next thought is to use:
extends "path/somescript.gd"

😮 🦇