Author Topic: Gah! My vehicle is a mess!  (Read 1546 times)

When I spawn my vehicle, Blockland crashes... Can anyone help me?

Vehicle_BlockoRacer.cs

Code: [Select]
//-----------------------------------------------------------------------------

// Information extacted from the shape.
//
// Wheel Sequences
//    spring#        Wheel spring motion: time 0 = wheel fully extended,
//                   the hub must be displaced, but not directly animated
//                   as it will be rotated in code.
// Other Sequences
//    steering       Wheel steering: time 0 = full right, 0.5 = center
//    breakLight     Break light, time 0 = off, 1 = breaking
//
// Wheel Nodes
//    hub#           Wheel hub, the hub must be in it's upper position
//                   from which the springs are mounted.
//
// The steering and animation sequences are optional.
// The center of the shape acts as the center of mass for the car.

//-----------------------------------------------------------------------------
if(!isObject(BlockoRacerExplosionSound))
{
   exec("./Support_BlockoRacer.cs");
}
//----------------------------------------------------------------------------

datablock WheeledVehicleData(BlockoRacerVehicle)
{
category = "Vehicles";
displayName = " ";
shapeFile = "./shapes/BlockoRacer.dts"; //"~/data/shapes/skivehicle.dts"; //
emap = true;
minMountDist = 3;
   
   numMountPoints = 1;
   mountThread[0] = "sit";

maxDamage = 200.00;
destroyedLevel = 200.00;
energyPerDamagePoint = 160;
speedDamageScale = 1.04;
collDamageThresholdVel = 20.0;
collDamageMultiplier   = 0.02;

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

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

// 3rd person camera settings
cameraRoll = false;         // Roll the camera with the vehicle
cameraMaxDist = 13;         // Far distance from vehicle
cameraOffset = 7.5;        // Vertical offset from camera mount point
cameraLag = 0.0;           // 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 = jeepTire;
defaultSpring = jeepSpring;
flatTire = jeepFlatTire;
flatSpring = jeepFlatSpring;

   numWheels = 4;

// Rigid Body
mass = 300;
density = 5.0;
drag = 1.6;
bodyFriction = 0.6;
bodyRestitution = 0.6;
minImpactSpeed = 10;        // Impacts over this invoke the script callback
softImpactSpeed = 10;       // Play SoftImpact Sound
hardImpactSpeed = 15;      // Play HardImpact Sound
groundImpactMinSpeed    = 10.0;

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

rollForce = 900;
yawForce = 600;
pitchForce = 1000;
rotationalDrag = 0.2;

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

splash = BlockoRacerSplash;
splashVelocity = 4.0;
splashAngle = 67.0;
splashFreqMod = 300.0;
splashVelEpsilon = 0.60;
bubbleEmitTime = 1.4;
splashEmitter[0] = BlockoRacerFoamDropletsEmitter;
splashEmitter[1] = BlockoRacerFoamEmitter;
splashEmitter[2] = BlockoRacerBubbleEmitter;
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 = "BlockoRacer ";
rideable = true;
lookUpLimit = 0.65;
lookDownLimit = 0.45;

paintable = true;
   
   damageEmitter[0] = BlockoRacerBurnEmitter;
damageEmitterOffset[0] = "0.0 0.0 0.0 ";
damageLevelTolerance[0] = 0.99;

   damageEmitter[1] = BlockoRacerBurnEmitter;
damageEmitterOffset[1] = "0.0 0.0 0.0 ";
damageLevelTolerance[1] = 1.0;

   numDmgEmitterAreas = 1;

   initialExplosionProjectile = BlockoRacerExplosionProjectile;
   initialExplosionOffset = 0;         //offset only uses a z value for now

   burnTime = 4000;

   finalExplosionProjectile = BlockoRacerFinalExplosionProjectile;
   finalExplosionOffset = 0.5;          //offset only uses a z value for now


   minRunOverSpeed    = 2;   //how fast you need to be going to run someone over (do damage)
   runOverDamageScale = 5;   //when you run over someone, speed * runoverdamagescale = damage amt
   runOverPushScale   = 1.2; //how hard a person you're running over gets pushed
};
« Last Edit: June 05, 2008, 03:15:48 AM by jaydee0004 »

Support_BlockoRacer.cs

Attached

Gah... Execution Time Limit... >_>

Possibly the vehicles collision is crashing it. Make your own Collision box around the vehicle.

Possibly the vehicles collision is crashing it. Make your own Collision box around the vehicle.

How do I make a Collision box? Just a box around it? i dunno

You shouldn't be making vehicles, to make a collision box first make a normal box around the vehicle that you want to be a collision, then goto groups and rename the shape collision. When you export it should have the Collision mesh option already selected then export it and try again.

Two-Tired epic phail...

Did I do anything wrong?

You've got to make a joint called "mass" below where the vehicle would hit the ground, so it will self-right to some extent.


Your vehicle is facing the wrong direction (mirror front/back)

It might be too small

Your vehicle is facing the wrong direction (mirror front/back)

It might be too small
I'm to good at making it face the right direction and completely forgot about that.

The bad thing right now is that when i drive it. If it runs at a certain speed, it will go slanted, like a handicapped drag racer whose front weight is like 0 grams.

Try using this script with your vehicle, you don't need any thing else but the jeep scripts enabled for it to work. If this doesn't work then it'll be your model.

acculy, it still has 4 wheels. Try to move the hub 0 and 2 and 1 and 3  further apart from each other