Author Topic: Vehicle makes BL crash  (Read 1818 times)

i know there is something wrong in the script but i can not find it, any help?
(yes i have made the .dsq files and the animation in the model)
The game crashes when i spawn the vehicle.

(Though there might be a problem in the model, but the only people who could possibly help with that is kaje or badspot D: )
Code: [Select]
// Load dts shapes and merge animations
datablock TSShapeConstructor(MechDts)
{
baseShape  = "add-ons/mech/mech.dts";
sequence0  = "add-ons/mech/mech_root.dsq";

sequence1  = "add-ons/mech/mech_run.dsq";
sequence2  = "add-ons/mech/mech_run.dsq";
sequence3  = "add-ons/mech/mech_run.dsq";
sequence4  = "add-ons/mech/mech_run.dsq";

sequence5  = "add-ons/mech/mech_root.dsq";
sequence6  = "add-ons/mech/mech_run.dsq";
sequence7  = "add-ons/mech/mech_run.dsq";
sequence8  = "add-ons/mech/mech_run.dsq";

sequence9  = "add-ons/mech/mech_root.dsq";
sequence10 = "add-ons/mech/mech_root.dsq";
sequence11 = "add-ons/mech/mech_root.dsq";

sequence12 = "add-ons/mech/mech_jump.dsq";
sequence13 = "add-ons/mech/mech_jump.dsq";
sequence14 = "add-ons/mech/mech_root.dsq";
sequence15 = "add-ons/mech/mech_root.dsq";

sequence16 = "add-ons/mech/mech_root.dsq";
sequence17 = "add-ons/mech/mech_root.dsq";
sequence18 = "add-ons/mech/mech_root.dsq";
sequence19 = "add-ons/mech/mech_root.dsq";
sequence20 = "add-ons/mech/mech_root.dsq"; 
sequence21 = "add-ons/mech/mech_root.dsq";

sequence22 = "add-ons/mech/mech_root.dsq"; 

sequence23 = "add-ons/mech/mech_root.dsq";

sequence24 = "add-ons/mech/mech_root.dsq";
sequence25 = "add-ons/mech/mech_root.dsq";
sequence26 = "add-ons/mech/mech_root.dsq";
sequence27 = "add-ons/mech/mech_root.dsq";
sequence28 = "add-ons/mech/mech_root.dsq";
sequence29 = "add-ons/mech/mech_root.dsq";
sequence30 = "add-ons/mech/mech_root.dsq";
sequence31 = "add-ons/mech/mech_root.dsq";

sequence32 = "add-ons/mech/mech_root.dsq";
sequence33 = "add-ons/mech/mech_root.dsq";

sequence34 = "add-ons/mech/mech_root.dsq";

sequence35 = "add-ons/mech/mech_root.dsq";
};   


datablock AudioProfile(MechFootFallSound)
{
   fileName = "base/data/sound/pain.wav";
   description = AudioClose3d;
   preload = true;
};

datablock AudioProfile(MechJumpSound)
{
   fileName = "./sound/jumphorse.wav";
   description = AudioClose3d;
   preload = true;
};


datablock DebrisData( MechDebris )
{
   explodeOnMaxBounce = false;

   elasticity = 0.15;
   friction = 0.5;

   lifetime = 4.0;
   lifetimeVariance = 0.0;

   minSpinSpeed = 40;
   maxSpinSpeed = 600;

   numBounces = 5;
   bounceVariance = 0;

   staticOnMaxBounce = true;
   gravModifier = 1.0;

   useRadiusMass = true;
   baseRadius = 1;

   velocity = 20.0;
   velocityVariance = 12.0;
};             

