Vehicle needs script.

Author Topic: Vehicle needs script.  (Read 2694 times)

Well,I made the model for BSF(Blocko Space Fighter) but I can`t script.So look at this:http://www.mediafire.com/?a0vtjnyy09v
Follow the instructions,I`ll do some testing and if it has no bugs or glitches and works good,it will be my first add-on that I`ve modelled.Do not host it as your own,please.And no flaming about crappy model.
« Last Edit: October 28, 2007, 10:41:35 AM by jurttu »

i think the models pretty cool, is it the right size for the figure to fit? i cant help you with the script cause i dont know torque script, sry

The problem is,model doesn`t go to TGE,so I`m not sure it fits.If someone makes it still work and  the model is too big or small or something,its easy to resize.

Does it have a mount point? Otherwise, it won't work.

Yes,at that sphere thing.

I made a vehicle and it's on Add-Ons list but it says buffer overrun when i try and use it. Help please. Heres .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(coolExplosionSound))
{
   exec("./Support_cool.cs");
}
//----------------------------------------------------------------------------

datablock WheeledVehicleData(coolVehicle)
{
category = "Vehicles";
displayName = " ";
shapeFile = "./shapes/cool.dts"; //"~/data/shapes/skivehicle.dts"; //
emap = true;
minMountDist = 3;
   
   numMountPoints = 7;
   mountThread[0] = "sit";
   mountThread[1] = "sit";
   mountThread[2] = "sit";
   mountThread[3] = "sit";
   mountThread[4] = "sit";
   mountThread[5] = "root";
   mountThread[6] = "root";
   mountThread[7] = "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 = coolTire;
defaultSpring = coolSpring;
flatTire = coolFlatTire;
flatSpring = coolFlatSpring;

   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 = coolSplash;
splashVelocity = 4.0;
splashAngle = 67.0;
splashFreqMod = 300.0;
splashVelEpsilon = 0.60;
bubbleEmitTime = 1.4;
splashEmitter[0] = coolFoamDropletsEmitter;
splashEmitter[1] = coolFoamEmitter;
splashEmitter[2] = coolBubbleEmitter;
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 = "cool ";
rideable = true;
lookUpLimit = 0.65;
lookDownLimit = 0.45;

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

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

   numDmgEmitterAreas = 1;

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

   burnTime = 4000;

   finalExplosionProjectile = coolFinalExplosionProjectile;
   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
};

I can run this, but without the support_cool.cs it doesn't show up in game and when you check the support file it says buffer overrun. heres support.

www.freewebs.com/supportforcoll
« Last Edit: October 21, 2007, 04:55:46 PM by icyhot50 »

Post the console.log file in C:/Program Files/Blockland (or wherever you installed it) after getting a buffer overrun. Most likely it's a script error not a model error.

You should really make it use the jeep datablocks for everything except the debris - that's why it's a support file, so more than one add-on can use the same effects without creating more datablocks for no reason.

Good that even someone is interested.Btw,alert me if model causes much lag.

Post the console.log file in C:/Program Files/Blockland (or wherever you installed it) after getting a buffer overrun. Most likely it's a script error not a model error.

You should really make it use the jeep datablocks for everything except the debris - that's why it's a support file, so more than one add-on can use the same effects without creating more datablocks for no reason.

What?

Quote
Post the console.log file in C:/Program Files/Blockland (or wherever you installed it) after getting a buffer overrun. Most likely it's a script error not a model error.
Buffer overruns only happen when there is an error in the script - quotes or spaces in the wrong place, such as datablock names, can cause errors. I haven't looked at the Support_Cool file, so I don't know whether it went wrong there or in the 'main' one.

Quote
You should really make it use the jeep datablocks for everything except the debris - that's why it's a support file, so more than one add-on can use the same effects without creating more datablocks for no reason.
The particle effects, explosion projectiles, etc you used are exactly the same as the ones in the Jeep except for the name. If you made it exec Support_Jeep.cs and have the vehicle use them (defaultTire = jeepTire instead of coolTire) then people wouldn't have to load two sets of identical data on joining the server.

so what should I do to fix?

You know that black window that pops up when you start blockland? When you try to create a game, it will load all your add-ons and display what it is doing. If it encounters an error, such as buffer overrun, it will display it along with the Problem line of the error script. Copy that error and the line number and post it here so we can more easily determine the problem.

Just a little question,is it right sized?
And by the way,paintability would be nice,but not necessary.
I also would like to hear your progress.

Model wasn`t  right sized,please re-download.

Ok,I tried to script it,and here`s a problem:

I used Cap`s Stealth Fighter as a base script (Yes,I would give a credit to him if I just manage to get my crap work),and I only changed the shape file from sf.dts to bsf.dts but it still crashes the game.So,any way to fix it?
If vehicle works,there will be credits to someone who helps.

Things I`ve tried:

1.Changed script`s name to vehicle_bsf.
2.Changed shape file.
« Last Edit: November 01, 2007, 10:32:47 AM by jurttu »