Author Topic: How do I make vehicles go faster?  (Read 940 times)


I'm making a rather large raceway, and I would like to make the motorized soapbox racer travel at higher speeds. Tell me exactly what I need to do to this code to make the vehicle go faster.

Code: [Select]
uiName = "Soapbox Racer - Moterized ";
rideable = true;
lookUpLimit = 1.6;
lookDownLimit = 1.6;

paintable = true;


minRunOverSpeed    = 1;   //how fast you need to be going to run someone over (do damage)
runOverDamageScale = 10;   //when you run over someone, speed * runoverdamagescale = damage amt
runOverPushScale   = 10; //how hard a person you're running over gets pushed
};

datablock WheeledVehicleData(SoapboxRacerVehicle)
{
category = "Vehicles";
displayName = "";
shapeFile = "./SBR.dts";
emap = true;
minMountDist = 3;
   
numMountPoints = 1;
mountThread[0] = "sit";


massCenter = "0 0 0";
//massSoapboxRacer = "2 5 1";

maxSteeringAngle = 0.85;
integration = 4;
tireEmitter = VehicleTireEmitter;         



cameraRoll = false;         // Roll the camera with the vehicle
cameraMaxDist = 13;         // Far distance from vehicle
cameraOffset = 7.5;        // Vertical offset from camera mount point
cameraLag = 001;           // Velocity lag of camera
cameraDecay = 0.75;        // Decay per sec. rate of velocity lag
cameraTilt = 0.4;
collisionTol = 0.1;        // Collision distance tolerance
contactTol = 0.1;

useEyePoint = false;

defaultTire = SoapboxRacerTire;
defaultSpring = SoapboxRacerSpring;
flatTire = SoapboxRacerTire;
flatSpring = SoapboxRacerFlatSpring;

numWheels = 4;


mass = 400;
density = 5.0;
drag = 0.9;
bodyFriction = 0.6;
bodyRestitution = 0.6;
minImpactSpeed = 5;        // Impacts over this invoke the script callback
softImpactSpeed = 5;       // Play SoftImpact Sound
hardImpactSpeed = 15;      // Play HardImpact Sound
groundImpactMinSpeed    = 10.0;


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

rollForce = 1500;
yawForce = 1500;
pitchForce = 500;
rotationalDrag = 0.4;

   // Advanced Steering
   steeringAutoReturn = true;
   steeringAutoReturnRate = 0.9;
   steeringAutoReturnMaxSpeed = 10;
   steeringUseStrafeSteering = false;
   steeringStrafeSteeringRate = 0.1;

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

splash = vehicleSplash;
splashVelocity = 4.0;
splashAngle = 67.0;
splashFreqMod = 300.0;
splashVelEpsilon = 0.60;
bubbleEmitTime = 1.4;
splashEmitter[0] = vehicleFoamDropletsEmitter;
splashEmitter[1] = vehicleFoamEmitter;
splashEmitter[2] = vehicleBubbleEmitter;
mediumSplashSoundVelocity = 10.0;   
hardSplashSoundVelocity = 20.0;   
exitSplashSoundVelocity = 5.0;

//mediumSplashSound = "";
//hardSplashSound = "";
//exitSplashSound = "";

// Sounds
//   jetSound = ScoutThrustSound;
//engineSound = idleSound;
//squealSound = skidSound;
softImpactSound = slowImpactSound;
hardImpactSound = fastImpactSound;
//wheelImpactSound = slowImpactSound;

//   explosion = VehicleExplosion;
Justcollided = 0;

uiName = "Soapbox Racer ";
rideable = true;
lookUpLimit = 1.6;
lookDownLimit = 1.6;

paintable = true;


minRunOverSpeed    = 1;   //how fast you need to be going to run someone over (do damage)
runOverDamageScale = 10;   //when you run over someone, speed * runoverdamagescale = damage amt
runOverPushScale   = 10; //how hard a person you're running over gets pushed
};

function SoapboxRacerVehicle::onAdd(%this,%obj)
{
parent::onadd(%this,%obj);
%obj.mountable = true;

%obj.setWheelTire(0, SoapBoxRacerTire);
%obj.setWheelTire(1, SoapBoxRacerTire);
%obj.setWheelTire(2, SoapBoxRacerTire);
%obj.setWheelTire(3, SoapBoxRacerTire);

%obj.setWheelSpring(0, SoapBoxRacerSpring);
%obj.setWheelSpring(1, SoapBoxRacerSpring);
%obj.setWheelSpring(2, SoapBoxRacerSpring);
%obj.setWheelSpring(3, SoapBoxRacerSpring);

%obj.setWheelSteering(0,1);
%obj.setWheelSteering(1,1);
%obj.setWheelSteering(2,0);
%obj.setWheelSteering(3,0);

%obj.setWheelPowered(0,false);
    %obj.setWheelPowered(1,false);
%obj.setWheelPowered(2,false);
%obj.setWheelPowered(3,false);
}

Code: [Select]
engineTorque = 1500;that could be raised. many other values contribute to vehicle speed, but try raising that.