Godot Version
Godot_v4.3-stable
Question
In short, this error arised when I inherit a named class in my script extension.
I’m new to Godot so this may be a silly question. I’ve read some answers about class name and Autoload but didn’t understand.
I’m writing a mod for a Steam 2D game. This is my first time to write a mod, so basically I just follow the tutorial on Godot Mod Loader Wiki.
All I want to do is change the behaviours of two vanilla functions: func f1 in class A and func f2 in named class B. I successfully modified func f1 but failed on f2, so I think the class type is the reason. Below is some detail.
Following the example here Script Extensions - Godot Mod Loader Wiki, I create two script extension A.gd and B.gd in my mod folder as below:
A.gd
extends “res://…/A.gd”
func f1(input1, input2):
B.gd
extends B
func f2(input1, input2):
I also tried [extends “res://…/B.gd”] in B.gd but it raised the same error. Then the two scripts were installed in mod_main.gd by:
ModLoaderMod.install_script_extension(“res://mods-unpacked/…/A.gd”)
ModLoaderMod.install_script_extension(“res://mods-unpacked/…/B.gd”)
This works well on A.gd and func f1. How can I modify f2 in my mod? Thanks.