What is wrong with this script
by Ben Ewing · in Torque Game Engine · 11/25/2005 (4:19 pm) · 7 replies
Datablock FlyingVehicleData(Bug)
{
spawnOffset = "0 0 2";
emap = true;
category = "Vehicles";
shapeFile = "~/data/shapes/vehicles/AlienCruiser/AlienCruiser.dts";
multipassenger = false;
computeCRC = true;
//debrisShapeName = "~/data/shapes/vehicles/AlienCruiser/AlienCruiser.dts";
//debris = AlienCruiserShapeDebris;
//renderWhenDestroyed = false;
drag = 0.15;
density = 3.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
cameraMaxDist = 0.5;
cameraOffset = 4.5;
cameraLag = 0.0;
cameraRoll = true; // Roll the camera with the vehicle
// explosion = BugVehicleExplosion;
explosionDamage = 10.5;
explosionRadius = 15.0;
maxDamage = 50.40;
destroyedLevel = 50.40;
isShielded = true;
energyPerDamagePoint = 160;
maxEnergy = 280; // Afterburner and any energy weapon pool
rechargeRate = 0.8;
minDrag = 30; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 10; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 10; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 200; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 200; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 0.95; // Dampen control input so you don't' whack out at very slow speeds
integration = 6; // Physics integration: TickSec/Rate
collisionTol = 0.2; // Collision distance tolerance
contactTol = 0.1;
// Maneuvering
maxSteeringAngle = 2; //3 Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 6; //6 Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 4; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 2600; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 70; //50 Steering jets (force applied when you move the mouse)
steeringRollForce = 10; // Steering jets (how much you heel over when you turn)
rollForce = 80; //80 Auto-roll (self-correction to right you after you
{
spawnOffset = "0 0 2";
emap = true;
category = "Vehicles";
shapeFile = "~/data/shapes/vehicles/AlienCruiser/AlienCruiser.dts";
multipassenger = false;
computeCRC = true;
//debrisShapeName = "~/data/shapes/vehicles/AlienCruiser/AlienCruiser.dts";
//debris = AlienCruiserShapeDebris;
//renderWhenDestroyed = false;
drag = 0.15;
density = 3.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
cameraMaxDist = 0.5;
cameraOffset = 4.5;
cameraLag = 0.0;
cameraRoll = true; // Roll the camera with the vehicle
// explosion = BugVehicleExplosion;
explosionDamage = 10.5;
explosionRadius = 15.0;
maxDamage = 50.40;
destroyedLevel = 50.40;
isShielded = true;
energyPerDamagePoint = 160;
maxEnergy = 280; // Afterburner and any energy weapon pool
rechargeRate = 0.8;
minDrag = 30; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 10; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 10; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 200; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 200; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 0.95; // Dampen control input so you don't' whack out at very slow speeds
integration = 6; // Physics integration: TickSec/Rate
collisionTol = 0.2; // Collision distance tolerance
contactTol = 0.1;
// Maneuvering
maxSteeringAngle = 2; //3 Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 6; //6 Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 4; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 2600; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 70; //50 Steering jets (force applied when you move the mouse)
steeringRollForce = 10; // Steering jets (how much you heel over when you turn)
rollForce = 80; //80 Auto-roll (self-correction to right you after you
#2
//cmdCategory = "Tactical";
//cmdIcon = CMDFlyingScoutIcon;
//cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
//targetNameTag = 'AlienCruiser';
//targetTypeTag = 'FlyingVehicle';
//sensorData = AWACPulseSensor;
//sensorRadius = AWACPulseSensor.detectRadius;
//sensorColor = "255 194 9";
checkRadius = 5.5;
observeParameters = "0 0 0";
shieldEffectScale = "0.937 1.125 0.60";
maxMountSpeed = 0.1;
mountDelay = 2;
dismountDelay = 1;
stationaryThreshold = 0.5;
maxDismountSpeed = 0.1;
numMountPoints = 1;
mountable = true;
mountPose[0] = "Sitting";
mountPointTransform[0] = "0 0 0 0 0 1 0";
isProtectedMountPoint[0] = false;
};
// End AlienCruiser Definition
//----------------------------------------------------------------------------------------
// Vehicle AlienCruiser Functions
//function AlienCruiser::onDamage(%this, %obj, %delta)
//{
// Parent::onDamage(%this, %obj);
// %currentDamage = %obj.getDamageLevel();
// if(%currentDamage > %obj.destroyedLevel)
// {
// if(%obj.getDamageState() !$= "Destroyed")
// {
// if(%obj.respawnTime !$= "")
// %obj.marker.schedule = %obj.marker.data.schedule(%obj.respawnTime, "respawn", %obj.marker);
// %obj.setDamageState(Destroyed);
// }
// }
// else
// {
// if(%obj.getDamageState() !$= "Enabled")
// %obj.setDamageState(Enabled);
// }
//}
function FlyingVehicleData::create(%block)
{
%obj = new FlyingVehicle() {
dataBlock = %block;
};
return(%obj);
}
//Anyone know whats wrong?
//Because when I start a mission TGE crashes, and this is the last thing TGE loads.... :(
//Please Help
11/25/2005 (4:20 pm)
//shieldImpact = VehicleShieldImpact;//cmdCategory = "Tactical";
//cmdIcon = CMDFlyingScoutIcon;
//cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
//targetNameTag = 'AlienCruiser';
//targetTypeTag = 'FlyingVehicle';
//sensorData = AWACPulseSensor;
//sensorRadius = AWACPulseSensor.detectRadius;
//sensorColor = "255 194 9";
checkRadius = 5.5;
observeParameters = "0 0 0";
shieldEffectScale = "0.937 1.125 0.60";
maxMountSpeed = 0.1;
mountDelay = 2;
dismountDelay = 1;
stationaryThreshold = 0.5;
maxDismountSpeed = 0.1;
numMountPoints = 1;
mountable = true;
mountPose[0] = "Sitting";
mountPointTransform[0] = "0 0 0 0 0 1 0";
isProtectedMountPoint[0] = false;
};
// End AlienCruiser Definition
//----------------------------------------------------------------------------------------
// Vehicle AlienCruiser Functions
//function AlienCruiser::onDamage(%this, %obj, %delta)
//{
// Parent::onDamage(%this, %obj);
// %currentDamage = %obj.getDamageLevel();
// if(%currentDamage > %obj.destroyedLevel)
// {
// if(%obj.getDamageState() !$= "Destroyed")
// {
// if(%obj.respawnTime !$= "")
// %obj.marker.schedule = %obj.marker.data.schedule(%obj.respawnTime, "respawn", %obj.marker);
// %obj.setDamageState(Destroyed);
// }
// }
// else
// {
// if(%obj.getDamageState() !$= "Enabled")
// %obj.setDamageState(Enabled);
// }
//}
function FlyingVehicleData::create(%block)
{
%obj = new FlyingVehicle() {
dataBlock = %block;
};
return(%obj);
}
//Anyone know whats wrong?
//Because when I start a mission TGE crashes, and this is the last thing TGE loads.... :(
//Please Help
#3
11/25/2005 (5:22 pm)
Have you tried running in a debugger?
#4
11/25/2005 (5:29 pm)
I know this is a stupid question, but how do I do that?
#5
11/25/2005 (6:00 pm)
You could always try checking the console log, and see what particularly went wrong with it, as well.
#6
11/25/2005 (8:51 pm)
YThe last thing it does is load the dcript I showed you
Torque Owner Ben Ewing
hoverHeight = 5; //45 Height off the ground at rest
createHoverHeight = 2; //45 Height off the ground when created
maxForwardSpeed = 100; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 3.0;
// Rigid body
mass = 30; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 1.0; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 2000; // Don't mess with this.
softImpactSpeed = 3; // Sound hooks. This is the soft hit.
hardImpactSpeed = 15; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 10; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.06;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23.0;
collDamageMultiplier = 0.02;
//
minTrailSpeed = 15; // The speed your contrail shows up at.
//trailEmitter = AlienCruiserContrailEmitter;
//forwardJetEmitter = AlienCruiserJetEmitter;
//downJetEmitter = AlienCruiserJetEmitter;
//
//jetSound = AlienCruiserThrustSound;
//engineSound = AlienCruiserEngineSound;
//softImpactSound = AlienCruiserSoftImpactSound;
//hardImpactSound = AlienCruiserHardImpactSound;
//
//softSplashSoundVelocity = 10.0;
//mediumSplashSoundVelocity = 15.0;
//hardSplashSoundVelocity = 20.0;
//exitSplashSoundVelocity = 10.0;
//exitingWater = AlienCruiserExitWaterMediumSound;
//impactWaterEasy = AlienCruiserImpactWaterSoftSound;
//impactWaterMedium = AlienCruiserImpactWaterMediumSound;
//impactWaterHard = AlienCruiserImpactWaterMediumSound;
//waterWakeSound = AlienCruiserWakeMediumSplashSound;
// dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 1.0;
// damageEmitter[0] = LightDamageSmoke;
// damageEmitter[1] = HeavyDamageSmoke;
// damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 3;
//
//max[RocketAmmo] = 1000;
minMountDist = 2;
//splashEmitter[0] = VehicleFoamDropletsEmitter;
//splashEmitter[1] = VehicleFoamEmitter;