datablock PlayerData(MechArmor)
{
   renderFirstPerson = false;
   emap = false;
   
   className = Armor;
   shapeFile = "add-ons/mech/Mech.dts";
   cameraMaxDist = 8;
   cameraTilt = 0.261;//0.174 * 2.5; //~25 degrees
   cameraVerticalOffset = 2.3;
   computeCRC = false;
 
   canObserve = true;
   cmdCategory = "Clients";

   cameraDefaultFov = 90.0;
   cameraMinFov = 5.0;
   cameraMaxFov = 120.0;
   
   //debrisShapeName = "~/data/shapes/player/debris_player.dts";
   //debris = MechDebris;

   aiAvoidThis = true;

   minLookAngle = -1.5708;
   maxLookAngle = 1.5708;
   maxFreelookAngle = 3.0;

   mass = 90;
   drag = 0.1;
   maxdrag = 0.52;
   density = 0.7;
   maxDamage = 250;
   maxEnergy =  10;
   repairRate = 0.33;
   energyPerDamagePoint = 75.0;

   rechargeRate = 0.4;

   runForce = 28 * 90;
   runEnergyDrain = 0;
   minRunEnergy = 0;
   maxForwardSpeed = 12;
   maxBackwardSpeed = 6;
   maxSideSpeed = 1;

   maxForwardCrouchSpeed = 12;
   maxBackwardCrouchSpeed = 6;
   maxSideCrouchSpeed = 1;

   maxForwardProneSpeed = 0;
   maxBackwardProneSpeed = 0;
   maxSideProneSpeed = 0;

   maxForwardWalkSpeed = 0;
   maxBackwardWalkSpeed = 0;
   maxSideWalkSpeed = 0;

   maxUnderwaterForwardSpeed = 8.4;
   maxUnderwaterBackwardSpeed = 7.8;
   maxUnderwaterSideSpeed = 7.8;

   jumpForce = 17 * 90; //8.3 * 90;
   jumpEnergyDrain = 0;
   minJumpEnergy = 0;
   jumpDelay = 0;

   minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 1;

   recoverDelay = 0;
   recoverRunForceScale = 1.2;

   minImpactSpeed = 250;
   speedDamageScale = 3.8;

   boundingBox = vectorScale("2.5 2.5 2.4", 4); //"2.5 2.5 2.4";
   crouchBoundingBox = vectorScale("2.5 2.5 2.4", 4); //"2.5 2.5 2.4";
   proneBoundingBox = vectorScale("2.5 2.5 2.4", 4); //"2.5 2.5 2.4";

   pickupRadius = 0.75;
   
   // Damage location details
   boxNormalHeadPercentage       = 0.83;
   boxNormalTorsoPercentage      = 0.49;
   boxHeadLeftPercentage         = 0;
   boxHeadRightPercentage        = 1;
   boxHeadBackPercentage         = 0;
   boxHeadFrontPercentage        = 1;

   // Foot Prints
   //decalData   = MechFootprint;
   //decalOffset = 0.25;

   jetEmitter = playerJetEmitter;
   jetGroundEmitter = playerJetGroundEmitter;
   jetGroundDistance = 8;
 
   //footPuffEmitter = LightPuffEmitter;
   footPuffNumParts = 10;
   footPuffRadius = 0.25;

   //dustEmitter = LiftoffDustEmitter;

   splash = PlayerSplash;
   splashVelocity = 4.0;
   splashAngle = 67.0;
   splashFreqMod = 300.0;
   splashVelEpsilon = 0.60;
   bubbleEmitTime = 0.1;
   splashEmitter[0] = PlayerFoamDropletsEmitter;
   splashEmitter[1] = PlayerFoamEmitter;
   splashEmitter[2] = PlayerBubbleEmitter;
   mediumSplashSoundVelocity = 10.0;   
   hardSplashSoundVelocity = 20.0;   
   exitSplashSoundVelocity = 5.0;

   // Controls over slope of runnable/jumpable surfaces
   runSurfaceAngle  = 85;
   jumpSurfaceAngle = 86;

   minJumpSpeed = 20;
   maxJumpSpeed = 30;

   horizMaxSpeed = 68;
   horizResistSpeed = 33;
   horizResistFactor = 0.35;

   upMaxSpeed = 80;
   upResistSpeed = 15;
   upResistFactor = 0.3;
   
   footstepSplashHeight = 0.35;

   //NOTE:  some sounds commented out until wav's are available

   JumpSound = MechJumpSound;

   // Footstep Sounds
   FootSoftSound        = MechFootFallSound;
   FootHardSound        = MechFootFallSound;
   FootMetalSound       = MechFootFallSound;
   FootSnowSound        = MechFootFallSound;
   FootShallowSound     = MechFootFallSound;
   FootWadingSound      = MechFootFallSound;
   FootUnderwaterSound  = MechFootFallSound;
   //FootBubblesSound     = FootLightBubblesSound;
   //movingBubblesSound   = ArmorMoveBubblesSound;
   //waterBreathSound     = WaterBreathMaleSound;

   //impactSoftSound      = ImpactLightSoftSound;
   //impactHardSound      = ImpactLightHardSound;
   //impactMetalSound     = ImpactLightMetalSound;
   //impactSnowSound      = ImpactLightSnowSound;
   
   //impactWaterEasy      = ImpactLightWaterEasySound;
   //impactWaterMedium    = ImpactLightWaterMediumSound;
   //impactWaterHard      = ImpactLightWaterHardSound;
   
   groundImpactMinSpeed    = 10.0;
   groundImpactShakeFreq   = "4.0 4.0 4.0";
   groundImpactShakeAmp    = "1.0 1.0 1.0";
   groundImpactShakeDuration = 0.8;
   groundImpactShakeFalloff = 10.0;
   
   //exitingWater         = ExitingWaterLightSound;
   
   observeParameters = "0.5 4.5 4.5";

   // Inventory Items
maxItems   = 10; //total number of bricks you can carry
maxWeapons = 5; //this will be controlled by mini-game code
maxTools = 5;

uiName = "Mech";
rideable = true;
lookUpLimit = 0.6;
lookDownLimit = 0.2;

canRide = false;
showEnergyBar = false;
paintable = true;

brickImage = MechBrickImage; //the imageData to use for brick deployment

   numMountPoints = 4;
   mountThread[0] = "root";
   mountThread[1] = "root";
   mountThread[2] = "root";
   mountThread[3] = "root";
};



