Game Development Community

Problem Exporting Wheeled Vehicle From Max

by Bill Henderson · in Torque Game Engine · 03/10/2002 (4:30 pm) · 5 replies

Hello...

I am currently attempting to get my first wheeled vehicle into our game.

I am using the latest HEAD release as of March 10, 10:00 PST.

What I have done is simply copy car.cs in the racing mod and edit the file to point to my files.

I am using MAX 3.1 to export my models to dts.

The problems i am having are:
- when the minecart is loaded, the wheels do not load...
- the mincart is dropped, lands on the proper part of the cart, but then tips over to its right side.

I have read all of the newest information on wheeled vehicles, but to no avail.

Please help me!! I began this at 10AM, and its now 4:36PM and have really, no progress...

#1
03/10/2002 (4:40 pm)
the max file for the minecart is here:
alpha.rbss.net/rbss/students/2002/mdixon/files/cart.zip
#2
03/10/2002 (11:41 pm)
Bill,

a few questions:

Are there any errors in the console referring to a .cc file issue?

Did you have a previous version installed (1.1.1) and then overwrite it with the HEAD via CVS?

Did the model that comes WITH the car demo work for you, or just your model does not work?

I had a similar problem when I had a previous version installed , and updated with CVS. I deleted the whole folder, redownloaded the head and recompiled and it fixed my problem.

Good luck, post any follow ups and I can test it for you if none of these reccomendations helped.
#3
03/11/2002 (12:36 am)
All right, here's the low-down:

The console log is completly normal (as in no errors, etc.), the version we were testing with was a fresh download, no update, and it was the cvs head as of March 10th.

The default car that comes with the racing mod works absolutely fine (it's quite fun!!).

I will post the script for the minecart (just a copy of the default car.cs) and the console log file...in case I missed something.
#4
03/11/2002 (12:43 am)
heres the important part of the console log:

Loading compiled script racing/server/scripts/minecart.cs.
*** LOADING MISSION: racing/data/missions/track1.mis
*** Stage 1 load
*** Stage 2 load
Executing racing/data/missions/track1.mis.
*** Mission loaded
CADD: 1473 local
*** Sending mission load to client: racing/data/missions/track1.mis
*** New Mission: racing/data/missions/track1.mis
*** Phase 1: Download Datablocks & Targets
Validation required for shape: fps/data/shapes/player/player.dts
*** Phase 2: Download Ghost Objects
*** Phase 3: Mission Lighting
Successfully loaded mission lighting file: 'racing/data/missions/track1_d9fd5b87.ml'
Mission lighting done
#5
03/11/2002 (12:46 am)
###Here is the minecart.cs file.....in its entire form.
Sorry for the length...Its 1AM and I want to go to bed.
.
.
..
..
...
datablock ParticleData(TireParticle)
{
textureName = "~/data/shapes/car/dustParticle";
dragCoefficient = 2.0;
gravityCoefficient = -0.1;
inheritedVelFactor = 0.1;
constantAcceleration = 0.0;
lifetimeMS = 1000;
lifetimeVarianceMS = 0;
colors[0] = "0.46 0.36 0.26 1.0";
colors[1] = "0.46 0.46 0.36 0.0";
sizes[0] = 0.50;
sizes[1] = 1.0;
};

datablock ParticleEmitterData(TireEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 1;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 5;
thetaMax = 20;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "TireParticle";
};


//----------------------------------------------------------------------------

datablock WheeledVehicleTire(DefaultCarTire)
{
// Tires act as springs and generate lateral and longitudinal
// forces to move the vehicle. These distortion/spring forces
// are what convert wheel angular velocity into forces that
// act on the rigid body.
shapeFile = "~/data/shapes/minecart/minecarttire.dts";
friction = 1.5;

// Spring that generates lateral tire forces
lateralForce = 6000;
lateralDamping = 400;
lateralRelaxation = 1;

// Spring that generates longitudinal tire forces
longitudinalForce = 6000;
longitudinalDamping = 400;
longitudinalRelaxation = 1;
};

datablock WheeledVehicleSpring(DefaultCarSpring)
{
// Wheel suspension properties
length = 0.01; // Suspension travel
force = 2200; // Spring force
damping = 1600; // Spring damping
antiSwayForce = 3; // Lateral anti-sway force
};

datablock WheeledVehicleData(DefaultCar)
{
category = "Vehicles";
shapeFile = "~/data/shapes/minecart/minecart.dts";

maxDamage = 1.5;
destroyedLevel = 1.0;

cameraMaxDist = 5;
cameraOffset = 1;

maxSteeringAngle = 0.785; // Maximum steering angle, should match animation
integration = 4; // Force integration time: TickSec/Rate
tireEmitter = TireEmitter; // All the tires use the same dust emitter

// Rigid Body
mass = 200;
bodyFriction = 0.6;
bodyRestitution = 0.4;
minImpactSpeed = 5; // Impacts over this invoke the script callback
softImpactSpeed = 5; // Play SoftImpact Sound
hardImpactSpeed = 15; // Play HardImpact Sound

// Engine
engineTorque = 4000; // Engine power
engineBrake = 600; // Braking when throttle is 0
brakeTorque = 2000; // When brakes are applied
maxWheelSpeed = 30; // Engine scale by current speed / max speed

// Energy
maxEnergy = 100;
jetForce = 3000;
minJetEnergy = 30;
jetEnergyDrain = 2;

// Sounds
// jetSound = ScoutThrustSound;
// engineSound = ScoutEngineSound;
// squealSound = ScoutSquealSound;
// softImpactSound = SoftImpactSound;
// hardImpactSound = HardImpactSound;
// wheelImpactSound = WheelImpactSound;

// explosion = VehicleExplosion;
};


//-----------------------------------------------------------------------------

function WheeledVehicleData::create(%block)
{
%obj = new WheeledVehicle() {
dataBlock = %block;
};
return(%obj);
}

//-----------------------------------------------------------------------------

function WheeledVehicleData::onAdd(%this,%obj)
{
// Setup the car with some defaults tires & springs
for (%i = %obj.getWheelCount() - 1; %i >= 0; %i--) {
%obj.setWheelTire(%i,DefaultCarTire);
%obj.setWheelSpring(%i,DefaultCarSpring);
}
}