I have a program with a vehicle that works great but now I want to have a selection of vehicle types so I thought it would be good to create a class with all the control functions etc and another one with data for each different type of vehicle (max speed etc). So I started looking up how to do subclassing and did some experimentation but it really isn't working the way I imagined.
What I did was create a script (extends VehicleBody) then gave that a class_name of VehicleData and defined a bunch of exported variables. Then I created a new stand-alone script that extends VehicleData and put in a func _init(): that just prints a string and one value from VehicleData. Nothing happens though, no string and no number. I put in a func _ready(): just because but that does nothing either.
So basicallly something like this:
extends VehicleBody
class_name VehicleData
export var number= 200.0
func _ready():
pass
Then a child class
extends VehicleData
func _init():
print(`"Child " + str(number))
But I see nothing printed. How would I actually do this?