Calling a method from an inherited class

without “tres” maybe works?

Bildschirmfoto 2023-12-25 um 18.37.27

Warning

Beware that resource files (.tres/.res) will store the path of the script they use in the file. When loaded, they will fetch and load this script as an extension of their type. This means that trying to assign a subclass, i.e. an inner class of a script (such as using the class keyword in GDScript) won’t work. Godot will not serialize the custom properties on the script subclass properly.

The “custom resources” should work as you have solved it. Do you also see this error output? (my version: v4.2.1.stable.official [b09f793f5])

image

text.text_parts The variable is now suddenly found, but I don’t know why. I have inserted many ‘print’ outputs and restarted Godot Editor after the conversion. v4.1 to v4.2

Don’t use _init() parameters/arguments in classes that inherit Resource, since that prevents loading resource data from such classes.

Also, using memory allocation as a default parameter feels like a strange coding practice to me, even if stuff are RefCounted. In an argument list is not a place where I would expect memory allocations.

You need to assign value to action. I.e.:

var action: Action:
	set(value):
		print(value)
		action = value

yes. i see this error

then is it enough to just use @export on a variable?

Yes, Godot handles the saving/loading quite well, even if you add new @export members late on. However, having default values within the export never hurts, specially if you add more resources to the file later on during developments. For example:
@export_range(0, 100) var my_int : int = 0