I think it does not work in 3.1 because you are actually breaking OOP here. You use a function in a class where it is not defined, and not defined either in any of its bases. The fact it worked before was actually not wanted so likely a bug/flaw.
What you can do to make it work (and also make things more clear) is to declare that function:
func fight():
pass # Implemented in child classes
Or call it using dynamic introspection:
call("fight")
Or use assert(false) in function’s body so base class stays abstract and to enforce implementation in derived classes.
BTW i think OP was talking about mapfunction().
hilfazer | 2018-08-21 14:51
Yes, I do mean mapfunction(). It’s the function that’s defined in child class and called in parent class. Because every child node has its own version of “mapfunction()”.
Qws | 2018-08-21 16:11
Kinda wish it did work, even though it was not intended, because GDsript’s dynamic nature.