Vehicle Datablock - Nevermind
by Randy Hearn - Magnum · in Torque 3D Professional · 10/29/2009 (9:49 pm) · 3 replies
Not interested in arguing different ways of doing something, only making what is defined easy for someone new to follow.
About the author
Technical Product Designer (Mechanical Design) for Boeing for over 25 years working with CAD and PLM systems. I have a Associates Degree in Business and a partial B.S. in Game and Simulation, just couldn't see paying the costs for some of the classes.
#2
Except for the tires and springs as they are hardcoded to be the Default tire instead of being readily re-defined.
Now if I have a Semi with possibly 18 wheels. Well then yea, perhaps a new onAdd and others:) I don't plan to have a generic game either, but no need to add additional code if it's not necessary.
10/30/2009 (11:23 pm)
I believe what you are talking about is defined in the comments of vehicle.cs in the next few lines (special or unique vehicles). The goal is not to have to duplicate code unless you have a specific need to. Everything you mention can be handle with one onAdd and simply pass in defined variables.Except for the tires and springs as they are hardcoded to be the Default tire instead of being readily re-defined.
Now if I have a Semi with possibly 18 wheels. Well then yea, perhaps a new onAdd and others:) I don't plan to have a generic game either, but no need to add additional code if it's not necessary.
// Special, or unique vehicles however will still require some scripting. They // may need to override the onAdd() function in order to mount weapons, // differing tires/springs, etc., almost everything else is taken care of in the // WheeledVehicleData and VehicleData methods. This helps us by not having to // duplicate the same code for every new vehicle.
#3
not so,
I'm using custom wheels and springs, I can have 4 completely different wheels, of different sizes and shapes....
10/31/2009 (6:25 am)
"Except for the tires and springs as they are hardcoded to be the Default tire instead of being readily re-defined"not so,
I'm using custom wheels and springs, I can have 4 completely different wheels, of different sizes and shapes....
Torque Owner deepscratch
DeepScratchStudios
a VW Beetle is a lot different to a tractor, in every way, and what if I want a car with dodgy brakes? or a strong suspension? or one vehicle has headlights on?
I would say that it IS necessary to have unique onAdd's for each vehicle.
"generic" is exactly that.
I dont want to release a "generic" game, so I spend an extra 10 minutes on each vehicles script file, making them unique for vehicle type, all Beetles are Beetles, but one might be a Baja......
ditto for characters.