Author Topic: Magic Carpet Hover Effect on other Vehicles?  (Read 781 times)

After experimenting with the Magic Carpet vehicle, I found that these pieces of code make it hover:
Code: [Select]
hoverHeight             = 2.0;
createHoverHeight       = 2.0;

Now, I want to make this hovering effect work on other vehicles. How would I go about doing this?
Would I use one or both of those pieces of code, or would I need something entirely different piece to get it to work?
My last resort is invisible wheels, which I really would prefer to go this route instead.

(On the theory that the above code is all I would need to get it to work)
Let's say for example I wanted the Jeep to hover, where would I stick the code/what would I do to get this to work?


Code: [Select]
// support stuff for the jeep vehicle
exec("./jeep_Tire.cs");
exec("./jeep_Explosion.cs");
exec("./jeep_FinalExplosion.cs");
exec("./jeep_Spring.cs");


// Sounds //
////////////
datablock AudioProfile(fastImpactSound)
{
   filename    = "./fastimpact.WAV";
   description = AudioDefault3d;
   preload = true;
};
datablock AudioProfile(slowImpactSound)
{
   filename    = "./slowimpact.wav";
   description = AudioDefault3d;
   preload = true;
};


// Vehicle //
/////////////
datablock WheeledVehicleData(JeepVehicle)
{
category = "Vehicles";
displayName = " ";
shapeFile = "./jeep.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;
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 = 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;

   // 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 = "Jeep ";
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;

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

   burnTime = 4000;

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

   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 = true;  //protect passengers from radius damage (explosions) ?
   protectPassengersDirect = false; //protect passengers from direct damage (bullets) ?
};

So yeah, any and all help is appreciated and yada-yada.
« Last Edit: October 07, 2009, 04:50:04 PM by Blastdown »

Aren't those fields only for HoverVehicleData? I've not experimented with vehicles much so I'm not sure what you are/aren't allowed to do.

The Jeep is a WheeledVehicle. The Magic Carpet is a FlyingVehicle.

HoverVehicles do not work in Blockland, at least in v9.

The Jeep is a WheeledVehicle. The Magic Carpet is a FlyingVehicle.

HoverVehicles do not work in Blockland, at least in v9.

So then, would a vehicle with FlyingVehicle properties work?


datablock FlyingVehicleData([namehere]Vehicle)


The Jeep is a WheeledVehicle. The Magic Carpet is a FlyingVehicle.

HoverVehicles do not work in Blockland, at least in v9.
I asked Badspot why there wasnt HoverVehicles, and he said "Because they don't work" =\

Damn that was easy. :o

After changing to FlyingVehicle, I guessed where to put the code and it worked.
Code: [Select]
// Rigid Body
mass = 200;
density = 4.0;
drag = 1.7;
bodyFriction = 0.5;
bodyRestitution = 0.5;
minImpactSpeed = 10;        // Impacts over this invoke the script callback
softImpactSpeed = 10;       // Play SoftImpact Sound
hardImpactSpeed = 15;      // Play HardImpact Sound
groundImpactMinSpeed    = 10.0;
hoverHeight             = 2.0;
createHoverHeight       = 2.0;


Sweet, thanks.

The Jeep is a WheeledVehicle. The Magic Carpet is a FlyingVehicle.

HoverVehicles do not work in Blockland, at least in v9.
GARAHUMM... Does space guy use v9?

Ontopic: Nice find blastdown, I never gave much thought to the magic carpet's hovering.

GARAHUMM... Does space guy use v9?

Ontopic: Nice find blastdown, I never gave much thought to the magic carpet's hovering.
That's just the last time I tried to make a HoverVehicle. It doesn't have any collision or model when you spawn it, looking near it in the mission editor blanks the entire screen red.