function MechArmor::onAdd(%this,%obj)
{
   // Vehicle timeout
   %obj.mountVehicle = true;

   // Default dynamic armor stats
   %obj.setRechargeRate(%this.rechargeRate);
   %obj.setRepairRate(0);

}

function MechArmor::onDriverLeave(%obj, %player)
{
//do nothing
}

Methinks that vehicles aren't players; they don't need weapon slots, inventory slots, or any of the like. XD

Methinks that vehicles aren't players; they don't need weapon slots, inventory slots, or any of the like. XD
its based 100% on the horse script. yes it is needed.

The horse is a player type, not just a vehicle. So I often hear of this problem. Other than that I don't know how to help. I also noticed it said "mech"!!

The horse is a player type, not just a vehicle. So I often hear of this problem. Other than that I don't know how to help. I also noticed it said "mech"!!
yup ;D full animated. once i get it working, ill add the weapons.

Make sure you have bounding box checked when you export it

Make sure you have bounding box checked when you export it
your a idiot, im not some noob at this stuff -_-..... iv made MANY models before. also it uses a custom collision mesh (10 vertexs)
« Last Edit: October 19, 2007, 12:19:02 AM by BattleKon001 »

Sheesh i was just trying to help

You screwed up the shape constructor and left out the animation names so the engine doesn't know which animation to play. The engine will normally crash if you don't have the vital animations defined such as root/run/jump/death/fall etc. Yours should look like this:

Code: [Select]
datablock TSShapeConstructor(MechDts)
{
baseShape  = "add-on/mech/mech.dts";
sequence0  = "add-ons/mech/mech_root.dsq root";

sequence1  = "add-ons/mech/mech_run.dsq run";
sequence2  = "add-ons/mech/mech_run.dsq walk";
sequence3  = "add-ons/mech/mech_run.dsq back";
sequence4  = "add-ons/mech/mech_run.dsq side";

sequence5  = "add-ons/mech/mech_root.dsq crouch";
sequence6  = "add-ons/mech/mech_run.dsq crouchRun";
sequence7  = "add-ons/mech/mech_run.dsq crouchBack";
sequence8  = "add-ons/mech/mech_run.dsq crouchSide";

sequence9  = "add-ons/mech/mech_root.dsq look";
sequence10 = "add-ons/mech/mech_root.dsq headside";
sequence11 = "add-ons/mech/mech_root.dsq headUp";

sequence12 = "add-ons/mech/mech_jump.dsq jump";
sequence13 = "add-ons/mech/mech_jump.dsq standjump";
sequence14 = "add-ons/mech/mech_root.dsq fall";
sequence15 = "add-ons/mech/mech_root.dsq land";

sequence16 = "add-ons/mech/mech_root.dsq armAttack";
sequence17 = "add-ons/mech/mech_root.dsq armReadyLeft";
sequence18 = "add-ons/mech/mech_root.dsq armReadyRight";
sequence19 = "add-ons/mech/mech_root.dsq armReadyBoth";
sequence20 = "add-ons/mech/mech_root.dsq spearready"; 
sequence21 = "add-ons/mech/mech_root.dsq spearThrow";

sequence22 = "add-ons/mech/mech_root.dsq talk"; 

sequence23 = "add-ons/mech/mech_root.dsq death1";

sequence24 = "add-ons/mech/mech_root.dsq shiftUp";
sequence25 = "add-ons/mech/mech_root.dsq shiftDown";
sequence26 = "add-ons/mech/mech_root.dsq shiftAway";
sequence27 = "add-ons/mech/mech_root.dsq shiftTo";
sequence28 = "add-ons/mech/mech_root.dsq shiftLeft";
sequence29 = "add-ons/mech/mech_root.dsq shiftRight";
sequence30 = "add-ons/mech/mech_root.dsq rotCW";
sequence31 = "add-ons/mech/mech_root.dsq rotCCW";

sequence32 = "add-ons/mech/mech_root.dsq undo";
sequence33 = "add-ons/mech/mech_root.dsq plant";

sequence34 = "add-ons/mech/mech_root.dsq sit";

sequence35 = "add-ons/mech/mech_root.dsq wrench";
};

