Question about custom resources and method overloading

Godot Version

4.2.2

Question

Hey so I am creating a modular skillset where i created a custom resource called “Skill” which extends resource.

Now when i add a new resource of type “Skill” is it possible for me to overload these empty methods? Because i cant edit the .tres resources, would I have to create more classes that extend skill for each specific skill type and overload the execute function within that? seems very tedious.

Yes, you would have to create a script for every specific skill.
How else do you expect it to work?

You can think of a Resource like a data container that also has some functions.

Data (your exported properties) can be manipulated via the editor.

Functions are specific to a Resource type.
Every time your resource needs to change the behavior of a function, you need a new Resource type.

A general rule of thumb should be “composition over inheritance”.
Prefer a resource that can be composed instead of creating a large inheritance tree.

:coffee: