You can call a parent class' function like this:
.example_function(variable_thingy)
But is it possible to call that parent class' parent class' function (and so on) directly? And if not, why? I don't see any mention of it in https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html, so it made me curious.
EDIT: I see that I have not asked that question correctly. I am referring to a more specific scenario. Take this situation, for instance:
extends Node2D
func some_random_stuff():
print("stuff")
Let's call the node above Enemy
. Now, I make a node derived from the above node and overwrite this function:
extends "res://Enemy.gd"
func some_random_stuff():
.some_random_stuff()
print("different stuff")
This one would be called Enemy_Drone
. Now I make a node inheriting from THAT node and overwrite the overwritten function:
extends "res://Enemy_Drone.gd"
func some_random_stuff():
.some_random_stuff()
print("even more different stuff")
And this node is called Enemy_Drone_Special
.
Now, if I call .some_random_stuff()
inside of Enemy_Drone_Special
, the result will be
stuff
different stuff
even more different stuff
because .some_random_stuff()
will be calling Enemy_Drone
's function (which also calls Enemy
's function), but I want to call Enemy
's function directly instead of using Enemy_Drone
's so that the result is like this:
stuff
even more different stuff
Is that possible?