You can achieve inheritance of scenes in Godot 4 by doing the following (I recommend that each scene resides in its own folder) :
1) create a base scene. Let's call it basescene. It usually is very basic. Attach a script to it even if empty. The script can comment on what this basescene is for.
2) create a new inherited scene from basescene. Let's call it betterscene. Godot will share the basescene's script with betterscene. You probably do not want that. Remove the linked script from better_scene.
3) create a new script for betterscene and at the top of the script, make sure it extends the basescene's script. All the functionality that you first built into the basescene's script will be available to betterscene.
4) repeat the process for a coolscene that inherits from betterscene. The coolscene script extends the betterscene script, meaning it now has all the functionality of both the basescene script and the betterscene script.
In the scripts, you can override functions from parent scenes but you can also call a function from the parent class using the keyword super.
For example, you could have a setup() function in basescene that does nothing. in betterscene you override setup(), call the base setup() and add to it. Just like this:
func setup():
super.setup() # calls the parent setup()
do something here...
With this design you can achieve pretty good practical inheritance. It makes it very easy to go back in the line of inheritance and make changes that will flow through.
Here is a folder structure for a practical example. Each folder contains a tscn scene file and a gd script:
--- scenes
------characters
----------base
----------friendly
----------enemy
---------mage
---------orc
The base character has everything common to all characters in the game (for example health) then both friendly and enemy are inherited from base. Finally, mage is inherited from friendly while orc is derived from enemy.
Check https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/gdscript_basics.html#referencing-functions: for more