Author Topic: Skateboard coding help  (Read 820 times)

Alright a user of the forums named Pi has given me the pieces needed to create a skateboard HOWEVER I don't have a clue about scripting and editing a script (which I have tried) doesn't work for me because I'm not very good at it, so can someone please help me with this? I have the main board itself and as a separate model a wheel...please help someone. (If you would like to help please message me. ASAP)


(this has been posted on 2 forums because it technically belongs in either but this one seems to fit more)

alright i have a script now but not sure whats wrong with it, can someone tell me and hopefully fix it please?


When I spawn it, it crashes the server.



Code: [Select]
// Vehicle //
/////////////
datablock WheeledVehicleData(SkateVehicle)
{
category = "Vehicles";
displayName = "Skate";
shapeFile = "./skate.dts"; //"~/data/shapes/skate.dts"; //
emap = true;
minMountDist = 3;
   
   numMountPoints = 1;
   mountThread[0] = "sit";

maxDamage = 50.00;
destroyedLevel = 50.00;
speedDamageScale = 1.04;
collDamageThresholdVel = 20.0;
collDamageMultiplier   = 0.02;

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

// 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;

// 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;

   // Advanced Steering
   steeringAutoReturn = true;
   steeringAutoReturnRate = 0.9;
   steeringAutoReturnMaxSpeed = 10;
   steeringUseStrafeSteering = true;
   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 = "Skate ";
rideable = true;
lookUpLimit = 0.65;
lookDownLimit = 0.45;

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

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

   numDmgEmitterAreas = 1;
   burnTime = 4000;

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

   //protection for passengers
   protectPassengersBurn   = false;  //protect passengers from the burning effect of explosions?
   protectPassengersRadius = false;  //protect passengers from radius damage (explosions) ?
   protectPassengersDirect = false; //protect passengers from direct damage (bullets) ?
};

« Last Edit: January 02, 2010, 01:34:48 PM by naturemon »

You have no wheels in that script. The vehicle probably doesn't have a collision mesh.

ohh alright so could you modify the script so it has wheels please? I'm not a scripter so..i don't even understand what i would be doing.

You have no wheels in that script. The vehicle probably doesn't have a collision mesh.
Damnit it does. It is a cube named "colcollision-1".

Hmm so wheels would be the problem?

Anyone feel generous enough to post a working script?

(If you need the files please message me)

bump...60 views no help...


   displayName = "Skate";
Change that back to " ". Also instead of just posting the code, put it in [ code ] [ /code ] tags.

EDIT:
Damnit it does. It is a cube named "colcollision-1".
Try just "collision-1".
« Last Edit: January 02, 2010, 10:11:30 AM by Crysist »

Check the god damn console

Glass...I can't check something that is crashed once it is spawned with this code..

Glass...I can't check something that is crashed once it is spawned with this code..
It's likely a problem with the model.

Hmm Alright, I'll check into this and thanks for the help..