You need to package that one, so it calls the original WheeledVehicleData::onAdd.
function TankVehicle::onAdd(%this,%obj){ // Setup the car with some defaults tires & springs for(%i = 0; %i < %this.numWheels; %i++) { %obj.setWheelTire(%i, %this.defaultTire); %obj.setWheelSpring(%i, %this.defaultSpring); } // 4 wheel steering %obj.setWheelSteering(0,1); %obj.setWheelSteering(1,1); %obj.setWheelSteering(2,-0.8); %obj.setWheelSteering(3,-0.8); // 4 wheel drive %obj.setWheelPowered(0,true); %obj.setWheelPowered(1,true); %obj.setWheelPowered(2,true); %obj.setWheelPowered(3,true); // turret %t = new AIPlayer() { dataBlock = TankTurretPlayer; }; if(isObject(%t)) //creation can fail due to quota limit { MissionCleanup.add(%t); %obj.mountObject(%t, 2); %obj.turret = %t; %t.schedule(10,"rigTurret"); } %obj.creationTime = getSimTime(); }
You do not need the parent for custom datablocks ::onAdd.
Turns out I'm most likely wrong, you need to add the parent, but, if you're not going to do anything special with the vehicle don't use ::onAdd.