Error creating Hover Vehicles
by Anthony Hopkins · in Torque Game Engine · 10/26/2009 (3:56 pm) · 1 replies
Hi,
I'm new to Torque and have been playing with the vehicle datablocks. I had trouble getting a HoverVehicle object to be created.
I have something like that in my new script defaultShip.cs
I have edited the datablockExec.cs too
I know I need several functions like create, onAdd, to make run my game, but I have no idea of how and where put this functions.
I have been trying to fix it up, but everytime I "add" a BattleShip to my mission, it does nothing, and in the console appears:
"15: Register object failed for object (null) of class HoverVehicle"
All the paths are ok, so I am pretty sure this is not the problem.
Any idea?
Thank you very much.
I'm new to Torque and have been playing with the vehicle datablocks. I had trouble getting a HoverVehicle object to be created.
I have something like that in my new script defaultShip.cs
datablock HoverVehicleData(BattleShip)
{
mountable = true;
swappable = false;
mountPose[0] = sitting;
numMountPoints = 1;
category = "Vehicles";
shapeFile = "art/shapes/Aircraft/bioship1(2.0).dts";
computeCRC = false;
integration = 4;
collisionTol = 0.1;
contactTol = 0.1;
drag = 0.0;
density = 0.3; // Will float in water
mass = 40;
bodyFriction = 0;
bodyRestitution = 0.5;
mainThrustForce = 1000;
reverseThrustForce = 700;
strafeThrustForce = 800;
stabSpringConstant = 100;
stabDampingConstant = 80;
dragForce = 10;
vertFactor = 1;
floatingThrustFactor = 1;
turboFactor = 1.5;
stabLenMin = 6.50;
stabLenMax = 7.25;
normalForce = 1000;
restorativeForce = 0;
steeringForce = 600;
gyroDrag = 40;
rollForce = 100;
pitchForce = 100;
floatingGravMag = 1;
brakingForce = 600;
brakingActivationSpeed = 10;
};I have edited the datablockExec.cs too
// Load up all datablocks. This function is called when
// a server is constructed.
// Do the sounds first -- later scripts/datablocks may need them
exec("./audioProfiles.cs");
// Do the various effects next -- later scripts/datablocks may need them
exec("./particles.cs");
exec("./environment.cs");
exec("./triggers.cs");
exec("./lights.cs");
// Add a rigid example
exec("./rigidShape.cs");
exec("./health.cs");
// Load our supporting weapon datablocks
exec("./weapon.cs");
// Load the weapon datablocks
exec("./weapons/rocketLauncher.cs");
// Load the default player datablocks
exec("./player.cs");
// Load our other player datablocks
exec("./aiPlayer.cs");
// Load the vehicle datablocks
exec("./vehicles/defaultCar.cs");
exec("./vehicles/defaultShip.cs");I know I need several functions like create, onAdd, to make run my game, but I have no idea of how and where put this functions.
I have been trying to fix it up, but everytime I "add" a BattleShip to my mission, it does nothing, and in the console appears:
"15: Register object failed for object (null) of class HoverVehicle"
All the paths are ok, so I am pretty sure this is not the problem.
Any idea?
Thank you very much.
Anthony Hopkins