Author Topic: Crash when spawning Vehicle  (Read 854 times)

I decided to make a quick fun private vehicle. It was simple to code. When I spawned my vehicle my Blockland crashed. It happens everytime I spawn it. I have no idea in scripting vehicles so some code may be stupid.

Quote
datablock WheeledVehicleData(FlyingHorseVehicle)
{
   category = "Vehicles";
   displayName = " ";
   shapeFile = "Add-ons/Vehicle_Horse/horse.dts"; //"~/data/shapes/skivehicle.dts"; //
   emap = true;
   minMountDist = 3;
   
   numMountPoints = 1;
   mountThread[0] = "sit";

   maxDamage = 200.00;
   destroyedLevel = 200.00;
   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 = VehicleTireEmitter; // 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 = 0;

   // Rigid Body
   mass = 200;
   density = 5.0;
   drag = 0.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 = 4000;        // When brakes are applied
   maxWheelSpeed = 20;        // 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;

   isSled = false;

   forwardThrust      = 3000;
   reverseThrust      = 2000;
   lift         = 100;
   maxForwardVel      = 40;
   maxReverseVel      = 40;
   horizontalSurfaceForce   = 130;   // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
   verticalSurfaceForce   = 130;
   rollForce      = 4000;
   yawForce      = 6000;
   pitchForce      = 6000;
   rotationalDrag      = 0.5;
   stallSpeed      = 10;

//   forwardThrust      = 2000;
//   reverseThrust      = 2000;
//   lift         = 100;
//   maxForwardVel      = 70;
//   maxReverseVel      = 70;
//   horizontalSurfaceForce   = 100;   // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
//   verticalSurfaceForce   = 100;
//   rollForce      = 6000;
//   yawForce      = 6000;
//   pitchForce      = 4000;
//   rotationalDrag      = 0.5;
//   stallSpeed      = 10;
//
//   forwardThrust      = 2500;
//   reverseThrust      = 500;
//   lift         = 15000;
//   maxForwardVel      = 60;
//   maxReverseVel      = 10;
//   horizontalSurfaceForce   = 500;   // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
//   verticalSurfaceForce   = 500;
//   rollForce      = 5000;
//   yawForce      = 5000;
//   pitchForce      = 5000;
//   rotationalDrag      = 0.1;
//   stallSpeed      = 10;

   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 = "Flying Horse";
   rideable = true;
      lookUpLimit = 0.65;
      lookDownLimit = 0.45;

   paintable = true;
   

   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

   steeringUseStrafeSteering = false; //this vehicle has pitch control, so we can't use strafe steering
};






is the LOD 0?
I'm sorry but what is LOD? I still am beginning scripting and only have scripted weapons, playertypes, and simple scripts. I never worked with vehicles.

I'm sorry but what is LOD? I still am beginning scripting and only have scripted weapons, playertypes, and simple scripts. I never worked with vehicles.
It's on the model.

When I was making a vehicle once, the model didn't have correct LOD and I crashed when I spawned it.

It's on the model.

When I was making a vehicle once, the model didn't have correct LOD and I crashed when I spawned it.
Isnt it the wheel mount points? If so I guese I can ask someone I know if they can add them.

Isnt it the wheel mount points? If so I guese I can ask someone I know if they can add them.
what

what
Im using te horse model. Theres no points on the model for wheels and I'm using it as a wheeled vehicle. Couldnt I edit the horse model and add wheel points?

No you couldn't. Unless you imported the .dts file into shaper then moved it to milkshape and edited it from there. And also Otto I am pretty sure LOD for vehicles is a multiple of 16. Because if the LOD is 0 for my vehicles then it just crashes me. It can be 0 if it is a bot like the horse is.

I actually used a LOD of 100 at first, but it made the model really bright, but I didn't crash.

Wheel points aren't required, last time I checked.


I haven't done anything with vehicles in a long time. I don't know for sure, but try changing numMountPoints to 0.

Playertypes are supposed to have LOD 100.


No you couldn't. Unless you imported the .dts file into shaper then moved it to milkshape and edited it from there. And also Otto I am pretty sure LOD for vehicles is a multiple of 16. Because if the LOD is 0 for my vehicles then it just crashes me. It can be 0 if it is a bot like the horse is.
Its not a bot.