You screwed up the shape constructor and left out the animation names so the engine doesn't know which animation to play. The engine will normally crash if you don't have the vital animations defined such as root/run/jump/death/fall etc. Yours should look like this:

Code: [Select]
datablock TSShapeConstructor(MechDts)
{
baseShape  = "add-on/mech/mech.dts";
sequence0  = "add-ons/mech/mech_root.dsq root";

sequence1  = "add-ons/mech/mech_run.dsq run";
sequence2  = "add-ons/mech/mech_run.dsq walk";
sequence3  = "add-ons/mech/mech_run.dsq back";
sequence4  = "add-ons/mech/mech_run.dsq side";

sequence5  = "add-ons/mech/mech_root.dsq crouch";
sequence6  = "add-ons/mech/mech_run.dsq crouchRun";
sequence7  = "add-ons/mech/mech_run.dsq crouchBack";
sequence8  = "add-ons/mech/mech_run.dsq crouchSide";

sequence9  = "add-ons/mech/mech_root.dsq look";
sequence10 = "add-ons/mech/mech_root.dsq headside";
sequence11 = "add-ons/mech/mech_root.dsq headUp";

sequence12 = "add-ons/mech/mech_jump.dsq jump";
sequence13 = "add-ons/mech/mech_jump.dsq standjump";
sequence14 = "add-ons/mech/mech_root.dsq fall";
sequence15 = "add-ons/mech/mech_root.dsq land";

sequence16 = "add-ons/mech/mech_root.dsq armAttack";
sequence17 = "add-ons/mech/mech_root.dsq armReadyLeft";
sequence18 = "add-ons/mech/mech_root.dsq armReadyRight";
sequence19 = "add-ons/mech/mech_root.dsq armReadyBoth";
sequence20 = "add-ons/mech/mech_root.dsq spearready"; 
sequence21 = "add-ons/mech/mech_root.dsq spearThrow";

sequence22 = "add-ons/mech/mech_root.dsq talk"; 

sequence23 = "add-ons/mech/mech_root.dsq death1";

sequence24 = "add-ons/mech/mech_root.dsq shiftUp";
sequence25 = "add-ons/mech/mech_root.dsq shiftDown";
sequence26 = "add-ons/mech/mech_root.dsq shiftAway";
sequence27 = "add-ons/mech/mech_root.dsq shiftTo";
sequence28 = "add-ons/mech/mech_root.dsq shiftLeft";
sequence29 = "add-ons/mech/mech_root.dsq shiftRight";
sequence30 = "add-ons/mech/mech_root.dsq rotCW";
sequence31 = "add-ons/mech/mech_root.dsq rotCCW";

sequence32 = "add-ons/mech/mech_root.dsq undo";
sequence33 = "add-ons/mech/mech_root.dsq plant";

sequence34 = "add-ons/mech/mech_root.dsq sit";

sequence35 = "add-ons/mech/mech_root.dsq wrench";
};
ah
*tries*
it spawned for a second then...then crashed

Try spawning the model as a TSStatic first to make sure it isn't the model causing problems.

A mech would be very cool.  Please don't make a stuffty model.


nope model loads fine....hmm