Initial commit.

This commit is contained in:
Ragora 2013-02-01 15:45:22 -05:00
commit f5a6cfce9b
262 changed files with 128936 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,525 @@
//------------------------------------------------------------------------------
datablock EffectProfile(VehicleAppearEffect)
{
effectname = "vehicles/inventory_pad_appear";
minDistance = 5;
maxDistance = 10;
};
datablock EffectProfile(ActivateVehiclePadEffect)
{
effectname = "powered/vehicle_pad_on";
minDistance = 20;
maxDistance = 30;
};
datablock AudioProfile(VehicleAppearSound)
{
filename = "fx/vehicles/inventory_pad_appear.wav";
description = AudioClosest3d;
preload = true;
effect = VehicleAppearEffect;
};
datablock AudioProfile(ActivateVehiclePadSound)
{
filename = "fx/powered/vehicle_pad_on.wav";
description = AudioClose3d;
preload = true;
effect = ActivateVehiclePadEffect;
};
datablock StationFXVehicleData( VehicleInvFX )
{
lifetime = 6.0;
glowTopHeight = 1.5;
glowBottomHeight = 0.1;
glowTopRadius = 12.5;
glowBottomRadius = 12.0;
numGlowSegments = 26;
glowFadeTime = 3.25;
armLightDelay = 2.3;
armLightLifetime = 3.0;
armLightFadeTime = 1.5;
numArcSegments = 10.0;
sphereColor = "0.1 0.1 0.5";
spherePhiSegments = 13;
sphereThetaSegments = 8;
sphereRadius = 12.0;
sphereScale = "1.05 1.05 0.85";
glowNodeName = "GLOWFX";
leftNodeName[0] = "LFX1";
leftNodeName[1] = "LFX2";
leftNodeName[2] = "LFX3";
leftNodeName[3] = "LFX4";
rightNodeName[0] = "RFX1";
rightNodeName[1] = "RFX2";
rightNodeName[2] = "RFX3";
rightNodeName[3] = "RFX4";
texture[0] = "special/stationGlow";
texture[1] = "special/stationLight2";
};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function serverCmdBuyVehicle(%client, %blockName)
{
%team = %client.getSensorGroup();
if(vehicleCheck(%blockName, %team))
{
%station = %client.player.station.pad;
if( (%station.ready) && (%station.station.vehicle[%blockName]) )
{
%trans = %station.getTransform();
%pos = getWords(%trans, 0, 2);
%matrix = VectorOrthoBasis(getWords(%trans, 3, 6));
%yrot = getWords(%matrix, 3, 5);
%p = vectorAdd(%pos,vectorScale(%yrot, -3));
//%adjust = vectorMultiply(realVec(%station,"0 0 4"),"1 1 3");
//%adjustUp = getWord(%adjust,2);
//%adjust = getWords(%adjust,0,1) SPC ((%adjustUp * 0.5) + (mAbs(%adjustUp) * -0.5));
%p = VectorAdd(%p,RealVec(%station,"0 0 7"));
// error(%blockName);
// error(%blockName.spawnOffset);
///[Most]
///Updated Build code for rotatable vehicle pad.
%p = vectorAdd(%p, RealVec(%station,VectorAdd(%blockName.spawnOffset,"0 0 1")));
%forward = VectorCross(VectorCross("0 0 1",realvec(%station,"1 0 0")),"0 0 1");
%rot = FullRot("0 0 1",%forward);
%rrot = RotAdd(%rot,"0 0 1 3.14");
//%rrot= %rot;
%rot = getWords(%rrot, 0,2);
%angle = getWord(%rrot, 3);
//[Most]
%mask = $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType |
$TypeMasks::StationObjectType | $TypeMasks::TurretObjectType;
InitContainerRadiusSearch(%p, %blockName.checkRadius, %mask);
%clear = 1;
for (%x = 0; (%obj = containerSearchNext()) != 0; %x++)
{
if((%obj.getType() & $TypeMasks::VehicleObjectType) && (%obj.getDataBlock().checkIfPlayersMounted(%obj)))
{
%clear = 0;
break;
}
else
if (%obj !=%station.station)
%removeObjects[%x] = %obj;
}
if(%clear)
{
%fadeTime = 0;
for(%i = 0; %i < %x; %i++)
{
if(%removeObjects[%i].getType() & $TypeMasks::PlayerObjectType)
{
%pData = %removeObjects[%i].getDataBlock();
%pData.damageObject(%removeObjects[%i], 0, "0 0 0", 1000, $DamageType::VehicleSpawn);
}
else
{
%removeObjects[%i].mountable = 0;
%removeObjects[%i].startFade( 1000, 0, true );
%removeObjects[%i].schedule(1001, "delete");
%fadeTime = 1500;
}
}
schedule(%fadeTime, 0, "createVehicle", %client, %station, %blockName, %team , %p, %rot, %angle);
}
else
MessageClient(%client, "", 'Can\'t create vehicle. A player is on the creation pad.');
}
}
}
function createVehicle(%client, %station, %blockName, %team , %pos, %rot, %angle)
{
%obj = %blockName.create(%team);
if(%obj)
{
%station.ready = false;
%obj.team = %team;
%obj.useCreateHeight(true);
%obj.schedule(5500, "useCreateHeight", false);
%obj.getDataBlock().isMountable(%obj, false);
%obj.getDataBlock().schedule(6500, "isMountable", %obj, true);
vehicleListAdd(%blockName, %obj);
MissionCleanup.add(%obj);
%turret = %obj.getMountNodeObject(10);
if(%turret > 0)
{
%turret.setCloaked(true);
%turret.schedule(4800, "setCloaked", false);
}
%obj.setCloaked(true);
%obj.setTransform(%pos @ " " @ %rot @ " " @ %angle);
%obj.schedule(3700, "playAudio", 0, VehicleAppearSound);
%obj.schedule(4800, "setCloaked", false);
if(%client.player.lastVehicle)
{
%client.player.lastVehicle.lastPilot = "";
vehicleAbandonTimeOut(%client.player.lastVehicle);
%client.player.lastVehicle = "";
}
%client.player.lastVehicle = %obj;
%obj.lastPilot = %client.player;
%station.playAudio($ActivateSound, ActivateVehiclePadSound);
%ppos = VectorAdd(%station.getTransform(),RealVec(%station,"0 0 2"));
if (%station.getDatablock().getName() $= "DeployableVehiclePad")
{
%station.playThread($ActivateThread,"activate2");
%up = realvec(%station,"0 0 1");
%forward = realvec(%station,"1 0 0");
%p1 = CreateEmitter(%ppos,DVPADE);
%p2 = CreateEmitter(%ppos,DVPADE);
%p1.setRotation(FullRot(%up,%forward));
%p2.setRotation(FullRot(VectorScale(%up,-1),%forward));
%p1.schedule(5000,"delete");
%p2.schedule(5000,"delete");
}
else if (%station.getDatablock().getName() $= "DeployableVehiclePad2")
{
%station.playThread($ActivateThread,"activate");
%up = realvec(%station,"0 0 1");
%forward = realvec(%station,"1 0 0");
%p1 = CreateEmitter(%ppos,DVPADE);
%p2 = CreateEmitter(%ppos,DVPADE);
%p1.setRotation(FullRot(%up,%forward));
%p2.setRotation(FullRot(VectorScale(%up,-1),%forward));
%p1.schedule(5000,"delete");
%p2.schedule(5000,"delete");
}
else
{
%station.playThread($ActivateThread,"activate2");
// play the FX
%fx = new StationFXVehicle()
{
dataBlock = VehicleInvFX;
stationObject = %station;
};
}
//[[CHANGE]]!! If player is telebuying.. put him incontrol...
if ( (%client.isVehicleTeleportEnabled()) && (!%client.telebuy))
%obj.getDataBlock().schedule(5000, "mountDriver", %obj, %client.player);
else
{
if(%obj.getDataBlock().canControl)
{
//serverCmdResetControlObject(%client);
%client.setControlObject(%obj);
commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj,%client.player));
%obj.clientControl = %client;
}
}
//[[End CHANGE]]
}
if(%obj.getTarget() != -1)
setTargetSensorGroup(%obj.getTarget(), %client.getSensorGroup());
// We are now closing the vehicle hud when you buy a vehicle, making the following call
// unnecessary (and it breaks stuff, too!)
//VehicleHud.updateHud(%client, 'vehicleHud');
}
//------------------------------------------------------------------------------
function VehicleData::mountDriver(%data, %obj, %player)
{
if(isObject(%obj) && %obj.getDamageState() !$= "Destroyed")
{
%player.startFade(1000, 0, true);
schedule(1000, 0, "testVehicleForMount", %player, %obj);
%player.schedule(1500,"startFade",1000, 0, false);
}
}
function testVehicleForMount(%player, %obj)
{
if(isObject(%obj) && %obj.getDamageState() !$= "Destroyed")
%player.getDataBlock().onCollision(%player, %obj, 0);
}
//------------------------------------------------------------------------------
function VehicleData::checkIfPlayersMounted(%data, %obj)
{
for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++)
if (%obj.getMountNodeObject(%i))
return true;
return false;
}
//------------------------------------------------------------------------------
function VehicleData::isMountable(%data, %obj, %val)
{
%obj.mountable = %val;
}
//------------------------------------------------------------------------------
function vehicleCheck(%blockName, %team)
{
if(($VehicleMax[%blockName] - $VehicleTotalCount[%team, %blockName]) > 0)
return true;
// else
// {
// for(%i = 0; %i < $VehicleMax[%blockName]; %i++)
// {
// %obj = $VehicleInField[%blockName, %i];
// if(%obj.abandon)
// {
// vehicleListRemove(%blockName, %obj);
// %obj.delete();
// return true;
// }
// }
// }
return false;
}
//------------------------------------------------------------------------------
function VehicleHud::updateHud( %obj, %client, %tag ) {
%client.vehInvTag = %tag;
%client.vehInvPage = "";
if (%client.usedVehHud != 1) {
bottomPrint(%client, "Cycle weapons to view more vehicles.", 5, 1);
%client.usedVehHud = 1;
}
cycleVehicleHud(%obj, %client);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function cycleVehicleHud(%obj, %client,%data) {
%tag = %client.vehInvTag;
%page = %client.vehInvPage;
if (%page $= "")
%page = 0;
else {
if (%data $= "prev")
%page--;
else
%page++;
}
%count = %client.player.station.lastCount;
VehicleHud::clearHud( %obj, %client, %tag, %count );
%station = %client.player.station;
%team = %client.getSensorGroup();
%count = 0;
%i = 0;
if ( %station.vehicle[AWACS] ) {
%vehicleSet[AWACS] = %i;
%i++;
}
if ( %station.vehicle[HawkFlyer] ) {
%vehicleSet[HawkFlyer] = %i;
%i++;
}
if ( %station.vehicle[scoutFlyer] ) {
%vehicleSet[scoutFlyer] = %i;
%i++;
}
if ( %station.vehicle[StrikeFlyer] ) {
%vehicleSet[StrikeFlyer] = %i;
%i++;
}
if ( %station.vehicle[SuperiorityFighter] ) {
%vehicleSet[SuperiorityFighter] = %i;
%i++;
}
if ( %station.vehicle[helicopter] ) {
%vehicleSet[helicopter] = %i;
%i++;
}
if ( %station.vehicle[bomberFlyer] ) {
%vehicleSet[bomberFlyer] = %i;
%i++;
}
if ( %station.vehicle[HeavyTank] ) {
%vehicleSet[HeavyTank] = %i;
%i++;
}
if ( %station.vehicle[Personelboat] ) {
%vehicleSet[Personelboat] = %i;
%i++;
}
if ( %station.vehicle[boat] ) {
%vehicleSet[boat] = %i;
%i++;
}
if ( %station.vehicle[Sub] ) {
%vehicleSet[Sub] = %i;
%i++;
}
if ( %station.vehicle[scoutVehicle] ) {
%vehicleSet[scoutVehicle] = %i;
%i++;
}
if ( %station.vehicle[hapcFlyer] ) {
%vehicleSet[hapcFlyer] = %i;
%i++;
}
if ( %station.vehicle[gunship] ) {
%vehicleSet[gunship] = %i;
%i++;
}
if ( %station.vehicle[HeavyChopper] ) {
%vehicleSet[HeavyChopper] = %i;
%i++;
}
if ( %station.vehicle[CGTank] ) {
%vehicleSet[CGTank] = %i;
%i++;
}
if ( %station.vehicle[AssaultVehicle] ) {
%vehicleSet[AssaultVehicle] = %i;
%i++;
}
if ( %station.vehicle[mobileBaseVehicle] ) {
%vehicleSet[mobileBaseVehicle] = %i;
%i++;
}
if ( %station.vehicle[SuperScoutVehicle] && $Host::Purebuild == 1) {
%vehicleSet[SuperScoutVehicle] = %i;
%i++;
}
if ( %station.vehicle[SuperHAPCFlyer] && $Host::Purebuild == 1) {
%vehicleSet[SuperHAPCFlyer] = %i;
%i++;
}
if ( %station.vehicle[Artillery] ) {
%vehicleSet[Artillery] = %i;
%i++;
}
%totalPages = mCeil(%i / 6) - 1;
if (%page < 0)
%page = %totalPages;
if (%page > %totalPages)
%page = 0;
%initPos = (%page * 6);
%endPos = %initPos + 5;
if ( checkVehSet(%vehicleSet[AWACS], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "AWACS", "", AWACS, $VehicleMax[AWACS] - $VehicleTotalCount[%team, AWACS] );
%count++;
}
if ( checkVehSet(%vehicleSet[HawkFlyer], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "FC-13 Hawk Interceptor", "", HawkFlyer, $VehicleMax[HawkFlyer] - $VehicleTotalCount[%team, HawkFlyer] );
%count++;
}
if ( checkVehSet(%vehicleSet[SuperScoutVehicle], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Super Grav Cycle", "", SuperScoutVehicle, $VehicleMax[SuperScoutVehicle] - $VehicleTotalCount[%team,SuperScoutVehicle] );
%count++;
}
if ( checkVehSet(%vehicleSet[Superiorityfighter], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Tornado Superiority Fighter", "", Superiorityfighter, $VehicleMax[Superiorityfighter] - $VehicleTotalCount[%team, Superiorityfighter] );
%count++;
}
if ( checkVehSet(%vehicleSet[scoutFlyer], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "F39 Raptor II Interceptor", "", ScoutFlyer, $VehicleMax[ScoutFlyer] - $VehicleTotalCount[%team, ScoutFlyer] );
%count++;
}
if ( checkVehSet(%vehicleSet[StrikeFlyer], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "F41 Airwing Strike Fighter", "", StrikeFlyer, $VehicleMax[StrikeFlyer] - $VehicleTotalCount[%team, StrikeFlyer] );
%count++;
}
if ( checkVehSet(%vehicleSet[helicopter], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "WhiteHorse Assault Chopper", "", helicopter, $VehicleMax[helicopter] - $VehicleTotalCount[%team, helicopter] );
%count++;
}
if ( checkVehSet(%vehicleSet[bomberFlyer], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "B-34 Bomber", "", BomberFlyer, $VehicleMax[BomberFlyer] - $VehicleTotalCount[%team, BomberFlyer] );
%count++;
}
if ( checkVehSet(%vehicleSet[HeavyTank], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "M3A2 Faustes Assualt Tank", "", HeavyTank, $VehicleMax[HeavyTank] - $VehicleTotalCount[%team, HeavyTank] );
%count++;
}
if ( checkVehSet(%vehicleSet[Personelboat], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Grandens Transport Boat", "", Personelboat, $VehicleMax[Personelboat] - $VehicleTotalCount[%team, Personelboat] );
%count++;
}
if ( checkVehSet(%vehicleSet[boat], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Star II Heavy GunBoat", "", boat, $VehicleMax[boat] - $VehicleTotalCount[%team, boat] );
%count++;
}
if ( checkVehSet(%vehicleSet[sub], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Darwine IV Submarine", "", sub, $VehicleMax[sub] - $VehicleTotalCount[%team, sub] );
%count++;
}
if ( checkVehSet(%vehicleSet[scoutVehicle], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "MK II WildCat Grav Cycle", "", scoutVehicle, $VehicleMax[scoutVehicle] - $VehicleTotalCount[%team,scoutVehicle] );
%count++;
}
if ( checkVehSet(%vehicleSet[hapcFlyer], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "HVC Golem Heavy Transport", "", HAPCFlyer, $VehicleMax[HAPCFlyer] - $VehicleTotalCount[%team, HAPCFlyer] );
%count++;
}
if ( checkVehSet(%vehicleSet[gunship], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "AC-290 Saber Gunship", "", gunship, $VehicleMax[gunship] - $VehicleTotalCount[%team, gunship] );
%count++;
}
if ( checkVehSet(%vehicleSet[HeavyChopper], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Eagle VII Transport Chopper", "", HeavyChopper, $VehicleMax[HeavyChopper] - $VehicleTotalCount[%team, HeavyChopper] );
%count++;
}
if ( checkVehSet(%vehicleSet[CGTank], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Banshee 50mm Chaingun Tank", "", CGTank, $VehicleMax[CGTank] - $VehicleTotalCount[%team, CGTank] );
%count++;
}
if ( checkVehSet(%vehicleSet[AssaultVehicle], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "M4A1 Wolf Light Tank", "", AssaultVehicle, $VehicleMax[AssaultVehicle] - $VehicleTotalCount[%team, AssaultVehicle] );
%count++;
}
if ( checkVehSet(%vehicleSet[mobileBaseVehicle], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Jericho MPB", "", MobileBaseVehicle, $VehicleMax[MobileBaseVehicle] - $VehicleTotalCount[%team, MobileBaseVehicle] );
%count++;
}
if ( checkVehSet(%vehicleSet[Artillery], %initPos)) {
messageClient( %client, 'SetLineHud', "", %tag, %count, "Grendel Heavy Artillery", "", Artillery, $VehicleMax[Artillery] - $VehicleTotalCount[%team, Artillery] );
%count++;
}
%station.lastCount = %count;
%client.vehInvPage = %page;
}
//------------------------------------------------------------------------------
function VehicleHud::clearHud( %obj, %client, %tag, %count ) {
for ( %i = 0; %i < %count; %i++ )
messageClient( %client, 'RemoveLineHud', "", %tag, %i );
}
//------------------------------------------------------------------------------
function checkVehSet(%obj, %initpos) {
if ((%obj !$= "") && (%obj >= %initpos) && (%obj <= (%initpos + 5)))
return true;
else
return false;
}
//------------------------------------------------------------------------------
function serverCmdEnableVehicleTeleport( %client, %enabled )
{
%client.setVehicleTeleportEnabled( %enabled );
}

2247
Scripts/Vehicles/vehicle.cs Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,772 @@
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock SensorData(AWACSSensor)
{
detects = true;
detectsUsingLOS = true;
detectsPassiveJammed = false;
detectsActiveJammed = false;
detectsCloaked = false;
detectionPings = true;
detectRadius = 1750;
};
datablock FlyingVehicleData(AWACS) : BomberDamageProfile
{
spawnOffset = "0 0 2";
canControl = false;
catagory = "Vehicles";
shapeFile = "vehicle_air_bomber.dts";
multipassenger = true;
computeCRC = true;
weaponNode = 1;
debrisShapeName = "vehicle_air_bomber.dts";
debris = MeShapeDebris;
renderWhenDestroyed = false;
drag = 0.2;
density = 1.0;
mountPose[0] = sitting;
mountPose[1] = sitting;
numMountPoints = 3;
isProtectedMountPoint[0] = true;
isProtectedMountPoint[1] = true;
isProtectedMountPoint[2] = false;
cameraDefaultFov = 90.0;
cameraMinFov = 5.0;
cameraMaxFov = 120.0;
cameraMaxDist = 22;
cameraOffset = 5;
cameraLag = 1.0;
explosion = MFVehicleExplosion;
explosionDamage = 1.5;
explosionRadius = 20.0;
maxDamage = 5.0; // Total health
destroyedLevel = 5.0; // Damage textures show up at this health level
HDAddMassLevel = 3.5;
HDMassImage = HFlyerHDMassImage;
isShielded = false;
energyPerDamagePoint = 150;
maxEnergy = 400; // Afterburner and any energy weapon pool
minDrag = 60; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 1800; // Angular Drag (dampens the drift after you stop moving the mouse...also tumble drag)
rechargeRate = 0.8;
// Auto stabilize speed
maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 1500; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 300; // 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
// Maneuvering
maxSteeringAngle = 8; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 5; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 8; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 5500; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 800; // Steering jets (force applied when you move the mouse)
steeringRollForce = 3000; // Steering jets (how much you heel over when you turn)
rollForce = 1; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 4; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
maxForwardSpeed = 130; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 5000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40.0; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 2.5; // Energy use of the afterburners (low number is less drain...can be fractional)
vertThrustMultiple = 3.0;
dustEmitter = LargeVehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 2.0;
damageEmitter[0] = MFLightDamageSmoke;
damageEmitter[1] = MFHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "3.0 -3.0 0.0 ";
damageEmitterOffset[1] = "-3.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 2;
// Rigid body
mass = 350; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 20; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 20; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.060;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 25;
collDamageMultiplier = 0.020;
//
minTrailSpeed = 15; // The speed your contrail shows up at.
trailEmitter = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = BomberFlyerThrustSound;
engineSound = BomberFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterHardSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterHardSound;
waterWakeSound = VehicleWakeHardSplashSound;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingBomberIcon;
cmdMiniIconName = "commander/MiniIcons/com_bomber_grey";
targetNameTag = 'C-410';
targetTypeTag = 'AWACS';
sensorData = AWACSSensor;
sensorRadius = AWACSSensor.detectRadius;
sensorColor = "9 9 255";
checkRadius = 7.1895;
observeParameters = "1 10 10";
shieldEffectScale = "0.75 0.975 0.375";
showPilotInfo = 1;
max[PlasmaAmmo] = 50;
replaceTime = 20;
};
datablock BombProjectileData(BuoyBomb)
{
projectileShapeName = "nexuscap.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 0.0;
damageRadius = 0;
radiusDamageType = $DamageType::BomberBombs;
kickBackStrength = 0;
explosion = "ChaingunExplosion";
velInheritFactor = 1.0;
grenadeElasticity = 0.25;
grenadeFriction = 0.4;
armingDelayMS = 2000;
muzzleVelocity = 0.1;
drag = 0.3;
minRotSpeed = "0.0 0.0 0.0";
maxRotSpeed = "0.0 0.0 10.0";
scale = "1.0 1.0 1.0";
// sound = BomberBombProjectileSound;
};
datablock TurretImageData(AWACSTorp)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
offset = "0 0 0";
item = Chaingun;
projectile = shrikeBomb;
projectileType = BombProjectile;
emap = true;
mountPoint = 1;
usesEnergy = true;
useMountEnergy = true;
useCapacitor = true;
minEnergy = 5;
fireEnergy = 5.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 4;
stateAllowImageChange[4] = false;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = MissileReloadSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock TurretImageData(AWACSBuoy)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
offset = "0 0 0";
item = Chaingun;
projectile = BuoyBomb;
projectileType = BombProjectile;
emap = true;
mountPoint = 1;
usesEnergy = true;
useMountEnergy = true;
useCapacitor = true;
minEnergy = 5;
fireEnergy = 5.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 4;
stateAllowImageChange[4] = false;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = MissileReloadSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock StaticShapeData(SonarBuoy) : StaticShapeDamageProfile {
className = "teleport";
shapeFile = "nexuscap.dts";
maxDamage = 2.00;
destroyedLevel = 2.00;
disabledLevel = 1.35;
isShielded = true;
energyPerDamagePoint = 250;
maxEnergy = 100;
rechargeRate = 1;
explosion = ShapeExplosion;
expDmgRadius = 18.0;
expDamage = 0.3;
expImpulse = 200.0;
dynamicType = $TypeMasks::StationObjectType;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDSwitchIcon;
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
targetNameTag = 'Deployed';
targetTypeTag = 'Sonar Buoy';
debrisShapeName = "debris_generic.dts";
debris = DeployableDebris;
heatSignature = 0;
needsPower = false;
humSound = SensorHumSound;
pausePowerThread = true;
sensorData = TelePadBaseSensorObj;
sensorRadius = TelePadBaseSensorObj.detectRadius;
sensorColor = "0 212 45";
firstPersonOnly = true;
};
datablock ShapeBaseImageData(Rearmer)
{
mountPoint = 7;
className = WeaponImage;
shapeFile = "deploy_ammo.dts";
offset = "0 -35 -8";
rotation = "1 0 0 -120";
emap = true;
stateName[0] = "Activate";
stateSequence[0] = "Deploy";
};
function AWACS::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.setInventory(PlasmaAmmo, 50);
%turret = TurretData::create(BomberTurret);
MissionCleanup.add(%turret);
%turret.team = %obj.teamBought;
%turret.setSelfPowered();
%turret.selectedWeapon = 1;
%obj.mountObject(%turret, 10);
%turret.mountImage(GST1Param, 0);
%turret.mountImage(APCTurretBarrel, 2);
%turret.mountImage(AWACSTorp, 4);
%turret.mountImage(AWACSBuoy, 6);
%obj.turretObject = %turret;
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
%turret.vehicleMounted = %obj;
%turret.setAutoFire(false);
%turret.mountobj = %obj;
%turret.team = %obj.team;
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
}
function AWACS::playerMounted(%data, %obj, %player, %node)
{
//[[CHANGE]]
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
if (%node == 0)
{
// pilot position
%player.setPilot(true);
commandToClient(%player.client, 'setHudMode', 'Pilot', "Bomber", %node);
bottomPrint(%player.client, "Pilot Postion: nade for flares and mine for resupply arm.", 5, 2 );
}
else if (%node == 1)
{
// bombardier position
%turret = %obj.getMountNodeObject(10);
%player.vehicleTurret = %turret;
%player.setTransform("0 0 0 0 0 1 0");
%player.lastWeapon = %player.getMountedImage($WeaponSlot);
%player.unmountImage($WeaponSlot);
if (!%player.client.isAIControlled())
{
%player.setControlObject(%turret);
%player.client.setObjectActiveImage(%turret, 2);
}
%turret.bomber = %player;
$bWeaponActive = 0;
%obj.getMountNodeObject(10).selectedWeapon = 1;
commandToClient(%player.client,'SetWeaponryVehicleKeys', true);
commandToClient(%player.client, 'setHudMode', 'Pilot', "Bomber", %node);
%player.isBomber = true;
centerPrint(%player.client, "WEP1: CG WEP2: Torp WEP3: sonar buoy dropper", 5, 2 );
}
%passString = buildPassengerString(%obj);
for(%i = 0; %i < %data.numMountPoints; %i++)
if (%obj.getMountNodeObject(%i) > 0)
commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString);
if ( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
}
function AWACS::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(10);
if (isObject(%turret)){
%turret.altTrigger = 0;
%turret.fireTrigger = 0;
if (%client = %turret.getControllingClient())
{
%client.player.setControlObject(%client.player);
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
%client.player.bomber = false;
%client.player.isBomber = false;
}
%turret.schedule(2000, delete);
}
}
function AWACS::onTrigger(%data, %obj, %trigger, %state)
{
if (%trigger ==4){
switch (%state)
{
case 0:
%obj.fireWeapon = false;
case 1:
if (%obj.inv[PlasmaAmmo] > 0){
%obj.fireWeapon = true;
%obj.decInventory(PlasmaAmmo, 1);
%Upvec = %obj.getUpVector();
%p = new FlareProjectile()
{
dataBlock = FlareGrenadeProj;
initialDirection = vectorScale(%Upvec, -1);
initialPosition = getBoxCenter(%obj.getWorldBox());
sourceObject = %obj;
sourceSlot = 0;
};
FlareSet.add(%p);
MissionCleanup.add(%p);
%p.schedule(6000, "delete");
%vec = vectornormalize(vectorcross(%obj.getForwardvector(),%Upvec));
%p = new FlareProjectile()
{
dataBlock = FlareGrenadeProj;
initialDirection = %vec;
initialPosition = getBoxCenter(%obj.getWorldBox());
sourceObject = %obj;
sourceSlot = 0;
};
FlareSet.add(%p);
MissionCleanup.add(%p);
%p.schedule(6000, "delete");
%p = new FlareProjectile()
{
dataBlock = FlareGrenadeProj;
initialDirection = vectorscale(%vec,-1);
initialPosition = getBoxCenter(%obj.getWorldBox());
sourceObject = %obj;
sourceSlot = 0;
};
FlareSet.add(%p);
MissionCleanup.add(%p);
%p.schedule(6000, "delete");
serverPlay3D(GrenadeThrowSound, getBoxCenter(%obj.getWorldBox()));
%obj.lastThrowTime[%data] = getSimTime();
%obj.throwStrength = 0;
}
}
}
else if (%trigger ==5){
switch (%state)
{
case 1:
if(%obj.isreping == 1){
stopRearm(%obj);
%obj.unmountImage(6);
}
else{
%obj.isreping = 1;
RearmLoop(%obj);
%obj.mountImage(Rearmer, 6);
}
}
}
}
function RearmLoop(%obj){
if(isObject(%obj)){
if(%obj.isreping == 0)
return;
%targets = %obj.reptargets;
%vec = vectorAdd(vectorscale(%obj.getForwardVector(),-35),vectorscale(%obj.getUpVector(),-8));
%pos = vectorAdd(%obj.getWorldBoxCenter(),%vec);
if(%targets !$= ""){
%numtrgs = getNumberOfWords(%targets);
for(%i = 0; %i < %numtrgs; %i++){
%target = getWord(%targets, %i);
if(vectorDist(%pos, %target.getWorldBoxCenter()) <= 20 && %target.getDamageLevel() > 0.0){
if(%target.reping != 1){
%target.reping = 1;
%target.setRepairRate(%target.getRepairRate() + 0.01);
}
}
else{
if(%target.reping == 1){
%target.reping = 0;
%target.setRepairRate(%target.getRepairRate() - 0.01);
}
}
%datablock = %target.getDatablock();
if(%datablock.max[chaingunAmmo] !$= "" && %target.inv[chaingunAmmo] < %datablock.max[chaingunAmmo]){
if(%datablock.max[chaingunAmmo] < 100)
%CGamount = 10;
else
%CGamount = 100;
%target.incInventory(chaingunAmmo, %CGamount);
%reloaded = 1;
}
if(%datablock.max[MissileLauncherAmmo] !$= "" && %target.inv[MissileLauncherAmmo] < %datablock.max[MissileLauncherAmmo]){
%target.incInventory(MissileLauncherAmmo, 1);
%reloaded = 1;
}
if(%datablock.max[MortarAmmo] !$= "" && %target.inv[MortarAmmo] < %datablock.max[MortarAmmo]){
%target.incInventory(MortarAmmo, 1);
%reloaded = 1;
}
if(%datablock.max[PlasmaAmmo] !$= "" && %target.inv[PlasmaAmmo] < %datablock.max[PlasmaAmmo]){
%target.incInventory(PlasmaAmmo, 4);
%reloaded = 1;
}
if(%reloaded == 1){
%reloaded = 0;
serverPlay3d("MissileReloadSound",%target.getWorldBoxCenter());
}
if(isObject(%target.turretObject)){
%datablock = %target.turretObject.getDatablock();
if(%datablock.max[chaingunAmmo] !$= "" && %target.turretObject.inv[chaingunAmmo] < %datablock.max[chaingunAmmo]){
%target.turretObject.incInventory(chaingunAmmo, 100);
%reloaded = 1;
}
if(%datablock.max[MissileLauncherAmmo] !$= "" && %target.turretObject.inv[MissileLauncherAmmo] < %datablock.max[MissileLauncherAmmo]){
%target.turretObject.incInventory(MissileLauncherAmmo, 1);
%reloaded = 1;
}
if(%datablock.max[MortarAmmo] !$= "" && %target.turretObject.inv[MortarAmmo] < %datablock.max[MortarAmmo]){
%target.turretObject.incInventory(MortarAmmo, 1);
%reloaded = 1;
}
if(%reloaded == 1)
serverPlay3d("MissileReloadSound",%target.getWorldBoxCenter());
}
}
}
%obj.reptargets = "";
InitContainerRadiusSearch(%pos, 15, $TypeMasks::VehicleObjectType);
while ((%targetObject = containerSearchNext()) != 0){
// if(%targetObject.getClassName() $= "FlyingVehicle")
%obj.reptargets = %obj.reptargets @ %targetObject @" ";
}
if(%obj.isreping == 1)
%obj.reploop = schedule(500, 0, "RearmLoop", %obj);
}
}
function stopRearm(%obj){
%obj.isreping = 0;
if(%obj.reptargets !$= ""){
%numtrgs = getNumberOfWords(%obj.reptargets);
for(%i = 0; %i < %numtrgs; %i++){
%target = getWord(%obj.reptargets, %i);
if(%target.reping == 1){
%target.reping = 0;
%target.setRepairRate(%target.getRepairRate() - 0.01);
}
}
}
}
function AWACSTorp::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%p.initVel = vectorNormalize(%obj.mountobj.getVelocity());
%z = getWord(%p.initVel,2);
if(%z > 0)
%p.initVel = vectorNormalize(getWord(%p.initVel,0)@" "@getWord(%p.initVel,1)@" 0");
schedule(500, 0, "changethebomb", %p, "Torp");
}
function AWACSBuoy::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
schedule(500, 0, "changethebomb", %p, "Buoy");
}
function changethebomb(%obj, %type){
if(!isObject(%obj))
return;
%vec = "0 0 100";
%pos = %obj.getPosition();
%search = containerRayCast(%pos, vectorAdd(%pos,%vec), $TypeMasks::WaterObjectType, %obj);
if(%search){
if(%type $= "Torp"){
%p = new SeekerProjectile()
{
dataBlock = Torpedo;
initialDirection = %obj.initVel;
initialPosition = %pos;
sourceObject = %obj.sourceobject;
sourceSlot = 3;
};
%p.sourceobject = %obj.sourceobject;
%p.vector = %vec;
%p.count = 1;
TorpedoSeekLoop(%p);
%obj.schedule(10, "delete");
return;
}
else{
%pos = getWord(%search,1)@" "@getWord(%search,2)@" "@getWord(%search,3);
if($TeamDeployedCount[%obj.sourceObject.team, SonarBuoy] < 5){
%deplObj = new (StaticShape)() {
dataBlock = "SonarBuoy";
position = %pos;
rotation = "0 0 0 0";
scale = "1 1 1";
team = %obj.sourceObject.team;
deployed = "1";
};
%deplObj.setOwner(%obj.sourceObject.getControllingClient().player);
setTargetSensorGroup(%deplObj.getTarget(), %obj.sourceObject.team);
addToDeployGroup(%deplObj);
$TeamDeployedCount[%obj.sourceObject.team, SonarBuoy]++;
%deplObj.deploy();
SonarPingLoop(%deplObj);
%sensor = new (StaticShape) () {
datablock = "DeployedPulseSensor";
position = vectorAdd(%pos, "0 0 0.5");
rotation = "0 0 0 0";
scale = "1 1 1";
team = %obj.sourceObject.team;
deployed = "1";
powerFreq = "0";
};
%sensor.setOwner(%obj.sourceObject.getControllingClient().player);
setTargetSensorGroup(%sensor.getTarget(), %obj.sourceObject.team);
addToDeployGroup(%sensor);
%deplObj.sensor = %sensor;
}
else
BottomPrint(%obj.sourceObject.getControllingClient(), "Your team has reached the max of 5 Sonar Buoys.", 5);
%obj.schedule(10, "delete");
return;
}
}
schedule(100, 0, "changethebomb", %obj, %type);
}
function sonarPingLoop(%obj){
if(!isObject(%obj))
return;
InitContainerRadiusSearch(%obj.getPosition(), 300, $TypeMasks::VehicleObjectType);
while ((%SearchResult = containerSearchNext()) != 0){
%SearchObj = FirstWord(%SearchResult);
if(%searchObj.getDataBlock().getName() $= "Sub" || %searchObj.getDataBlock().getName() $= "Boat"){
if(isObject(%SearchObj.SnrBeacon[%obj.team]))
%SearchObj.SnrBeacon[%obj.team].setPosition(%searchObj.getWorldBoxCenter());
else{
%SearchObj.SnrBeacon[%obj.team] = new BeaconObject() {
dataBlock = "SubBeacon";
beaconType = "vehicle";
position = %SearchObj.getWorldBoxCenter();
};
%SearchObj.SnrBeacon[%obj.team].playThread($AmbientThread, "ambient");
%SearchObj.SnrBeacon[%obj.team].team = %obj.team;
%SearchObj.SnrBeacon[%obj.team].sourceObject = %SearchObj;
%SearchObj.SnrBeacon[%obj.team].setTarget(%obj.team);
MissionCleanup.add(%SearchObj.SnrBeacon[%obj.team]);
%SearchObj.SnrBeacon[%obj.team].schedule(9500, "delete");
}
serverPlay3d("InboundTorpPing",%SearchObj.getWorldBoxCenter());
}
}
%obj.sonarloop = schedule(2000, 0, "sonarPingLoop", %obj);
}
function AWACS::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}
function SonarBuoy::onDestroyed(%this, %obj, %prevState) {
if (%obj.isRemoved)
return;
%obj.isRemoved = true;
Parent::onDestroyed(%this, %obj, %prevState);
$TeamDeployedCount[%obj.team, SonarBuoy]--;
// remDSurface(%obj);
%obj.schedule(500, "delete");
%obj.sensor.schedule(500, "delete");
fireBallExplode(%obj,1);
}

View file

@ -0,0 +1,705 @@
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock ParticleData(CLSubExplosionSmoke)
{
dragCoeffiecient = 1.0;
gravityCoefficient = -0.5; // rises slowly
inheritedVelFactor = 0.025;
lifetimeMS = 1250;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
textureName = "special/Smoke/smoke_001";
colors[0] = "0.5 0.5 0.5 1.0";
colors[1] = "0.5 0.5 0.5 0.5";
colors[2] = "0.6 0.6 0.6 0.0";
sizes[0] = 1.0;
sizes[1] = 2.0;
sizes[2] = 3.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(CLSubSmokeEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 6.0;
velocityVariance = 6.0;
thetaMin = 80.0;
thetaMax = 90.0;
lifetimeMS = 750;
particles = "CLSubExplosionSmoke";
};
datablock ParticleData(CLSubSparks)
{
dragCoefficient = 1;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 500;
lifetimeVarianceMS = 100;
textureName = "special/bigspark";
colors[0] = "0.56 0.36 0.26 1.0";
colors[1] = "0.56 0.36 0.26 1.0";
colors[2] = "1.0 0.36 0.26 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 1.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(CLSubSparksEmitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 15;
velocityVariance = 10.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 90;
lifetimeMS = 500;
particles = "CLSubSparks";
};
//----------------------------------------------------
// Explosion
//----------------------------------------------------
datablock ExplosionData(ClusterSubExplosion)
{
soundProfile = GrenadeExplosionSound;
faceViewer = true;
explosionScale = "1.0 1.0 1.0";
emitter[0] = CLSubSmokeEmitter;
emitter[1] = CLSubSparksEmitter;
shakeCamera = true;
camShakeFreq = "10.0 6.0 9.0";
camShakeAmp = "10.0 10.0 10.0";
camShakeDuration = 1.0;
camShakeRadius = 10.0;
};
datablock WheeledVehicleData(Artillery) : TankDamageProfile
{
spawnOffset = "0 0 1.0";
renderWhenDestroyed = false;
canControl = false;
catagory = "Vehicles";
shapeFile = "vehicle_land_mpbase.dts";
multipassenger = true;
computeCRC = true;
debrisShapeName = "vehicle_land_mpbase.dts";
debris = GShapeDebris;
drag = 0.0;
density = 20.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
cantAbandon = 1;
cameraMaxDist = 20;
cameraOffset = 6;
cameraLag = 1.5;
explosion = HGVehicleExplosion;
explosionDamage = 4.0;
explosionRadius = 20.0;
maxSteeringAngle = 0.3; // 20 deg.
// Rigid Body
mass = 2000;
bodyFriction = 0.8;
bodyRestitution = 0.5;
minRollSpeed = 3;
gyroForce = 400;
gyroDamping = 0.3;
stabilizerForce = 10;
minDrag = 10;
softImpactSpeed = 15; // Play SoftImpact Sound
hardImpactSpeed = 25; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 30;
speedDamageScale = 0.060;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 30;
collDamageMultiplier = 0.070;
// Engine
engineTorque = 10.0 * 745;
breakTorque = 6.0 * 745;
maxWheelSpeed = 15;
// Springs
springForce = 10000;
springDamping = 1000;
antiSwayForce = 7500;
staticLoadScale = 2;
// Tires
tireRadius = 2.5;
tireFriction = 50.0;
tireRestitution = 0.5;
tireLateralForce = 3000;
tireLateralDamping = 400;
tireLateralRelaxation = 1;
tireLongitudinalForce = 10000;
tireLongitudinalDamping = 400;
tireLongitudinalRelaxation = 1;
tireEmitter = TireEmitter;
//
maxDamage = 5.5;
destroyedLevel = 5.5;
HDAddMassLevel = 3.85;
HDMassImage = APCHDMassImage;
isShielded = false;
energyPerDamagePoint = 0;
maxEnergy = 600;
jetForce = 2800;
minJetEnergy = 60;
jetEnergyDrain = 0.1;
rechargeRate = 1.0;
jetSound = MPBThrustSound;
engineSound = MPBEngineSound;
squeelSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 8.0;
hardSplashSoundVelocity = 12.0;
exitSplashSoundVelocity = 8.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterHardSound;
waterWakeSound = VehicleWakeMediumSplashSound;
minMountDist = 10;
damageEmitter[0] = LightDamageSmoke;
damageEmitter[1] = MeHGHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "3.0 0.5 0.0 ";
damageEmitterOffset[1] = "-3.0 0.5 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 2;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDGroundMPBIcon;
cmdMiniIconName = "commander/MiniIcons/com_mpb_grey";
targetNameTag = 'Grendel';
targetTypeTag = 'Heavy Artillery';
sensorData = PlayerSensor;
checkRadius = 7.5225;
observeParameters = "1 12 12";
runningLight[0] = MPBLight1;
runningLight[1] = MPBLight2;
shieldEffectScale = "0.85 1.2 0.7";
max[MortarAmmo] = 12;
replaceTime = 60;
};
//---------------------------------------------
// Weapon Stuff
//---------------------------------------------
datablock TurretData(ArtilleryTurret) : TankDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "turret_base_large.dts";
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'Artillery';
targetTypeTag = 'Turret';
mass = 1.0; // Not really relevant
maxEnergy = 1000;
maxDamage = Artillery.maxDamage;
destroyedLevel = Artillery.destroyedLevel;
repairRate = 0;
// capacitor
maxCapacitorEnergy = 100;
capacitorRechargeRate = 1.5;
thetaMin = 30;
thetaMax = 100;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
numWeapons = 1;
cameraDefaultFov = 90.0;
cameraMinFov = 5.0;
cameraMaxFov = 120.0;
targetNameTag = 'APC CG';
targetTypeTag = 'Turret';
max[MortarAmmo] = 12;
};
datablock GrenadeProjectileData(ArtilleryShot)
{
projectileShapeName = "grenade_projectile.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 3.5;
damageRadius = 25.0;
radiusDamageType = $DamageType::Artillery;
kickBackStrength = 4000;
explosion = "artillerybarrelexplosion";
velInheritFactor = 0.0;
splash = GrenadeSplash;
baseEmitter = TankArtillerySmokeEmitter;
bubbleEmitter = GrenadeBubbleEmitter;
grenadeElasticity = 0.0;
grenadeFriction = 0.3;
armingDelayMS = -1;
gravityMod = 1.0;
muzzleVelocity = 225.0;
drag = 0.1;
sound = MortarTurretProjectileSound;
hasLight = true;
lightRadius = 3;
lightColor = "0.05 0.2 0.05";
};
datablock GrenadeProjectileData(ClusterSubProj)
{
projectileShapeName = "grenade.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 0.5;
damageRadius = 12.0;
radiusDamageType = $DamageType::Artillery;
kickBackStrength = 2000;
explosion = "ClusterSubExplosion";
underwaterExplosion = "GrenadeExplosion";
velInheritFactor = 0.5;
splash = MissileSplash;
depthTolerance = 0.01;
baseEmitter = TankArtillerySmokeEmitter;
bubbleEmitter = GrenadeBubbleEmitter;
grenadeElasticity = 0.0;
grenadeFriction = 0.0;
armingDelayMS = -1;
gravityMod = 1.0;
muzzleVelocity = 225.0;
drag = 0.2;
sound = MortarTurretProjectileSound;
hasLight = true;
lightRadius = 4;
lightColor = "0.05 0.2 0.05";
hasLightUnderwaterColor = true;
underWaterLightColor = "0.05 0.075 0.2";
};
datablock TurretImageData(ArtilleryBarrel)
{
className = WeaponImage;
shapeFile = "turret_tank_barrelmortar.dts";
item = MissileLauncher;
ammo = MortarAmmo;
projectile = ArtilleryShot;
projectileType = GrenadeProjectile;
offset = "0.5 0 0";
usesEnergy = false;
useMountEnergy = true;
fireEnergy = 0.0;
minEnergy = 0.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "WaitFire1";
stateTimeoutValue[0] = 1;
stateSequence[0] = "Activate";
stateName[1] = "WaitFire1";
stateTransitionOnTriggerDown[1] = "Fire1";
stateTransitionOnNoAmmo[1] = "NoAmmo1";
stateName[2] = "Fire1";
stateTransitionOnTimeout[2] = "Reload1";
stateTimeoutValue[2] = 2.0;
stateFire[2] = true;
stateEmitter[2] = "WhiteHorseHeatSeekerFireEffectEmitter";
stateEmitterNode[2] = "muzzlepoint1";
stateEmitterTime[2] = 1;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateSound[2] = AssaultMortarFireSound;
stateName[3] = "Reload1";
stateSequence[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateAllowImageChange[3] = false;
stateTransitionOnTimeout[3] = "WaitFire2";
stateTransitionOnNoAmmo[3] = "NoAmmo1";
stateName[4] = "NoAmmo1";
stateTransitionOnAmmo[4] = "AmmoLoading1";
stateSequence[4] = "NoAmmo1";
stateTransitionOnTriggerDown[4] = "DryFire1";
stateName[5] = "DryFire1";
stateSound[5] = BomberTurretDryFireSound;
stateTimeoutValue[5] = 0.75;
stateTransitionOnTimeout[5] = "NoAmmo1";
stateName[6] = "WaitFire2";
stateTransitionOnTriggerDown[6] = "Fire2";
stateTransitionOnNoAmmo[6] = "NoAmmo2";
stateName[7] = "Fire2";
stateTransitionOnTimeout[7] = "Reload2";
stateTimeoutValue[7] = 0.5;
stateScript[7] = "FirePair";
stateName[8] = "Reload2";
stateSequence[8] = "Reload";
stateTimeoutValue[8] = 4.0;
stateAllowImageChange[8] = false;
stateTransitionOnTimeout[8] = "WaitFire1";
stateTransitionOnNoAmmo[8] = "NoAmmo2";
stateName[9] = "NoAmmo2";
stateTransitionOnAmmo[9] = "AmmoLoading2";
stateSequence[9] = "NoAmmo2";
stateTransitionOnTriggerDown[9] = "DryFire2";
stateName[10] = "DryFire2";
stateSound[10] = BomberTurretDryFireSound;
stateTimeoutValue[10] = 0.75;
stateTransitionOnTimeout[10] = "NoAmmo2";
stateName[11] = "AmmoLoading1";
stateSound[11] = MissileReloadSound;
stateTimeoutValue[11] = 0.1;
stateAllowImageChange[11] = false;
stateTransitionOnTimeout[11] = "Reload1";
stateName[12] = "AmmoLoading2";
stateSound[12] = MissileReloadSound;
stateTimeoutValue[12] = 0.1;
stateAllowImageChange[12] = false;
stateTransitionOnTimeout[12] = "Reload2";
};
datablock TurretImageData(ArtilleryBarrel2)
{
className = WeaponImage;
shapeFile = "turret_tank_barrelmortar.dts";
item = MissileLauncher;
ammo = MortarAmmo;
projectile = ArtilleryShot;
projectileType = GrenadeProjectile;
offset = "-0.5 0 0";
usesEnergy = false;
useMountEnergy = true;
fireEnergy = 0.0;
minEnergy = 0.0;
stateName[0] = "WaitFire";
stateTransitionOnTriggerDown[0] = "Fire";
stateName[1] = "Fire";
stateTransitionOnTimeout[1] = "StopFire";
stateTimeoutValue[1] = 2.0;
stateFire[1] = true;
stateEmitter[1] = "WhiteHorseHeatSeekerFireEffectEmitter";
stateEmitterNode[1] = "muzzlepoint1";
stateEmitterTime[1] = 1;
stateAllowImageChange[1] = false;
stateSequence[1] = "Fire";
stateScript[1] = "onFire";
stateSound[1] = AssaultMortarFireSound;
stateName[2] = "StopFire";
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "WaitFire";
stateScript[2] = "stopFire";
};
datablock TurretImageData(ArtilleryParam)
{
mountPoint = 0;
shapeFile = "turret_muzzlepoint.dts";
offset = "0.0 1.0 0.0";
projectile = ArtilleryShot;
projectileType = GrenadeProjectile;
useCapacitor = false;
usesEnergy = true;
// Turret parameters
activationMS = 500;
deactivateDelayMS = 550;
thinkTimeMS = 200;
degPerSecTheta = 500;
degPerSecPhi = 500;
attackRadius = 225;
};
//---------------------------------------------
// Vehicle.cs stuff
//---------------------------------------------
function Artillery::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.schedule(6000, "playThread", $ActivateThread, "activate");
%obj.selweapontype = 1;
%obj.firing = 0;
%turret = TurretData::create(ArtilleryTurret);
%turret.selectedWeapon = 1;
MissionCleanup.add(%turret);
%turret.team = %obj.teamBought;
%turret.setSelfPowered();
%obj.mountObject(%turret, 1);
%turret.mountImage(ArtilleryParam, 0);
%turret.mountImage(ArtilleryBarrel, 2);
%turret.mountImage(ArtilleryBarrel2, 3);
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
%obj.turretObject = %turret;
%turret.setAutoFire(false);
%turret.setInventory(MortarAmmo, 10);
%turret.mountedto = %obj;
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
}
function Artillery::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(1);
if (!%turret)
return;
if (%client = %turret.getControllingClient())
{
%client.player.setControlObject(%client.player);
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
}
%turret.schedule(1000, delete);
if(isObject(%obj.beacon))
%obj.beacon.schedule(50, delete);
}
function Artillery::playerMounted(%data, %obj, %player, %node)
{
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
if(%obj.firing == 1){
%turret = %obj.getMountNodeObject(1);
if (!%player.client.isAIControlled())
{
%player.setControlObject(%turret);
%player.client.setObjectActiveImage(%turret, 2);
}
}
commandToClient(%player.client, 'setHudMode', 'Pilot', "MPB", %node);
bottomPrint(%player.client, "Press Grenade button to switch to firing mode.", 5, 2 );
if ( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
}
//---------------------------------------------
// Weapon Stuff
//---------------------------------------------
function Artillery::onTrigger(%data, %obj, %trigger, %state)
{
%player = %obj.getMountNodeObject(0);
if(%trigger == 4)
{
switch (%state)
{
case 1:
%turret = %obj.getMountNodeObject(1);
if (!%player.client.isAIControlled())
{
%player.setControlObject(%turret);
%player.client.setObjectActiveImage(%turret, 2);
commandToClient(%player.client, 'setHudMode', 'Pilot', "Assault", 1);
}
%obj.firing = 1;
bottomPrint(%player.client, "Will need to be reloaded with Artillery Reloader Pack.", 5, 2 );
}
}
}
function ArtilleryTurret::onTrigger(%data, %obj, %trigger, %state)
{
switch (%trigger)
{
case 0:
%obj.fireTrigger = %state;
if(%state)
%obj.setImageTrigger(2, true);
else
%obj.setImageTrigger(2, false);
case 2:
if(%state)
%obj.getDataBlock().playerDismount(%obj);
case 4:
if(%state){
%client = %obj.getControllingClient();
if (!%client.isAIControlled())
%client.player.unmount();
%obj.mountedto.firing = 0;
}
}
}
function ArtilleryBarrel::firePair(%this, %obj, %slot){
%obj.setImageTrigger( 3, true);
}
function ArtilleryBarrel2::stopFire(%this, %obj, %slot){
%obj.setImageTrigger( 3, false);
}
function ArtilleryBarrel::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
if(%obj.mountedto.selweapontype == 2)
%p.cluster = schedule(1000, %p, "ARTdocluster", %p, %slot, %obj, 0);
}
function ArtilleryBarrel2::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
if(%obj.mountedto.selweapontype == 2)
%p.cluster = schedule(1000, %p, "ARTdocluster", %p, %slot, %obj, 0);
}
function ArtilleryTurret::playerDismount(%data, %obj)
{
//Passenger Exiting
%obj.fireTrigger = 0;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
%client = %obj.getControllingClient();
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
setTargetSensorGroup(%obj.getTarget(), 0);
setTargetNeverVisMask(%obj.getTarget(), 0xffffffff);
}
function ARTdocluster(%proj,%slot,%obj,%pos2){
%pos = %proj.getPosition();
if(%pos2 != 0){
%vec = vectorNormalize(vectorSub(%pos,%pos2));
%newvec = vectorscale(%vec, 380);
%newvec = vectoradd(%pos,%newvec);
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType;
%searchresult = containerRayCast(%pos, %newvec, %mask);
if(%searchresult){
for (%i=0; %i < 45; %i++)
{
%x = (getRandom() - 0.5) * 2 * 3.1415926 * 0.025;
%y = (getRandom() - 0.5) * 2 * 3.1415926 * 0.013;
%z = (getRandom() - 0.5) * 2 * 3.1415926 * 0.03;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%newvector = MatrixMulVector(%mat, %vec);
%newvector = vectorScale(%newvector, (getRandom() + 0.5));
%p = new GrenadeProjectile()
{
dataBlock = ClusterSubProj;
initialDirection = %newvector;
initialPosition = %pos;
sourceObject = %obj;
damageFactor = 1;
sourceSlot = %slot;
};
}
%proj.delete();
return;
}
}
%pos2 = %pos;
%proj.cluster = schedule(100, %proj, "ARTdocluster", %proj, %slot, %obj, %pos2);
}

View file

@ -0,0 +1,449 @@
$missile::maxturnspeed = 220;
$missile::maxforwardspeed = 900;
datablock TracerProjectileData(CGM_exp)
{
doDynamicClientHits = true;
directDamage = 0.0;
directDamageType = $DamageType::MissileTurret;
explosion = "artillerybarrelexplosion";
splash = ChaingunSplash;
hasDamageRadius = true;
indirectDamage = 5.5;
damageRadius = 45.0;
radiusDamageType = $DamageType::MissileTurret;
kickBackStrength = 500;
sound = ChaingunProjectile;
dryVelocity = 1.0;
wetVelocity = 1.0;
velInheritFactor = 1.0;
fizzleTimeMS = 32;
lifetimeMS = 33;
explodeOnDeath = true;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 1;
tracerLength = 1.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.35;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.5 0.5 0.175";
};
datablock FlyingVehicleData(CGmissile) : ShrikeDamageProfile
{
spawnOffset = "0 0 2";
canControl = false;
catagory = "Vehicles";
shapeFile = "vehicle_grav_scout.dts";
multipassenger = false;
computeCRC = true;
debrisShapeName = "vehicle_grav_scout.dts";
debris = MeShapeDebris;
renderWhenDestroyed = false;
drag = 0.15;
density = 1.0;
numMountPoints = 0;
cameraMaxDist = 15;
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = MeVehicleExplosion;
explosionDamage = 1.0;
explosionRadius = 20.0;
maxDamage = 0.5;
destroyedLevel = 0.5;
HDAddMassLevel = 0.4;
HDMassImage = ShrikeHDMassImage;
isShielded = false;
energyPerDamagePoint = 0;
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 = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 10000; // 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 = 0; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 1.0; // Dampen control input so you don't` whack out at very slow speeds
// Maneuvering
maxSteeringAngle = 4.5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 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 = 5250; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 600; // Steering jets (force applied when you move the mouse)
steeringRollForce = 3000; // Steering jets (how much you heel over when you turn)
rollForce = 1; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 1; // Height off the ground at rest
createHoverHeight = 1; // Height off the ground when created
maxForwardSpeed = 130; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 2500; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 0.1; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 1.25;
// Rigid body
mass = 150; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 14; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 20; // 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 = 150; // The speed your contrail shows up at.
trailEmitter = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = ScoutFlyerThrustSound;
engineSound = ScoutFlyerThrustSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 15.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 1.0;
damageEmitter[0] = MissileSmokeEmitter;
damageEmitter[1] = MeHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "0.0 -0.3 0.0 ";
damageLevelTolerance[0] = 0.0;
damageLevelTolerance[1] = 0.75;
numDmgEmitterAreas = 1;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
targetNameTag = 'TomaHawk';
targetTypeTag = 'Cruise Missile';
sensorData = PlayerSensor;
checkRadius = 5.5;
observeParameters = "1 10 10";
runningLight[0] = ShrikeLight1;
shieldEffectScale = "0.937 1.125 0.60";
};
datablock TurretData(CGMTurret) : TurretDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "turret_base_large.dts";
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingBomberIcon;
cmdMiniIconName = "commander/MiniIcons/com_bomber_grey";
mass = 1.0; // Not really relevant
repairRate = 0;
maxDamage = CGmissile.maxDamage;
destroyedLevel = CGmissile.destroyedLevel;
thetaMin = 1;
thetaMax = 180;
thetaNull = 90;
// capacitor
maxCapacitorEnergy = 200;
capacitorRechargeRate = 5.0;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
numWeapons = 1;
targetNameTag = 'CGM';
targetTypeTag = 'Turret';
};
datablock TurretImageData(CGMTL)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
offset = "0 0 0";
mountPoint = 1;
projectile = GunshipTlProj;
projectileType = TargetProjectile;
deleteLastProjectile = false;
usesEnergy = true;
useMountEnergy = true;
useCapacitor = false;
minEnergy = 0;
fireEnergy = 1.0;
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Ready";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateName[2] = "Fire";
stateEnergyDrain[2] = 0;
stateFire[2] = true;
stateScript[2] = "onFire";
stateTransitionOnTriggerUp[2] = "Deconstruct";
stateName[3] = "Deconstruct";
stateScript[3] = "onDecon";
stateTimeoutValue[3] = 0.1;
stateTransitionOnTimeout[3] = "Ready";
};
datablock StaticShapeData(TMShape) : StaticShapeDamageProfile {
shapeFile = "weapon_missile_projectile.dts";
mass = 1.0;
repairRate = 0;
dynamicType = $TypeMasks::StaticShapeObjectType;
heatSignature = 0;
};
function CGMTL::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%p.setTarget(%obj.team);
%obj.TL = %p;
CGMfollowloop(%obj.vehicleMounted);
schedule(1000, 0, 'CGMExplode', %obj.vehicleMounted);
}
function CGMTL::onDecon(%data,%obj,%slot){
%obj.TL.delete();
}
function CGmissile::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
%obj.schedule(5500, "playThread", $ActivateThread, "activate");
%turret = TurretData::create(CGMTurret);
MissionCleanup.add(%turret);
%turret.team = %obj.teamBought;
%turret.selectedWeapon = 1;
%turret.setSelfPowered();
%obj.mountObject(%turret, 10);
%turret.mountImage(AIAimingTurretBarrel, 0);
%turret.mountImage(CGMTL, 2);
%turret.setImageTrigger(2, true);
%obj.turretObject = %turret;
%turret.vehicleMounted = %obj;
%turret.setAutoFire(false);
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
%obj.startFade(0,10,1);
%turret.startFade(10,20,1);
%body = new StaticShape()
{
scale = "5 5 5";
dataBlock = "TMShape";
};
MissionCleanup.add(%body);
%obj.mountObject(%body, 1);
%body.vehicleMounted = %obj;
}
function startCGM(%p){
if(!isObject(%p))
return;
%data = "CGmissile";
%pn = %data.create(0);
%pn.setTransform(%p.getPosition() SPC "1 0 0 -90");
%pn.CGMsourceObject = %p.sourceObject;
%pn.CGMsourceSlot = %p.sourceSlot;
%pn.applyImpulse(%pn.getPosition(),vectorScale(%p.sourceObject.vehicleObject.getVelocity(),%data.mass));
MissionCleanup.add(%pn);
%client = %p.sourceObject.getControllingClient();
if (!%client.isAIControlled())
{
%client.player.setControlObject(%pn.turretObject);
%client.player.client.setObjectActiveImage(%pn.turretObject, 2);
}
%p.delete();
}
function CGMfollowloop(%obj){
if(!isObject(%obj))
return;
if(!isObject(%obj.turretObject.TL))
return;
%pos = %obj.getPosition();
%targetpos = %obj.turretObject.TL.getTargetPoint();
if(%targetpos $= "0 0 0 -1"){
%Tpos = %obj.turretObject.getPosition();
%Tvec = vectorScale(%obj.turretObject.getMuzzleVector(2),1500);
%targetpos = vectorAdd(%Tpos,%Tvec);
}
%frontvec = %obj.getForwardVector();
%vector = vectorNormalize(vectorSub(%targetpos,%pos));
%obj.applyImpulse(vectorAdd(%pos,%frontvec),vectorScale(%vector,$missile::maxturnspeed)); //make it turn toward Target
%obj.applyImpulse(%pos,vectorScale(%frontvec,$missile::maxforwardspeed)); //make it go forward
%obj.following = schedule(100, 0, "CGMfollowloop", %obj);
}
function CGMExplode(%obj){
if(!isObject(%obj))
return;
InitContainerRadiusSearch(%obj.getWorldBoxCenter(), 15, $TypeMasks::VehicleObjectType);
while ((%SearchResult = containerSearchNext()) != 0)
{
if(%searchObj !$= %obj){
%pn = new (TracerProjectile)() {
dataBlock = CGM_exp;
initialDirection = vectorNormalize(%obj.getVelocity());
initialPosition = %obj.getWorldBoxCenter();
sourceObject = %obj.CGMsourceObject;
sourceSlot = %obj.CGMsourceSlot;
};
MissionCleanup.add(%pn);
return;
}
}
%obj.doexplodecheck = schedule(30, 0, "CGMExplode", %obj);
}
function CGmissile::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(10);
if (isObject(%turret)){
%turret.altTrigger = 0;
%turret.fireTrigger = 0;
if (%client = %turret.getControllingClient())
{
if(isObject(%obj.CGMSourceObject)){
%client.player.setControlObject(%obj.CGMSourceObject);
%obj.CGMSourceObject.selectedWeapon = 1;
commandToClient(%client,'SetWeaponryVehicleKeys', true);
commandToClient(%client, 'setHudMode', 'Pilot', "bomber", %node);
} else {
%client.player.setControlObject(%client.player);
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
%client.player.bomber = false;
%client.player.isBomber = false;
}
}
%turret.schedule(2000, delete);
if(isObject(%turret.TL))
%turret.TL.delete();
}
%body = %obj.getMountNodeObject(1);
if (isObject(%body))
%body.schedule(2000, delete);
%pn = new (TracerProjectile)() {
dataBlock = CGM_exp;
initialDirection = "0 0 1";
initialPosition = %obj.getWorldBoxCenter();
sourceObject = %obj.CGMsourceObject;
sourceSlot = %obj.CGMsourceSlot;
};
MissionCleanup.add(%pn);
}
function CGmissile::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}

View file

@ -0,0 +1,525 @@
//**************************************************************
// Long Range Artillery
//**************************************************************
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(CGTank) : TankDamageProfile
{
spawnOffset = "0 0 4";
floatingGravMag = 4.5;
catagory = "Vehicles";
shapeFile = "vehicle_grav_tank.dts";
multipassenger = true;
computeCRC = true;
renderWhenDestroyed = false;
weaponNode = 1;
debrisShapeName = "vehicle_grav_tank.dts";
debris = GShapeDebris;
drag = 0.0;
density = 0.9;
mountPose[0] = sitting;
mountPose[1] = sitting;
numMountPoints = 2;
isProtectedMountPoint[0] = true;
isProtectedMountPoint[1] = false;
cameraMaxDist = 20;
cameraOffset = 3;
cameraLag = 1.5;
explosion = HGVehicleExplosion;
explosionDamage = 1.5;
explosionRadius = 25.0;
maxSteeringAngle = 0.5; // 20 deg.
maxDamage = 3.2;
destroyedLevel = 3.2;
HDAddMassLevel = 2.24;
HDMassImage = TankHDMassImage;
isShielded = false;
rechargeRate = 1.0;
energyPerDamagePoint = 300;
maxEnergy = 400;
minJetEnergy = 15;
jetEnergyDrain = 2.0;
// Rigid Body
mass = 4000;
bodyFriction = 0.8;
bodyRestitution = 0.5;
minRollSpeed = 3;
gyroForce = 400;
gyroDamping = 0.3;
stabilizerForce = 20;
minDrag = 10;
softImpactSpeed = 15; // Play SoftImpact Sound
hardImpactSpeed = 18; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 17;
speedDamageScale = 0.060;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 18;
collDamageMultiplier = 0.045;
dragForce = 40 / 20;
vertFactor = 0.0;
floatingThrustFactor = 0.15;
mainThrustForce = 40;
reverseThrustForce = 25;
strafeThrustForce = 25;
turboFactor = 1.7;
brakingForce = 25;
brakingActivationSpeed = 4;
stabLenMin = 3.25;
stabLenMax = 4;
stabSpringConstant = 50;
stabDampingConstant = 20;
gyroDrag = 20;
normalForce = 20;
restorativeForce = 10;
steeringForce = 15;
rollForce = 5;
pitchForce = 3;
dustEmitter = TankDustEmitter;
triggerDustHeight = 3.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 3.6;
dustTrailFreqMod = 15.0;
jetSound = AssaultVehicleThrustSound;
engineSound = AssaultVehicleEngineSound;
floatSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
wheelImpactSound = WheelImpactSound;
forwardJetEmitter = TankJetEmitter;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 15.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
minMountDist = 7;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = MeHGHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -1.5 3.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 1;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'Bannshe 50mm';
targetTypeTag = 'chaingun tank';
sensorData = PlayerSensor;
checkRadius = 5.5535;
observeParameters = "1 10 10";
runningLight[0] = TankLight1;
runningLight[1] = TankLight2;
runningLight[2] = TankLight3;
runningLight[3] = TankLight4;
shieldEffectScale = "0.9 1.0 0.6";
showPilotInfo = 1;
replaceTime = 30;
};
//**************************************************************
// WEAPONS
//**************************************************************
datablock TracerProjectileData(BigBullet)
{
doDynamicClientHits = true;
directDamage = 0.4;
directDamageType = $DamageType::TankChaingun;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
kickBackStrength = 2000.0;
sound = ChaingunProjectile;
dryVelocity = 4000.0; // z0dd - ZOD, 8-12-02. Was 1000.0
wetVelocity = 1600.0;
velInheritFactor = 0.0;
fizzleTimeMS = 3000;
lifetimeMS = 1000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 25.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.25;
crossSize = 0.25;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = MG42Decal1;
decalData[1] = MG42Decal2;
decalData[2] = MG42Decal3;
decalData[3] = MG42Decal4;
decalData[4] = MG42Decal5;
decalData[5] = MG42Decal6;
};
//-------------------------------------
// Artillery CHAINGUN CHARACTERISTICS
//-------------------------------------
datablock TurretImageData(CGTurretParam)
{
mountPoint = 2;
shapeFile = "turret_muzzlepoint.dts";
projectile = BigBullet;
projectileType = TracerProjectile;
useCapacitor = true;
usesEnergy = true;
// Turret parameters
activationMS = 1000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 500;
degPerSecPhi = 500;
attackRadius = 750;
};
datablock TurretData(CGTurret) : TurretDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "Turret_tank_base.dts";
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'Bannshe';
targetTypeTag = '50mm chaingun turret';
mass = 1.0;
maxEnergy = 1;
maxDamage = CGTank.maxDamage;
destroyedLevel = CGTank.destroyedLevel;
repairRate = 0;
// capacitor
maxCapacitorEnergy = 1000;
capacitorRechargeRate = 10.0;
thetaMin = 0;
thetaMax = 100;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
cameraDefaultFov = 90.0;
cameraMinFov = 5.0;
cameraMaxFov = 120.0;
targetNameTag = '50mm chaingun';
targetTypeTag = 'Turret';
};
datablock TurretImageData(CGTurretBarrel)
{
shapeFile = "turret_tank_barrelchain.dts";
mountPoint = 1;
projectile = BigBullet;
projectileType = TracerProjectile;
casing = ShellDebris;
shellExitDir = "1.0 0.3 1.0";
shellExitOffset = "0.15 -0.56 -0.1";
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 1.5 / 1000.0;
useCapacitor = true;
usesEnergy = true;
useMountEnergy = true;
fireEnergy = 0.75;
minEnergy = 1.0;
// Turret parameters
activationMS = 2000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 360;
degPerSecPhi = 360;
attackRadius = 75;
// State transitions
stateName[0] = "Activate";
stateTransitionOnNotLoaded[0] = "Dead";
stateTransitionOnLoaded[0] = "ActivateReady";
stateSound[0] = AssaultTurretActivateSound;
stateName[1] = "ActivateReady";
stateSequence[1] = "Activate";
stateSound[1] = AssaultTurretActivateSound;
stateTimeoutValue[1] = 0.1;
stateTransitionOnTimeout[1] = "Ready";
stateTransitionOnNotLoaded[1] = "Deactivate";
stateName[2] = "Ready";
stateTransitionOnNotLoaded[2] = "Deactivate";
stateTransitionOnTriggerDown[2] = "Fire";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateName[3] = "Fire";
stateSequence[3] = "Fire";
stateSequenceRandomFlash[3] = true;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSound[3] = AssaultChaingunFireSound;
stateScript[3] = "onFire";
stateTimeoutValue[3] = 0.1;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Reload";
stateTransitionOnNoAmmo[3] = "noAmmo";
stateName[4] = "Reload";
stateSequence[4] = "Reload";
stateTimeoutValue[4] = 0.5;
stateAllowImageChange[4] = false;
stateTransitionOnTimeout[4] = "Ready";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateWaitForTimeout[4] = true;
stateName[5] = "Deactivate";
stateSequence[5] = "Activate";
stateDirection[5] = false;
stateTimeoutValue[5] = 0.1;
stateTransitionOnTimeout[5] = "ActivateReady";
stateName[6] = "Dead";
stateTransitionOnLoaded[6] = "ActivateReady";
stateTransitionOnTriggerDown[6] = "DryFire";
stateName[7] = "DryFire";
stateSound[7] = AssaultChaingunFireSound;
stateTimeoutValue[7] = 1.0;
stateTransitionOnTimeout[7] = "NoAmmo";
stateName[8] = "NoAmmo";
stateTransitionOnAmmo[8] = "Reload";
stateSequence[8] = "NoAmmo";
stateTransitionOnTriggerDown[8] = "DryFire";
};
datablock TurretImageData(CGTurretBarrel2) : CGTurretBarrel
{
mountPoint = 0;
};
function CGTank::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%turret = TurretData::create(CGTurret);
%turret.selectedWeapon = 1;
MissionCleanup.add(%turret);
%turret.team = %obj.teamBought;
%turret.setSelfPowered();
%obj.mountObject(%turret, 10);
%turret.mountImage(CGTurretBarrel, 2);
%turret.mountImage(CGTurretBarrel2, 3);
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
%obj.turretObject = %turret;
//vehicle turrets should not auto fire at targets
%turret.setAutoFire(false);
//Needed so we can set the turret parameters..
%turret.mountImage(CGTurretParam, 0);
%obj.schedule(6000, "playThread", $ActivateThread, "activate");
// set the turret's target info
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
}
function CGTank::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(10);
if (!%turret)
return;
if (%client = %turret.getControllingClient())
{
%client.player.setControlObject(%client.player);
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
}
%turret.schedule(2000, delete);
}
function CGTank::playerMounted(%data, %obj, %player, %node)
{
if (%node == 0)
{
commandToClient(%player.client, 'setHudMode', 'Pilot', "Assault", %node);
}
else if (%node == 1)
{
%turret = %obj.getMountNodeObject(10);
%player.vehicleTurret = %turret;
%player.setTransform("0 0 0 0 0 1 0");
%player.lastWeapon = %player.getMountedImage($WeaponSlot);
%player.unmountImage($WeaponSlot);
if (!%player.client.isAIControlled())
{
%player.setControlObject(%turret);
%player.client.setObjectActiveImage(%turret, 2);
}
%turret.turreteer = %player;
$aWeaponActive = 0;
commandToClient(%player.client, 'setHudMode', 'Pilot', "Assault", %node);
}
if ( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
%passString = buildPassengerString(%obj);
for(%i = 0; %i < %data.numMountPoints; %i++)
if (%obj.getMountNodeObject(%i) > 0)
commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString);
}
function CGTurret::onDamage(%data, %obj)
{
%newDamageVal = %obj.getDamageLevel();
if(%obj.lastDamageVal !$= "")
if(isObject(%obj.getObjectMount()) && %obj.lastDamageVal > %newDamageVal)
%obj.getObjectMount().setDamageLevel(%newDamageVal);
%obj.lastDamageVal = %newDamageVal;
}
function CGTurret::damageObject(%this, %targetObject, %sourceObject, %position, %amount, %damageType ,%vec, %client, %projectile)
{
//If vehicle turret is hit then apply damage to the vehicle
%vehicle = %targetObject.getObjectMount();
if(%vehicle)
%vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType, %vec, %client, %projectile);
}
function CGTurret::onTrigger(%data, %obj, %trigger, %state)
{
switch (%trigger)
{
case 0:
%obj.fireTrigger = %state;
if(%state)
{
%obj.setImageTrigger(2, true);
%obj.setImageTrigger(3, true);
}
else
{
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
}
case 2:
if(%state)
%obj.getDataBlock().playerDismount(%obj);
}
}
function CGTurret::playerDismount(%data, %obj)
{
%obj.fireTrigger = 0;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
%client = %obj.getControllingClient();
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
setTargetSensorGroup(%obj.getTarget(), 0);
setTargetNeverVisMask(%obj.getTarget(), 0xffffffff);
}
function CGTank::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}

View file

@ -0,0 +1,410 @@
//**************************************************************
// Drop Pod
//**************************************************************
datablock AudioProfile(DropPodThrustSound)
{
filename = "fx/vehicles/shrike_boost.wav";
description = AudioDefault3d;
preload = true;
effect = ScoutFlyerThrustEffect;
};
datablock WheeledVehicleData(DropPod) : MPBDamageProfile
{
spawnOffset = "0 0 1.0";
renderWhenDestroyed = false;
canControl = true;
catagory = "Vehicles";
shapeFile = "stackable2l.dts";
multipassenger = false;
computeCRC = true;
debrisShapeName = "stackable2l.dts";
debris = GShapeDebris;
drag = 0.0;
density = 20.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
cameraMaxDist = 20;
cameraOffset = 6;
cameraLag = 1.5;
explosionDamage = 0.0;
explosionRadius = 0.0;
maxSteeringAngle = 0.3; // 20 deg.
// Used to test if the station can deploy
stationPoints[1] = "-2.3 -7.38703 -0.65";
stationPoints[2] = "-2.3 -11.8 -0.65";
stationPoints[3] = "0 -7.38703 -0.65";
stationPoints[4] = "0 -11.8 -0.65";
stationPoints[5] = "2.3 -7.38703 -0.65";
stationPoints[6] = "2.3 -11.8 -0.65";
// Rigid Body
mass = 1000;
bodyFriction = 0.8;
bodyRestitution = 0.5;
minRollSpeed = 3;
gyroForce = 400;
gyroDamping = 0.3;
stabilizerForce = 10;
minDrag = 10;
softImpactSpeed = 15; // Play SoftImpact Sound
hardImpactSpeed = 25; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 24;
speedDamageScale = 0.025;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 15;
collDamageMultiplier = 0.03;
// Engine
engineTorque = 0 * 745;
breakTorque = 0 * 745;
maxWheelSpeed = 10;
// Springs
springForce = 8000;
springDamping = 1300;
antiSwayForce = 6000;
staticLoadScale = 2;
// Tires
tireRadius = 1.6;
tireFriction = 10.0;
tireRestitution = 0.5;
tireLateralForce = 3000;
tireLateralDamping = 400;
tireLateralRelaxation = 1;
tireLongitudinalForce = 12000;
tireLongitudinalDamping = 600;
tireLongitudinalRelaxation = 1;
tireEmitter = TireEmitter;
//
maxDamage = 2.0;
destroyedLevel = 2.0;
HDAddMassLevel = 1.5;
HDMassImage = WCHDMassImage;
isShielded = false;
energyPerDamagePoint = 125;
maxEnergy = 600;
jetForce = 0;
minJetEnergy = 60;
jetEnergyDrain = 0;
rechargeRate = 1.0;
jetSound = MPBThrustSound;
engineSound = MPBEngineSound;
squeelSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 8.0;
hardSplashSoundVelocity = 12.0;
exitSplashSoundVelocity = 8.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterHardSound;
waterWakeSound = VehicleWakeMediumSplashSound;
minMountDist = 3;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = SmallHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "3.0 0.5 0.0 ";
damageEmitterOffset[1] = "-3.0 0.5 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 2;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDGroundMPBIcon;
cmdMiniIconName = "commander/MiniIcons/com_mpb_grey";
targetNameTag = 'Drop';
targetTypeTag = 'Pod';
sensorData = VehiclePulseSensor;
checkRadius = 7.5225;
observeParameters = "1 12 12";
runningLight[0] = MPBLight1;
runningLight[1] = MPBLight2;
shieldEffectScale = "0.85 1.2 0.7";
replaceTime = 1;
};
datablock ParticleData(DropPodParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = -0.02;
inheritedVelFactor = 1.0;
lifetimeMS = 4000;
lifetimeVarianceMS = 500;
textureName = "special/Smoke/bigSmoke";
useInvAlpha = true;
spinRandomMin = -90.0;
spinRandomMax = 90.0;
colors[0] = "0.8 0.4 0.1 0.5";
colors[1] = "0.6 0.2 0.2 0.4";
colors[2] = "0.4 0.4 0.4 0.0";
colors[3] = "0.4 0.4 0.4 0.3";
colors[4] = "0.5 0.5 0.5 0.3";
colors[5] = "0.6 0.6 0.6 0.0";
sizes[0] = 1;
sizes[1] = 1.75;
sizes[2] = 0;
sizes[3] = 5;
sizes[4] = 6;
sizes[5] = 8;
times[0] = 0.0;
times[1] = 0.05;
times[2] = 0.1;
times[3] = 0.15;
times[4] = 0.7;
times[5] = 1.0;
};
datablock ParticleEmitterData(DropPodEmitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 35;
velocityVariance = 10;
thetaMin = 175.0;
thetaMax = 180.0;
particles = "DropPodParticle";
};
function MakeDropPod(%pos, %team){
%pod = new WheeledVehicle()
{
dataBlock = DropPod;
position = %pos;
rotation = "0 0 1 0";
team = %team;
};
MissionCleanUp.add(%pod);
return %pod;
}
function DropPod::playerMounted(%data, %obj, %player, %node)
{
centerPrint(%player.client, "<font:Impact:20><color:ffffff>WARNING: Do not eject out of the drop pod while it is in flight. \n<font:Hey:15>Use /SetCoord and /LaunchPod to launch the Drop Pod to a desired location.", 9, 3 );
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
}
function DropPod::deleteAllMounted(%data, %obj)
{
if(%veh.beacon){
%veh.beacon.delete();
%veh.beacon = "";
}
}
function ccSetCoord(%sender, %args){
if(!isObject(%sender.player))
return;
%plyr = %sender.player;
if(%args $= ""){
messageclient(%sender, 'MsgClient', "\c2Coordinates must be specified.");
}
if(%plyr.mountedToV){
%veh = %plyr.VmountedTo;
if(%veh.getDataBlock().getName() $= "DropPod"){
%veh.DPcoord = getWord(%args, 0)@" "@getWord(%args, 1);
messageclient(%sender, 'MsgClient', "\c2Drop Pod coordinates set to\c3 "@%veh.DPcoord@"");
%search = containerRayCast(%veh.DPcoord@" 10000",%veh.DPcoord@" -100",$TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TerrainObjectType, %veh);
%pos = getWords(%search,1,3);
echo(%pos);
if(%veh.beacon)
{
%veh.beacon.delete();
%veh.beacon = "";
}
%veh.beacon = new BeaconObject() {
dataBlock = "TargeterBeacon";
beaconType = "vehicle";
position = %pos;
};
%veh.beacon.playThread($AmbientThread, "ambient");
%veh.beacon.team = %plyr.team;
%veh.beacon.sourceObject = %veh;
// give it a team target
%veh.beacon.setTarget(%plyr.team);
MissionCleanup.add(%veh.beacon);
%sender.camera.setOrbitMode(%veh.beacon, %pos, 0.5, 10, 10);
%sender.camera.targetObj = %veh.beacon;
%sender.setControlObject( %sender.camera );
%sender.schedule(4000, "setControlObject", %plyr);
}
else
messageclient(%sender, 'MsgClient', '\c2You are not in a Drop Pod.');
}
else
messageclient(%sender, 'MsgClient', '\c2You are not in a Drop Pod.');
}
function ccLaunchPod(%sender, %args){
if(!isObject(%sender.player))
return;
%plyr = %sender.player;
if(%plyr.mountedToV){
%veh = %plyr.VmountedTo;
if(%veh.getDataBlock().getName() $= "DropPod"){
if(%veh.DPcoord !$= "")
launchDropPod(%veh);
else
messageclient(%sender, 'MsgClient', '\c2Please set the coordinates at which you wish to land with\c3 /SetCoord\c2.');
}
else
messageclient(%sender, 'MsgClient', '\c2You are not in a Drop Pod.');
}
else
messageclient(%sender, 'MsgClient', '\c2You are not in a Drop Pod.');
}
function launchDropPod(%obj){
if(!isObject(%obj))
return;
%vel = %obj.getVelocity();
if(vectorLen(%vel) < 200){
%obj.applyImpulse(%obj.getPosition(),vectorScale("0 0 1",(3.5 * %obj.getDatablock().mass)));
%charge = new ParticleEmissionDummy()
{
position = %obj.getPosition();
rotation = %obj.getRotation();
dataBlock = "defaultEmissionDummy";
emitter = "DropPodEmitter";
};
MissionCleanup.add(%charge);
%charge.schedule(100, "delete");
serverPlay3d("DropPodThrustSound",%obj.getPosition());
}
%z = getWord(%obj.getPosition(),2);
if(%z >= 10000){
%dist = vectorDist(%obj.DPcoord@" "@%z,%obj.getPosition());
%obj.setTransform(%obj.DPcoord@" "@%z@" 0 0 1 0");
%obj.setFrozenState(true);
%obj.schedule((%dist / 100) * 500,"setFrozenState",false);
schedule((%dist / 100) * 500, 0, "slowDropPod", %obj);
return;
}
if(vectorDist(%obj.getUpVector(),"0 0 1") >= 0.1){
%upvec = %obj.getUpVector();
%vec = vectorSub("0 0 1",%upvec);
%vec = vectorCross(%vec,%upvec);
%vec = vectorNormalize(vectorCross(%upvec,%vec));
%pos = vectorAdd(%obj.getPosition(),vectorScale(%upvec,(0.1 * %obj.getDatablock().mass)));
%obj.applyImpulse(%pos,%vec);
}
schedule(100, 0, "launchDropPod", %obj);
}
function slowDropPod(%obj){
if(!isObject(%obj))
return;
%vel = %obj.getVelocity();
if(%obj.slwspeed $= ""){
%Aresult = containerRayCast(%obj.getPosition(), vectorAdd(%obj.getPosition(),"0 0 -10000"), $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TerrainObjectType, 0);
%Avec = vectorSub(getWord(%Aresult,1)@" "@getWord(%Aresult,2)@" "@getWord(%Aresult,3),%obj.getPosition());
%obj.slwspeed = 3.0 + (mSqrt(vectorLen(%Avec)) / 18);
}
if(%obj.slowingdown != 1){
%result = containerRayCast(%obj.getPosition(), vectorAdd(%obj.getPosition(),vectorScale(%vel,3)), $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::TerrainObjectType, 0);
if(%result)
%obj.slowingdown = 1;
}
if(%obj.slowingdown == 1){
if(vectorLen(%vel) > 20){
%obj.applyImpulse(%obj.getPosition(),vectorScale("0 0 1",(%obj.slwspeed * %obj.getDatablock().mass)));
%charge = new ParticleEmissionDummy()
{
position = %obj.getPosition();
rotation = %obj.getRotation();
dataBlock = "defaultEmissionDummy";
emitter = "DropPodEmitter";
};
MissionCleanup.add(%charge);
%charge.schedule(100, "delete");
serverPlay3d("DropPodThrustSound",%obj.getPosition());
}
else if(getWord(%vel,2) > -5){
DropPodDismount(%obj);
return;
}
}
if(vectorDist(%obj.getUpVector(),"0 0 1") >= 0.1){
%upvec = %obj.getUpVector();
%vec = vectorSub("0 0 1",%upvec);
%vec = vectorCross(%vec,%upvec);
%vec = vectorNormalize(vectorCross(%upvec,%vec));
%pos = vectorAdd(%obj.getPosition(),vectorScale(%upvec,(0.1 * %obj.getDatablock().mass)));
%obj.applyImpulse(%pos,%vec);
}
schedule(100, 0, "slowDropPod", %obj);
}
function DropPodDismount(%obj){
if(!isObject(%obj))
return;
if(isObject(%obj.getMountNodeObject(0))){
%passenger = %obj.getMountNodeObject(0);
%passenger.unmount();
%pos = %obj.getPosition();
for(%i = 0; %i < 3; %i++){
%x = getWord(%pos, 0) + getRandom(3,8);
%y = getWord(%pos, 1) + getRandom(3,8);
%z = getWord(%pos, 2) + 10;
%startpos = %x@" "@%y@" "@%z;
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType;
%searchResult = containerRayCast(%startpos, vectorAdd(%startpos, "0 0 -20"), %mask, %leader.player);
if(%searchResult){
%trns = getWord(%searchResult, 1)@" "@getWord(%searchResult, 2)@" "@getWord(%searchResult, 3);
%i = 3;
}
}
if(%trns $= "")
%trns = %pos;
%passenger.setPosition(%trns);
// commandToClient(%passenger.client, 'setHudMode', 'Standard', "", 0);
schedule(100, 0, "commandToClient", %passenger.client, 'setHudMode', 'Standard', "", 0);
}
%obj.schedule(1000,"delete");
}

View file

@ -0,0 +1,630 @@
//**************************************************************
// Chopper
//**************************************************************
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(heavychopper) : ShrikeDamageProfile
{
spawnOffset = "0 0 2";
canControl = false;
catagory = "Vehicles";
shapeFile = "vehicle_air_bomber.dts";
multipassenger = true;
computeCRC = true;
debrisShapeName = "vehicle_air_bomber.dts";
debris = ShapeDebris;
renderWhenDestroyed = false;
drag = 0.3;
density = 1.0;
mountPose[0] = sitting;
mountPose[1] = sitting;
mountPose[3] = sitting;
mountPose[4] = sitting;
mountPose[5] = sitting;
numMountPoints = 6;
isProtectedMountPoint[0] = false;
isProtectedMountPoint[1] = false;
isProtectedMountPoint[2] = false;
isProtectedMountPoint[3] = true;
isProtectedMountPoint[4] = true;
isProtectedMountPoint[5] = true;
cameraMaxDist = 15;
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = MFVehicleExplosion;
explosionDamage = 1.5;
explosionRadius = 10.0;
maxDamage = 5.0;
destroyedLevel = 5.0;
HDAddMassLevel = 3.5;
HDMassImage = HHeliHDMassImage;
isShielded = false;
energyPerDamagePoint = 0;
maxEnergy = 150; // Afterburner and any energy weapon pool
rechargeRate = 1.0;
minDrag = 20; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 550; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 150; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 1.0; // Dampen control input so you don't` whack out at very slow speeds
// Maneuvering
maxSteeringAngle = 7; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 6; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 2; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 0; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 425; // Steering jets (force applied when you move the mouse)
steeringRollForce = 30; // Steering jets (how much you heel over when you turn)
rollForce = 6; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 3; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
maxForwardSpeed = 30; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 1000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 1; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 0.1; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 3.5;
// Rigid body
mass = 250; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 14; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 15; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.08;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23.0;
collDamageMultiplier = 0.02;
//
minTrailSpeed = 100; // The speed your contrail shows up at.
trailEmitter = ContrailEmitter;
//
jetSound = ScoutFlyerThrustSound;
engineSound = ScoutFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 15.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 1.0;
damageEmitter[0] = MFLightDamageSmoke;
damageEmitter[1] = MFHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "0.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 1;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
targetNameTag = 'Eagle VII';
targetTypeTag = 'Transport Chopper';
sensorData = PlayerSensor;
checkRadius = 5.5;
observeParameters = "1 10 10";
runningLight[0] = ShrikeLight1;
// runningLight[1] = ShrikeLight2;
shieldEffectScale = "0.937 1.125 0.60";
max[chaingunAmmo] = 1000;
max[PlasmaAmmo] = 20;
replaceTime = 50;
};
//**************************************************************
// WEAPONS
//**************************************************************
datablock ShapeBaseImageData(ChopperCGPairImage)
{
className = WeaponImage;
shapeFile = "turret_missile_large.dts";
item = Chaingun;
ammo = ChaingunAmmo;
projectile = Heli_CG_Bullet;
projectileType = TracerProjectile;
mountPoint = 10;
offset = "4.93 -4.52 0.044"; // L/R - F/B - T/B
projectileSpread = 1.0 / 1000.0;
usesEnergy = false;
emap = true;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.1;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.05;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateSound[3] = ShrikeBlasterFire;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.05;
stateAllowImageChange[4] = false;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ShrikeBlasterDryFireSound;
stateTimeoutValue[6] = 0.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock ShapeBaseImageData(ChopperCGImage) : ChopperCGPairImage
{
offset = "-4.93 -4.52 0.044";
};
datablock TracerProjectileData(HheliT_bullet)
{
doDynamicClientHits = true;
directDamage = 0.2; // z0dd - ZOD, 9-27-02. Was 0.0825
directDamageType = $DamageType::Bullet;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
kickBackStrength = 2000.0;
sound = ChaingunProjectile;
dryVelocity = 3000.0; // z0dd - ZOD, 8-12-02. Was 425.0
wetVelocity = 2500.0;
velInheritFactor = 0.0;
fizzleTimeMS = 3000;
lifetimeMS = 2500;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 10.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.06;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
};
datablock ShapeBaseImageData(HHeliChaingunImage)
{
className = WeaponImage;
shapeFile = "turret_tank_barrelchain.dts";
item = Chaingun;
ammo = ChaingunAmmo;
projectile = HheliT_bullet;
projectileType = TracerProjectile;
projectileSpread = 1.0 / 1000.0;
emap = true;
offset = "0.37 -0.4 -0.5";
casing = ShellDebris;
shellExitDir = "1.0 0.3 1.0";
shellExitOffset = "0.15 -0.56 -0.1";
shellExitVariance = 5.0;
shellVelocity = 0.0;
mountPoint = 1;
usesEnergy = true;
useCapacitor = true;
useMountEnergy = true;
minEnergy = 8;
fireEnergy = 8;
stateName[0] = "Activate";
stateSequence[0] = "Activate";
// stateSound[0] = GravChaingunIdleSound;
stateAllowImageChange[0] = false;
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Ready";
stateTransitionOnNoAmmo[0] = "NoAmmo";
stateName[1] = "Ready";
stateSpinThread[1] = Stop;
stateTransitionOnTriggerDown[1] = "Spinup";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateSpinThread[2] = Stop;
stateTransitionOnTriggerDown[2] = "DryFire";
stateName[3] = "Spinup";
stateScript[3] = "onSpinup";
stateSpinThread[3] = SpinUp;
stateSound[3] = ChaingunSpinupSound;
stateTimeoutValue[3] = 0.5;
stateWaitForTimeout[3] = false;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Spindown";
stateName[4] = "Fire";
stateSequence[4] = "Fire";
stateTransitionOnTriggerUp[4] = "Spindown";
stateTransitionOnNoAmmo[4] = "EmptySpindown";
stateSequenceRandomFlash[4] = true;
stateSpinThread[4] = FullSpeed;
stateSound[4] = HeliturretFireSound;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateFire[4] = true;
stateEjectShell[4] = true;
stateTimeoutValue[4] = 0.05;
stateTransitionOnTimeout[4] = "Fire";
stateName[5] = "Spindown";
stateScript[5] = "onSpindown";
stateSound[5] = ChaingunSpinDownSound;
stateSpinThread[5] = SpinDown;
stateTimeoutValue[5] = 0.5;
stateWaitForTimeout[5] = true;
stateTransitionOnTimeout[5] = "Ready";
stateTransitionOnTriggerDown[5] = "Spinup";
stateName[6] = "EmptySpindown";
stateScript[6] = "onSpindown";
stateSound[6] = ChaingunSpinDownSound;
stateSpinThread[6] = SpinDown;
stateTimeoutValue[6] = 2.5;
stateTransitionOnTimeout[6] = "NoAmmo";
stateName[7] = "DryFire";
stateSound[7] = ShrikeBlasterDryFireSound;
stateTimeoutValue[7] = 0.5;
stateTransitionOnTimeout[7] = "NoAmmo";
};
datablock ShapeBaseImageData(HHeliChaingunImage2) : HHeliChaingunImage
{
offset = "-0.23 -0.4 -0.5";
};
datablock ShapeBaseImageData(ChopperParam)
{
mountPoint = 2;
shapeFile = "turret_muzzlepoint.dts";
offset = "0 5 0"; // L/R - F/B - T/B
projectile = BigBullet;
projectileType = TracerProjectile;
};
function HeavyChopper::onDestroyed(%data, %obj, %prevState)
{
if(%obj.lastPilot.lastVehicle == %obj)
if(%obj.getMountNodeObject(0) == %obj.lastPilot)
schedule(200, %obj.lastPilot, "scKillPilot", %obj.lastPilot, %obj.lastDamagedBy);
Parent::onDestroyed(%data, %obj, %prevState);
}
datablock ShapeBaseImageData(DummyslotImg)
{
shapeFile = "grenade.dts";
emap = false;
};
//******************************************************
// vehicle.cs and weapturretcode.cs functions
//******************************************************
//----------------------------
// Helicopter FLIER
//----------------------------
function HeavyChopper::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
%obj.mountImage(ChopperParam, 0);
%obj.mountImage(ChopperCGImage, 2);
%obj.mountImage(ChopperCGPairImage, 3);
%obj.mountImage(DummySlotImg, 4);
%obj.selectedWeapon = 1;
%obj.nextWeaponFire = 2;
%obj.setInventory(chaingunammo, 1000);
%obj.schedule(5500, "playThread", $ActivateThread, "activate");
%turret = TurretData::create(HeliTurret);
MissionCleanup.add(%turret);
%turret.team = %obj.teamBought;
%turret.selectedWeapon = 1;
%turret.setSelfPowered();
%obj.mountObject(%turret, 10);
%turret.mountImage(heliTurretParam, 0);
%turret.mountImage(Hhelichaingunimage, 2);
%turret.mountImage(Hhelichaingunimage2, 3);
%obj.turretObject = %turret;
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
%turret.vehicleMounted = %obj;
%turret.setAutoFire(false);
%turret.mountImage(AIAimingTurretBarrel, 0);
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
%obj.canSwitchP = 1;
}
function HeavyChopper::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(10);
if (!%turret)
return;
%turret.altTrigger = 0;
%turret.fireTrigger = 0;
if (%client = %turret.getControllingClient())
{
%client.player.setControlObject(%client.player);
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
%client.player.bomber = false;
%client.player.isBomber = false;
}
%turret.schedule(1000, delete);
}
function HeavyChopper::playerMounted(%data, %obj, %player, %node)
{
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
bottomPrint(%player.client, "Transport Chopper: carrys 6 peeps has 2 forward mounted cg's controlled by pilot and cg turret on bottom", 5, 2 );
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
if (%node == 0)
{
%player.setPilot(true);
commandToClient(%player.client, 'setHudMode', 'Pilot', "Bomber", %node);
}
else if (%node == 1)
{
%turret = %obj.getMountNodeObject(10);
%player.vehicleTurret = %turret;
%player.setTransform("0 0 0 0 0 1 0");
%player.lastWeapon = %player.getMountedImage($WeaponSlot);
%player.unmountImage($WeaponSlot);
if (!%player.client.isAIControlled())
{
%player.setControlObject(%turret);
%player.client.setObjectActiveImage(%turret, 2);
}
%turret.bomber = %player;
$bWeaponActive = 0;
%obj.getMountNodeObject(10).selectedWeapon = 1;
// commandToClient(%player.client,'SetWeaponryVehicleKeys', true);
commandToClient(%player.client, 'setHudMode', 'Pilot', "Bomber", %node);
%player.isBomber = true;
}
else
{
// all others
commandToClient(%player.client, 'setHudMode', 'Passenger', "HAPC", %node);
}
// build a space-separated string representing passengers
// 0 = no passenger; 1 = passenger (e.g. "1 0 0 ")
%passString = buildPassengerString(%obj);
// send the string of passengers to all mounted players
for(%i = 0; %i < %data.numMountPoints; %i++)
if (%obj.getMountNodeObject(%i) > 0)
commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString);
// update observers who are following this guy...
if ( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
}
function HeavyChopper::onTrigger(%data, %obj, %trigger, %state)
{
// data = ScoutFlyer datablock
// obj = ScoutFlyer object number
// trigger = 0 for "fire", 1 for "jump", 3 for "thrust"
// state = 1 for firing, 0 for not firing
if(%trigger == 0)
{
switch (%state) {
case 0:
%obj.fireWeapon = false;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
case 1:
%obj.fireWeapon = true;
if(%obj.selectedWeapon == 1)
{
if(%obj.nextWeaponFire == 2)
{
%obj.setImageTrigger(2, true);
%obj.setImageTrigger(3, true);
}
// else
// {
// %obj.setImageTrigger(2, false);
// %obj.setImageTrigger(3, true);
// }
}
else
{
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
}
}
}
else if (%trigger ==4) // Throw flare
{
switch (%state)
{
case 0:
%obj.fireWeapon = false;
%obj.setImageTrigger(5, false);
case 1:
if (%obj.inv[PlasmaAmmo] > 0)
{
%obj.fireWeapon = true;
%obj.setImageTrigger(5, true);
%obj.decInventory(PlasmaAmmo, 1);
%p = new FlareProjectile()
{
dataBlock = FlareGrenadeProj;
initialDirection = "0 0 -1";
initialPosition = getBoxCenter(%obj.getWorldBox());
sourceObject = %obj;
sourceSlot = 0;
};
FlareSet.add(%p);
MissionCleanup.add(%p);
serverPlay3D(GrenadeThrowSound, getBoxCenter(%obj.getWorldBox()));
%p.schedule(6000, "delete");
// miscellaneous grenade-throwing cleanup stuff
%obj.lastThrowTime[%data] = getSimTime();
%obj.throwStrength = 0;
}
}
}
}
function HeavyChopper::playerDismounted(%data, %obj, %player)
{
%obj.fireWeapon = false;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
setTargetSensorGroup(%obj.getTarget(), %obj.team);
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, true );
}
function ChopperCGImage::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%obj.getMountNodeObject(0).decInventory(%data.ammo, 1);
}
function ChopperCGPairImage::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%obj.getMountNodeObject(0).decInventory(%data.ammo, 1);
}
function HHeliChaingunImage::OnSpinup(%data,%obj,%slot){
%obj.setImageTrigger(3,true);
}
function HHeliChaingunImage::OnSpindown(%data,%obj,%slot){
%obj.setImageTrigger(3,false);
}
function heavychopper::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,438 @@
//**************************************************************
// S17
//**************************************************************
datablock HoverVehicleData(S17) : ShrikeDamageProfile
{
spawnOffset = "0 0 1";
canControl = false;
floatingGravMag = 3.5;
catagory = "Vehicles";
shapeFile = "nexuscap.dts";
computeCRC = true;
debrisShapeName = "vehicle_grav_scout_debris.dts";
debris = ShapeDebris;
renderWhenDestroyed = false;
drag = 0.0;
density = 0.9;
cameraMaxDist = 5.0;
cameraOffset = 0.7;
cameraLag = 0.5;
numMountPoints = 0;
explosion = VehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
maxDamage = 1.5;
destroyedLevel = 1.5;
HDAddMassLevel = 1.2;
HDMassImage = WCHDMassImage;
isShielded = false;
rechargeRate = 0.7;
energyPerDamagePoint = 75;
maxEnergy = 150;
minJetEnergy = 15;
jetEnergyDrain = 0.1;
// Rigid Body
mass = 400;
bodyFriction = 0.1;
bodyRestitution = 0.5;
softImpactSpeed = 20; // Play SoftImpact Sound
hardImpactSpeed = 28; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 29;
speedDamageScale = 0.010;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23;
collDamageMultiplier = 0.030;
dragForce = 25 / 45.0;
vertFactor = 0.0;
floatingThrustFactor = 0.35;
mainThrustForce = 25;
reverseThrustForce = 15;
strafeThrustForce = 0;
turboFactor = 1.35;
brakingForce = 15;
brakingActivationSpeed = 3;
stabLenMin = 2.25;
stabLenMax = 3.75;
stabSpringConstant = 30;
stabDampingConstant = 16;
gyroDrag = 16;
normalForce = 30;
restorativeForce = 20;
steeringForce = 35;
rollForce = 15;
pitchForce = 7;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 2.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 3.6;
dustTrailFreqMod = 15.0;
jetSound = ScoutSqueelSound;
engineSound = ScoutEngineSound;
floatSound = ScoutThrustSound;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterSoftSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeSoftSplashSound;
minMountDist = 4;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = SmallHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -1.5 0.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.8;
numDmgEmitterAreas = 1;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
forwardJetEmitter = WildcatJetEmitter;
cmdCategory = Tactical;
cmdIcon = CMDHoverScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_landscout_grey";
targetNameTag = 'S17';
targetTypeTag = 'Combat Drone';
sensorData = PlayerSensor;
checkRadius = 1.7785;
observeParameters = "1 10 10";
runningLight[0] = WildcatLight1;
runningLight[1] = WildcatLight2;
runningLight[2] = WildcatLight3;
shieldEffectScale = "0.9375 1.125 0.6";
replaceTime = 20;
};
datablock StaticShapeData(S17switch) : StaticShapeDamageProfile {
shapeFile = "switch.dts";
mass = 1.0;
repairRate = 0;
dynamicType = $TypeMasks::StaticShapeObjectType;
heatSignature = 0;
};
//**************************************************************
// WEAPONS
//**************************************************************
//-------------------------------------
// CHOPPER BELLY TURRET CHARACTERISTICS
//-------------------------------------
datablock TurretData(S17Turret) : TurretDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "turret_base_large.dts";
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingBomberIcon;
cmdMiniIconName = "commander/MiniIcons/com_bomber_grey";
targetNameTag = 'S17';
targetTypeTag = 'Turret';
mass = 1.0; // Not really relevant
repairRate = 0;
maxDamage = S17.maxDamage;
destroyedLevel = S17.destroyedLevel;
maxEnergy = 1;
thetaMin = 60;
thetaMax = 150;
thetaNull = 90;
// capacitor
maxCapacitorEnergy = 200;
capacitorRechargeRate = 5.0;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
numWeapons = 1;
targetNameTag = 'Wildcat Chaingun';
targetTypeTag = 'Turret';
};
datablock TurretImageData(S17ChaingunImage)
{
className = WeaponImage;
shapeFile = "weapon_chaingun.dts";
// mountPoint = 1;
projectile = RPChaingunBullet;
projectileType = TracerProjectile;
projectileSpread = 1.2 / 1000.0;
casing = ShellDebris;
shellExitDir = "1.0 0.3 1.0";
shellExitOffset = "0.15 -0.56 -0.1";
shellExitVariance = 5.0;
shellVelocity = 0.0;
usesEnergy = true;
useCapacitor = true;
useMountEnergy = true;
minEnergy = 1;
fireEnergy = 0.1;
// Turret parameters
activationMS = 4000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 360;
degPerSecPhi = 360;
attackRadius = 75;
stateName[0] = "Activate";
stateSequence[0] = "deploy";
stateAllowImageChange[0] = false;
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Ready";
stateTransitionOnNoAmmo[0] = "NoAmmo";
stateName[1] = "Ready";
stateSpinThread[1] = Stop;
stateTransitionOnTriggerDown[1] = "Spinup";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateSpinThread[2] = Stop;
stateTransitionOnTriggerDown[2] = "DryFire";
stateName[3] = "Spinup";
stateSpinThread[3] = SpinUp;
stateTimeoutValue[3] = 0.01;
stateWaitForTimeout[3] = false;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Spindown";
stateName[4] = "Fire";
stateSequence[4] = "Fire";
stateSequenceRandomFlash[4] = true;
stateSpinThread[4] = FullSpeed;
stateSound[4] = ChaingunFireSound;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateFire[4] = true;
stateEjectShell[4] = true;
stateTimeoutValue[4] = 0.15;
stateTransitionOnTimeout[4] = "Fire";
stateTransitionOnTriggerUp[4] = "Spindown";
stateTransitionOnNoAmmo[4] = "EmptySpindown";
stateName[5] = "Spindown";
stateSpinThread[5] = SpinDown;
stateTimeoutValue[5] = 0.1;
stateWaitForTimeout[5] = true;
stateTransitionOnTimeout[5] = "Ready";
stateTransitionOnTriggerDown[5] = "Spinup";
stateName[6] = "EmptySpindown";
stateSpinThread[6] = SpinDown;
stateTimeoutValue[6] = 0.5;
stateTransitionOnTimeout[6] = "NoAmmo";
stateName[7] = "DryFire";
stateSound[7] = ShrikeBlasterDryFireSound;
stateTimeoutValue[7] = 0.5;
stateTransitionOnTimeout[7] = "NoAmmo";
};
datablock TurretImageData(S17Param)
{
mountPoint = 2;
shapeFile = "turret_muzzlepoint.dts";
offset = "0.0 0.0 3.0";
Projectile = RPChaingunBullet;
ProjectileType = TracerProjectile;
// Turret parameters
activationMS = 1000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 500;
degPerSecPhi = 500;
attackRadius = 75;
};
function S17::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
%obj.schedule(5500, "playThread", $ActivateThread, "activate");
%turret = TurretData::create(S17Turret);
%turret.scale = "0.5 0.5 1";
MissionCleanup.add(%turret);
%turret.team = %obj.team;
%turret.selectedWeapon = 1;
%turret.setSelfPowered();
%obj.mountObject(%turret, 10);
%turret.mountImage(S17Param, 0);
%turret.mountImage(S17chaingunimage, 2);
%obj.turret = %turret;
%obj.turretObject = %turret;
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
%turret.vehicleMounted = %obj;
%turret.setAutoFire(false);
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
%sensor = new StaticShape()
{
scale = "1.3 1.3 0.1";
dataBlock = "S17switch";
};
MissionCleanup.add(%sensor);
%obj.mountObject(%sensor, 2);
%sensor.vehicleMounted = %obj;
%sensor.playThread($AmbientThread,"ambient");
schedule(5000, 0, "S17TurretAttackCheck",%obj);
}
function S17::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(10);
if (!%turret)
return;
%turret.schedule(2000, delete);
%body = %obj.getMountNodeObject(2);
if (isObject(%body))
%body.schedule(1000, delete);
$teamRepCredits[%obj.team] += getWord($commsatPurchase[2],1);
$teamUsedCredits[%obj.team] -= getWord($commsatPurchase[2],1);
}
function S17turret::onDamage(%data, %obj)
{
%newDamageVal = %obj.getDamageLevel();
if(%obj.lastDamageVal !$= "")
if(isObject(%obj.getObjectMount()) && %obj.lastDamageVal > %newDamageVal)
%obj.getObjectMount().setDamageLevel(%newDamageVal);
%obj.lastDamageVal = %newDamageVal;
}
function S17turret::damageObject(%this, %targetObject, %sourceObject, %position, %amount, %damageType ,%vec, %client, %projectile)
{
%vehicle = %targetObject.getObjectMount();
if(%vehicle)
%vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType, %vec, %client, %projectile);
}
function S17::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}
function S17TurretAttackCheck(%obj){
if(!isObject(%obj))
return;
%valid = 0;
%TargetSearchMask = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::TurretObjectType;
InitContainerRadiusSearch(%obj.getPosition(),400,%TargetSearchMask);
while ((%potentialTarget = ContainerSearchNext()) != 0) {
if (%potentialtarget && %valid != 1) {
%PTT = %potentialtarget.team;
if(%PTT $= "")
%PTT = %obj.team;
if(!(%PTT == %obj.team) && %PTT != 0){
%valid = 1;
%target = %potentialtarget;
}
}
}
if(%valid == 1){
if(!%obj.firing){
%obj.firing = 1;
%obj.turretobject.setTargetObject(%target);
%obj.turretobject.aquireTime = getSimTime();
%obj.turretobject.setImageTrigger(2,true);
}
}
else{
if(%obj.firing){
%obj.firing = 0;
%obj.turretobject.setImageTrigger(2,false);
%obj.turretObject.clearTarget();
}
}
schedule(250, 0, "S17TurretAttackCheck",%obj);
}

View file

@ -0,0 +1,744 @@
//**************************************************************
// AIR SUPERIORITY FIGHTER
//**************************************************************
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(SuperiorityFighter) : ShrikeDamageProfile
{
spawnOffset = "0 0 2";
canControl = false;
catagory = "Vehicles";
shapeFile = "vehicle_air_scout.dts";
multipassenger = false;
computeCRC = true;
debrisShapeName = "vehicle_air_scout.dts";
debris = MeShapeDebris;
renderWhenDestroyed = false;
drag = 0.15;
density = 1.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = false;
cameraMaxDist = 15;
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = MeVehicleExplosion;
explosionDamage = 1.0;
explosionRadius = 10.0;
maxDamage = 2.5;
destroyedLevel = 2.5;
HDAddMassLevel = 1.9;
HDMassImage = LflyerHDMassImage;
isShielded = false;
energyPerDamagePoint = 0;
maxEnergy = 2000; // Afterburner and any energy weapon pool
rechargeRate = 6;
minDrag = 22; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 66; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 400; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 1; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 0.8; // Dampen control input so you don't` whack out at very slow speeds
// Maneuvering
maxSteeringAngle = 4.5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 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 = 6250; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 750; // Steering jets (force applied when you move the mouse)
steeringRollForce = 3000; // Steering jets (how much you heel over when you turn)
rollForce = 1; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 2.5; // Height off the ground at rest
createHoverHeight = 1; // Height off the ground when created
maxForwardSpeed = 250; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 3250; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 18; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 0;
// Rigid body
mass = 150; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 14; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 20; // 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 = 150; // The speed your contrail shows up at.
trailEmitter = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = ScoutFlyerThrustSound;
engineSound = ScoutFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 15.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 1.0;
damageEmitter[0] = MeLightDamageSmoke;
damageEmitter[1] = MeHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "0.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.4;
damageLevelTolerance[1] = 0.75;
numDmgEmitterAreas = 1;
//
max[chaingunAmmo] = 750;
max[MissileLauncherAmmo] = 4;
max[MortarAmmo] = 3;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
targetNameTag = 'F54 Tornado';
targetTypeTag = 'Superiority Fighter';
sensorData = combatSensor;
sensorRadius = combatSensor.detectRadius;
sensorColor = "9 9 255";
checkRadius = 5.5;
observeParameters = "1 10 10";
runningLight[0] = ShrikeLight1;
// runningLight[1] = ShrikeLight2;
shieldEffectScale = "0.937 1.125 0.60";
numWeapons = 3;
replaceTime = 130;
max[plasmaammo] = 20;
flaretime = 200;
flarelife = 850;
flarechance = 0.5;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock TracerProjectileData(Superiority_bullet)
{
doDynamicClientHits = true;
directDamage = 0.25;
directDamageType = $DamageType::Bullet;
explosion = ChaingunExplosion;
splash = ChaingunSplash;
hasDamageRadius = true;
indirectDamage = 0.0225;
damageRadius = 0.5;
radiusDamageType = $DamageType::Bullet;
kickBackStrength = 5;
sound = ChaingunProjectile;
dryVelocity = 2250.0;
wetVelocity = 2000.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 6000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 40.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.20;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.5 0.5 0.175";
};
datablock SeekerProjectileData(LRAAM)
{
casingShapeName = "weapon_missile_casement.dts";
projectileShapeName = "weapon_missile_projectile.dts";
hasDamageRadius = true;
indirectDamage = 2.1;
damageRadius = 10.0;
radiusDamageType = $DamageType::MissileTurret;
kickBackStrength = 500;
flareDistance = 200;
flareAngle = 30;
minSeekHeat = 0.0;
explosion = "MissileExplosion";
velInheritFactor = 1.0;
splash = MissileSplash;
baseEmitter = MissileSmokeEmitter;
delayEmitter = MissileFireEmitter;
puffEmitter = MissilePuffEmitter;
lifetimeMS = 10000; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 25.0;
maxVelocity = 400.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 50.0;
acceleration = 150.0;
proximityRadius = 6;
terrainAvoidanceSpeed = 100;
terrainScanAhead = 50;
terrainHeightFail = 50;
terrainAvoidanceRadius = 150;
useFlechette = true;
flechetteDelayMs = 225;
casingDeb = FlechetteDebris;
};
//**************************************************************
// WEAPONS
//**************************************************************
datablock ShapeBaseImageData(SuperiorityChaingunImage)
{
className = WeaponImage;
shapeFile = "turret_missile_large.dts"; //was turret_tank_barrelchain.dts
item = Chaingun;
ammo = ChaingunAmmo;
projectile = Superiority_bullet;
projectileType = TracerProjectile;
mountPoint = 10;
offset = "0 2.1 -0.2"; // L/R - F/B - T/B was "0 3.25 0.75"
rotation = "0 1 0 180";
projectileSpread = 1.0 / 1000.0;
velpredict = 0;
usesEnergy = false;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.1;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateFire[3] = true;
stateScript[3] = "onFire";
stateSound[3] = ShrikeBlasterFire;
stateTimeoutValue[3] = 0.01;
stateTransitionOnTimeout[3] = "Reload";
stateAllowImageChange[3] = false;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.01;
stateAllowImageChange[4] = false;
stateSound[4] = MissileReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ShrikeBlasterDryFireSound;
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock ShapeBaseImageData(SuperiorityMissileImage)
{
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = MissileLauncher;
ammo = MissileLauncherAmmo;
projectile = sidewinder;
projectileType = SeekerProjectile;
mountPoint = 10;
offset = "0 -0 -0.15"; // L/R - F/B - T/B
usesEnergy = false;
useMountEnergy = true;
minEnergy = 100;
fireEnergy = 100;
fireTimeout = 125;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateSound[3] = MissileFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 1.0;
stateAllowImageChange[4] = false;
stateSound[4] = MissileReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ShrikeBlasterDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock ShapeBaseImageData(LRAAMImage)
{
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = Mortar;
ammo = MortarAmmo;
projectile = LRAAM;
projectileType = SeekerProjectile;
mountPoint = 10;
offset = "0 -0 -0.15"; // L/R - F/B - T/B
usesEnergy = false;
useMountEnergy = true;
minEnergy = 100;
fireEnergy = 100;
fireTimeout = 125;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateSound[3] = BomberBombFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.5;
stateAllowImageChange[4] = false;
stateSound[4] = MissileReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = BomberBombDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
function SuperiorityFighter::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
%obj.mountImage(ScoutChaingunParam, 0);
%obj.mountImage(SuperiorityChaingunImage, 2);
%obj.mountImage(superiorityMissileImage, 4);
%obj.mountImage(LRAAMImage, 5);
%obj.selectedWeapon = 1;
%obj.nextWeaponFire = 2;
%obj.setInventory(MissileLauncherAmmo, 4);
%obj.setInventory(MortarAmmo, 3);
%obj.setInventory(chaingunammo, 750);
%obj.setInventory(plasmaAmmo,25);
%obj.schedule(5500, "playThread", $ActivateThread, "activate");
schedule(2500, 0, "supersonicloop", %obj);
}
function SuperiorityFighter::playerMounted(%data, %obj, %player, %node)
{
%ammoAmt = %player.inv[MissileLauncherAmmo];
if(%ammoAmt)
%obj.incInventory(MissileLauncherAmmo, %ammoAmt);
%ammoAmt = %player.inv[MortarAmmo];
if(%ammoAmt)
%obj.incInventory(MortarAmmo, %ammoAmt);
%ammoAmt = %player.inv[chaingunAmmo];
if(%ammoAmt)
%obj.incInventory(chaingunAmmo, %ammoAmt);
bottomPrint(%player.client, "Tornado: wep1 CG, wep2 sidewinders, wep3 LRAAMS", 5, 2 );
commandToClient(%player.client, 'setHudMode', 'Pilot', "Shrike2", %node);
%obj.selectedWeapon = 1;
$numVWeapons = 3;
commandToClient(%player.client, 'SetWeaponryVehicleKeys', true);
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
}
function SuperiorityFighter::onTrigger(%data, %obj, %trigger, %state)
{
%player = %obj.getMountNodeObject(0);
if(%trigger == 0)
{
switch (%state)
{
case 0:
%obj.fireWeapon = false;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(4, false);
%obj.setImageTrigger(5, false);
case 1:
%obj.fireWeapon = true;
if(%obj.selectedWeapon == 1){
%obj.setImageTrigger(2, true);
%obj.setImageTrigger(4, false);
%obj.setImageTrigger(5, false);
}
else if(%obj.selectedWeapon == 2) {
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(4, true);
%obj.setImageTrigger(5, false);
}
else {
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(4, false);
%obj.setImageTrigger(5, true);
}
}
}
else if (%trigger ==4){
switch (%state)
{
case 0:
%obj.flaring = 0;
case 1:
%obj.flaring = 1;
schedule(%data.flaretime, 0, "fighterdropflares",%obj,%data.flaretime,%data.flarelife,%data.flarechance);
}
}
}
function SuperiorityChaingunImage::onFire(%data,%obj,%slot){
%data.lightStart = getSimTime();
%vec = %obj.getMuzzleVector(%slot);
if(%data.velpredict == 1){
%target = %obj.getLockedTarget();
if(%target){
%Tpos = %target.getWorldBoxCenter();
%Opos = %obj.getMuzzlepoint(%slot);
%dist = vectorDist(%Tpos,%Opos);
%pos = vectorAdd(%Tpos, vectorScale(%target.getVelocity(),(%dist / 1750) ));
%dist = vectorDist(%pos,%Opos);
%pos = vectorAdd(%Tpos, vectorScale(%target.getVelocity(),(%dist / 1750) ));
%Tvec = vectorNormalize(vectorSub(%pos,%Opos));
%Fvec = %obj.getMuzzleVector(%slot);
if(vectorDist(%Tvec,%Fvec) <= 0.1)
%vec = vectorNormalize(vectorSub(%Tpos,%obj.getMuzzlePoint(%slot)));
}
}
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%vector = MatrixMulVector(%mat, %vec);
%initialPos = %obj.getMuzzlePoint(%slot);
%p = new (%data.projectileType)() {
dataBlock = %data.projectile;
initialDirection = %vector;
initialPosition = %initialPos;
sourceObject = %obj;
sourceSlot = %slot;
vehicleObject = %vehicle;
};
MissionCleanup.add(%p);
if(%obj.client)
%obj.client.projectile = %p;
%obj.decInventory(%data.ammo,1);
return %p;
}
function superiorityMissileImage::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
MissileSet.add(%p);
if (%obj.getControllingClient())
%target = %obj.getLockedTarget();
else
%target = %obj.getTargetObject();
%homein = missileCheckAirTarget(%target);
if(%target && %homein)
%p.setObjectTarget(%target);
else if(%obj.isLocked())
%p.setPositionTarget(%obj.getLockedPosition());
else
%p.setNoTarget();
}
function LRAAMImage::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
MissileSet.add(%p);
if (%obj.getControllingClient())
%target = %obj.getLockedTarget();
else
%target = %obj.getTargetObject();
if(isobject(%target))
%homein = missileCheckAirTarget(%target);
if(%target && %homein)
%p.setObjectTarget(%target);
else if(%obj.isLocked())
%p.setPositionTarget(%obj.getLockedPosition());
else {
%p.dir = %obj.getForwardVector();
schedule(500, 0, "LRAAMFindTarget", %p);
}
}
function LRAAMFindTarget(%p){
if(!isObject(%p))
return;
%vec = vectorScale(vectorNormalize(%p.dir),600);
%pos = %p.getPosition();
%tpos = vectorAdd(%vec,%pos);
InitContainerRadiusSearch(%tpos, 500, $TypeMasks::VehicleObjectType);
while ((%searchResult = containerSearchNext()) != 0){
echo(%searchresult);
if(%searchResult.getClassName() $= "Flyingvehicle"){
%p.setObjectTarget(%searchResult);
return;
}
}
schedule(250, 0, "LRAAMFindTarget",%p);
}
function superiorityfighter::onDestroyed(%data, %obj, %prevState)
{
if(%obj.lastPilot.lastVehicle == %obj)
if(%obj.getMountNodeObject(0) == %obj.lastPilot)
schedule(200, %obj.lastPilot, "scKillPilot", %obj.lastPilot, %obj.lastDamagedBy);
Parent::onDestroyed(%data, %obj, %prevState);
}
function supersonicloop(%obj){
if(!isObject(%obj))
return;
%vec = %obj.getVelocity();
%vel = vectorlen(%vec);
if(%vel > 200){
%vec = vectorNormalize(%vec);
%vec = vectorScale(%vec,-75);
%pn = new (TracerProjectile)() {
dataBlock = SuperSonicDet;
initialDirection = "0 0 1";
initialPosition = vectoradd(%obj.getPosition(),%vec);
sourceObject = %obj;
sourceSlot = 1;
};
}
schedule(350, 0, "supersonicloop", %obj);
}
datablock TracerProjectileData(SuperSonicDet)
{
doDynamicClientHits = true;
directDamage = 0.0;
directDamageType = $DamageType::BomberBombs;
explosion = "";
splash = ChaingunSplash;
hasDamageRadius = true;
indirectDamage = 0.1;
damageRadius = 50.0;
radiusDamageType = $DamageType::default;
kickBackStrength = 5000;
sound = ChaingunProjectile;
dryVelocity = 1.0;
wetVelocity = 1.0;
velInheritFactor = 1.0;
fizzleTimeMS = 32;
lifetimeMS = 33;
explodeOnDeath = true;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 1;
tracerLength = 1.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.35;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.5 0.5 0.175";
};
function superiorityfighter::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,990 @@
//**************************************************************
// THUNDERSWORD BOMBER
//**************************************************************
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(BomberFlyerEngineEffect)
{
effectname = "vehicles/bomber_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberFlyerThrustEffect)
{
effectname = "vehicles/bomber_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretFireEffect)
{
effectname = "weapons/missile_fire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretActivateEffect)
{
effectname = "vehicles/bomber_turret_activate";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretReloadEffect)
{
effectname = "vehicles/bomber_turret_reload";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretDryFireEffect)
{
effectname = "weapons/missile_launcher_dryfire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberBombReloadEffect)
{
effectname = "vehicles/bomber_bomb_reload";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberBombDryFireEffect)
{
effectname = "vehicles/bomber_bomb_dryfire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberBombFireEffect)
{
effectname = "weapons/generic_throw";
minDistance = 10.0;
maxDistance = 20.0;
};
datablock AudioProfile(BomberFlyerEngineSound)
{
filename = "fx/vehicles/bomber_engine.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = BomberFlyerEngineEffect;
};
datablock AudioProfile(BomberFlyerThrustSound)
{
filename = "fx/vehicles/bomber_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = BomberFlyerThrustEffect;
};
datablock AudioProfile(FusionExpSound)
// Sound played when mortar impacts on target
{
filename = "fx/powered/turret_mortar_explode.wav";
description = "AudioBIGExplosion3d";
preload = true;
};
datablock AudioProfile(BomberTurretFireSound)
{
filename = "fx/weapons/missile_fire.WAV";
description = AudioClose3d;
preload = true;
effect = BomberTurretFireEffect;
};
datablock AudioProfile(BomberTurretActivateSound)
{
filename = "fx/vehicles/bomber_turret_activate.wav";
description = AudioClose3d;
preload = true;
effect = BomberTurretActivateEffect;
};
datablock AudioProfile(BomberTurretReloadSound)
{
filename = "fx/weapons/weapon.missilereload.wav";
description = AudioClose3d;
preload = true;
effect = BomberTurretReloadEffect;
};
datablock AudioProfile(BomberTurretIdleSound)
{
filename = "fx/misc/diagnostic_on.wav";
description = ClosestLooping3d;
preload = true;
};
datablock AudioProfile(BomberTurretDryFireSound)
{
filename = "fx/weapons/missile_launcher_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = BomberTurretDryFireEffect;
};
datablock AudioProfile(BomberBombReloadSound)
{
filename = "fx/vehicles/bomber_bomb_reload.wav";
description = AudioClose3d;
preload = true;
effect = BomberBombReloadEffect;
};
datablock AudioProfile(BomberBombProjectileSound)
{
filename = "fx/vehicles/bomber_bomb_projectile.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = BomberBombFireEffect;
};
datablock AudioProfile(BomberBombDryFireSound)
{
filename = "fx/vehicles/bomber_bomb_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = BomberBombDryFireEffect;
};
datablock AudioProfile(BomberBombFireSound)
{
filename = "fx/vehicles/bomber_bomb_reload.wav";
description = AudioClose3d;
preload = true;
effect = BomberBombFireEffect;
};
datablock AudioProfile(BomberBombIdleSound)
{
filename = "fx/misc/diagnostic_on.wav";
description = ClosestLooping3d;
preload = true;
};
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(BomberFlyer) : BomberDamageProfile
{
spawnOffset = "0 0 2";
canControl = false;
catagory = "Vehicles";
shapeFile = "vehicle_air_bomber.dts";
multipassenger = true;
computeCRC = true;
weaponNode = 1;
debrisShapeName = "vehicle_air_bomber.dts";
debris = MeShapeDebris;
renderWhenDestroyed = false;
drag = 0.2;
density = 1.0;
mountPose[0] = sitting;
mountPose[1] = sitting;
numMountPoints = 3;
isProtectedMountPoint[0] = true;
isProtectedMountPoint[1] = true;
isProtectedMountPoint[2] = false;
cameraDefaultFov = 90.0;
cameraMinFov = 5.0;
cameraMaxFov = 120.0;
cameraMaxDist = 22;
cameraOffset = 5;
cameraLag = 1.0;
explosion = MFVehicleExplosion;
explosionDamage = 1.5;
explosionRadius = 20.0;
maxDamage = 5.0; // Total health
destroyedLevel = 5.0; // Damage textures show up at this health level
HDAddMassLevel = 3.5;
HDMassImage = HFlyerHDMassImage;
isShielded = false;
energyPerDamagePoint = 150;
maxEnergy = 400; // Afterburner and any energy weapon pool
minDrag = 60; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 1800; // Angular Drag (dampens the drift after you stop moving the mouse...also tumble drag)
rechargeRate = 0.8;
// Auto stabilize speed
maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 1500; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 300; // 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
// Maneuvering
maxSteeringAngle = 8; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 5; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 8; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 5000; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 800; // Steering jets (force applied when you move the mouse)
steeringRollForce = 2500; // Steering jets (how much you heel over when you turn)
rollForce = 1; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 4; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
maxForwardSpeed = 110; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 5000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40.0; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 2.5; // Energy use of the afterburners (low number is less drain...can be fractional)
vertThrustMultiple = 3.0;
dustEmitter = LargeVehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 2.0;
damageEmitter[0] = MFLightDamageSmoke;
damageEmitter[1] = MFHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "3.0 -3.0 0.0 ";
damageEmitterOffset[1] = "-3.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 2;
// Rigid body
mass = 350; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 20; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 20; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.060;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 25;
collDamageMultiplier = 0.020;
//
minTrailSpeed = 15; // The speed your contrail shows up at.
trailEmitter = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = BomberFlyerThrustSound;
engineSound = BomberFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 15.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterHardSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterHardSound;
waterWakeSound = VehicleWakeHardSplashSound;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingBomberIcon;
cmdMiniIconName = "commander/MiniIcons/com_bomber_grey";
targetNameTag = 'B-34';
targetTypeTag = 'Bomber';
sensorData = combatSensor;
sensorRadius = combatSensor.detectRadius;
sensorColor = "9 9 255";
checkRadius = 7.1895;
observeParameters = "1 10 10";
shieldEffectScale = "0.75 0.975 0.375";
showPilotInfo = 1;
replaceTime = 75;
};
//**************************************************************
// WEAPONS
//**************************************************************
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock SeekerProjectileData(sidewinder_MarkII)
{
casingShapeName = "weapon_missile_casement.dts";
projectileShapeName = "weapon_missile_projectile.dts";
hasDamageRadius = true;
indirectDamage = 0.75;
damageRadius = 10.0;
radiusDamageType = $DamageType::Missile;
kickBackStrength = 500;
explosion = "MissileExplosion";
splash = MissileSplash;
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
// is cranked up to full so the missile doesn't start
// out behind the player when the player is moving
// very quickly - bramage
baseEmitter = MissileSmokeEmitter;
delayEmitter = MissileFireEmitter;
puffEmitter = MissilePuffEmitter;
bubbleEmitter = GrenadeBubbleEmitter;
bubbleEmitTime = 1.0;
exhaustEmitter = MissileLauncherExhaustEmitter;
exhaustTimeMs = 300;
exhaustNodeName = "muzzlePoint1";
lifetimeMS = 15000; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 75.0;
maxVelocity = 210.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 64.0;
acceleration = 100.0;
proximityRadius = 3;
terrainAvoidanceSpeed = 180;
terrainScanAhead = 25;
terrainHeightFail = 12;
terrainAvoidanceRadius = 100;
flareDistance = 200;
flareAngle = 30;
minSeekHeat = 0.0;
sound = MissileProjectileSound;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.2 0.05 0";
useFlechette = true;
flechetteDelayMs = 100;
casingDeb = FlechetteDebris;
explodeOnWaterImpact = false;
};
//-------------------------------------
// BOMBER BELLY TURRET CHARACTERISTICS
//-------------------------------------
datablock TurretData(BomberTurret) : TurretDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "turret_belly_base.dts";
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingBomberIcon;
cmdMiniIconName = "commander/MiniIcons/com_bomber_grey";
targetNameTag = 'Thundersword';
targetTypeTag = 'Bomberturret';
mass = 1.0; // Not really relevant
repairRate = 0;
maxDamage = BomberFlyer.maxDamage;
destroyedLevel = BomberFlyer.destroyedLevel;
thetaMin = 90;
thetaMax = 180;
// capacitor
maxCapacitorEnergy = 1000;
capacitorRechargeRate = 1.2;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
numWeapons = 3;
targetNameTag = 'Thundersword Belly';
targetTypeTag = 'Turret';
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 45;
seekTime = $Bomber::SeekTime;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = $Bomber::minTargetingDistance;
useTargetAudio = $Bomber::useTargetAudio;
};
datablock TurretImageData(BomberTurretBarrel)
{
shapeFile = "stackable1s.dts";
rotation = "0 0 1 90";
offset = "0.4 -0.4 -0.4";
mountPoint = 0;
projectile = sidewinder_MarkII;
projectileType = SeekerProjectile;
usesEnergy = true;
useCapacitor = true;
useMountEnergy = true;
fireEnergy = 60.0;
minEnergy = 60.0;
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 45;
seekTime = $Bomber::SeekTime;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = $Bomber::minTargetingDistance;
useTargetAudio = $Bomber::useTargetAudio;
// Turret parameters
activationMS = 1000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 360;
degPerSecPhi = 360;
attackRadius = 300;
// State transitions
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "WaitFire1";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = BomberTurretActivateSound;
stateName[1] = "WaitFire1";
stateTransitionOnTriggerDown[1] = "Fire1";
stateTransitionOnNoAmmo[1] = "NoAmmo1";
stateName[2] = "Fire1";
stateTransitionOnTimeout[2] = "Reload1";
stateTimeoutValue[2] = 2.0;
stateFire[2] = true;
stateRecoil[2] = LightRecoil;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateSound[2] = BomberTurretFireSound;
stateName[3] = "Reload1";
stateSequence[3] = "Reload";
stateTimeoutValue[3] = 0.75;
stateAllowImageChange[3] = false;
stateTransitionOnTimeout[3] = "WaitFire2";
stateTransitionOnNoAmmo[3] = "NoAmmo1";
stateName[4] = "NoAmmo1";
stateTransitionOnAmmo[4] = "Reload1";
// ---------------------------------------------
// z0dd - ZOD, 5/8/02. Incorrect parameter value
//stateSequence[4] = "NoAmmo";
stateSequence[4] = "NoAmmo1";
stateTransitionOnTriggerDown[4] = "DryFire1";
stateName[5] = "DryFire1";
stateSound[5] = BomberTurretDryFireSound;
stateTimeoutValue[5] = 0.75;
stateTransitionOnTimeout[5] = "NoAmmo1";
stateName[6] = "WaitFire2";
stateTransitionOnTriggerDown[6] = "Fire2";
// ---------------------------------------------
// z0dd - ZOD, 5/8/02. Incorrect parameter value
//stateTransitionOnNoAmmo[6] = "NoAmmo";
stateTransitionOnNoAmmo[6] = "NoAmmo2";
stateName[7] = "Fire2";
stateTransitionOnTimeout[7] = "Reload2";
stateTimeoutValue[7] = 0.75;
stateScript[7] = "FirePair";
stateName[8] = "Reload2";
stateSequence[8] = "Reload";
stateTimeoutValue[8] = 0.75;
stateAllowImageChange[8] = false;
stateTransitionOnTimeout[8] = "WaitFire1";
stateTransitionOnNoAmmo[8] = "NoAmmo2";
stateName[9] = "NoAmmo2";
stateTransitionOnAmmo[9] = "Reload2";
// ---------------------------------------------
// z0dd - ZOD, 5/8/02. Incorrect parameter value
//stateSequence[9] = "NoAmmo";
stateSequence[9] = "NoAmmo2";
stateTransitionOnTriggerDown[9] = "DryFire2";
stateName[10] = "DryFire2";
stateSound[10] = BomberTurretDryFireSound;
stateTimeoutValue[10] = 0.75;
stateTransitionOnTimeout[10] = "NoAmmo2";
};
datablock TurretImageData(BomberTurretBarrelPair)
{
shapeFile = "stackable1s.dts";
rotation = "0 0 1 90";
offset = "-0.4 -0.4 -0.4";
mountPoint = 1;
projectile = sidewinder_MarkII;
projectileType = SeekerProjectile;
usesEnergy = true;
useCapacitor = true;
useMountEnergy = true;
fireEnergy = 60.0;
minEnergy = 60.0;
// Turret parameters
activationMS = 1000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 360;
degPerSecPhi = 360;
attackRadius = 300;
stateName[0] = "WaitFire";
stateTransitionOnTriggerDown[0] = "Fire";
stateName[1] = "Fire";
stateTransitionOnTimeout[1] = "StopFire";
stateTimeoutValue[1] = 0.13;
stateFire[1] = true;
stateRecoil[1] = LightRecoil;
stateAllowImageChange[1] = false;
stateSequence[1] = "Fire";
stateScript[1] = "onFire";
stateSound[1] = BomberTurretFireSound;
stateName[2] = "StopFire";
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "WaitFire";
stateScript[2] = "stopFire";
};
datablock TurretImageData(AIAimingTurretBarrel)
{
shapeFile = "turret_muzzlepoint.dts";
mountPoint = 3;
projectile = sidewinder_MarkII;
// Turret parameters
activationMS = 1000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 500;
degPerSecPhi = 800;
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 45;
seekTime = $Bomber::SeekTime;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = $Bomber::minTargetingDistance;
useTargetAudio = $Bomber::useTargetAudio;
attackRadius = 300;
};
datablock ShapeBaseImageData(BomberBellyTurretParam)
{
mountPoint = 2;
shapeFile = "turret_muzzlepoint.dts";
Projectile = sidewinder_MarkII;
ProjectileType = SeekerProjectile;
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 45;
seekTime = $Bomber::SeekTime;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = $Bomber::minTargetingDistance;
useTargetAudio = $Bomber::useTargetAudio;
};
//-------------------------------------
// BOMBER BOMB PROJECTILE
//-------------------------------------
datablock BombProjectileData(BomberBomb)
{
projectileShapeName = "bomb.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 4.0;
damageRadius = 30;
radiusDamageType = $DamageType::BomberBombs;
kickBackStrength = 2500;
explosion = "VehicleBombExplosion";
velInheritFactor = 1.0;
grenadeElasticity = 0.25;
grenadeFriction = 0.4;
armingDelayMS = 2000;
muzzleVelocity = 0.1;
drag = 0.3;
minRotSpeed = "60.0 0.0 0.0";
maxRotSpeed = "80.0 0.0 0.0";
scale = "1.0 1.0 1.0";
sound = BomberBombProjectileSound;
};
//-------------------------------------
// BOMBER BOMB CHARACTERISTICS
//-------------------------------------
datablock ItemData(BombAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "repair_kit.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 1;
computeCRC = true;
};
datablock StaticShapeData(DropBombs)
{
catagory = "Turrets";
shapeFile = "bombers_eye.dts";
maxDamage = 1.0;
disabledLevel = 0.6;
destroyedLevel = 0.8;
};
datablock TurretImageData(BomberBombImage)
{
shapeFile = "turret_muzzlepoint.dts";
offset = "2 -4 -0.5";
mountPoint = 10;
projectile = BomberBomb;
projectileType = BombProjectile;
usesEnergy = true;
useMountEnergy = true;
useCapacitor = true;
fireEnergy = 110.0;
minEnergy = 110.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "WaitFire1";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "WaitFire1";
stateTransitionOnTriggerDown[1] = "Fire1";
stateTransitionOnNoAmmo[1] = "NoAmmo1";
stateName[2] = "Fire1";
stateTransitionOnTimeout[2] = "Reload1";
stateTimeoutValue[2] = 0.32;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateSound[2] = BomberBombFireSound;
stateName[3] = "Reload1";
stateSequence[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateAllowImageChange[3] = false;
stateTransitionOnTimeout[3] = "WaitFire2";
stateTransitionOnNoAmmo[3] = "NoAmmo1";
stateName[4] = "NoAmmo1";
stateTransitionOnAmmo[4] = "Reload1";
// ---------------------------------------------
// z0dd - ZOD, 5/8/02. Incorrect parameter value
//stateSequence[4] = "NoAmmo";
stateSequence[4] = "NoAmmo1";
stateTransitionOnTriggerDown[4] = "DryFire1";
stateName[5] = "DryFire1";
stateSound[5] = BomberBombDryFireSound;
stateTimeoutValue[5] = 0.5;
stateTransitionOnTimeout[5] = "NoAmmo1";
stateName[6] = "WaitFire2";
stateTransitionOnTriggerDown[6] = "Fire2";
// ---------------------------------------------
// z0dd - ZOD, 5/8/02. Incorrect parameter value
//stateTransitionOnNoAmmo[6] = "NoAmmo";
stateTransitionOnNoAmmo[6] = "NoAmmo2";
stateName[7] = "Fire2";
stateTransitionOnTimeout[7] = "Reload2";
stateTimeoutValue[7] = 0.32;
stateScript[7] = "FirePair";
stateName[8] = "Reload2";
stateSequence[8] = "Reload";
stateTimeoutValue[8] = 0.1;
stateAllowImageChange[8] = false;
stateTransitionOnTimeout[8] = "WaitFire1";
stateTransitionOnNoAmmo[8] = "NoAmmo2";
stateName[9] = "NoAmmo2";
stateTransitionOnAmmo[9] = "Reload2";
// ---------------------------------------------
// z0dd - ZOD, 5/8/02. Incorrect parameter value
//stateSequence[9] = "NoAmmo";
stateSequence[9] = "NoAmmo2";
stateTransitionOnTriggerDown[9] = "DryFire2";
stateName[10] = "DryFire2";
stateSound[10] = BomberBombDryFireSound;
stateTimeoutValue[10] = 0.5;
stateTransitionOnTimeout[10] = "NoAmmo2";
};
datablock TurretImageData(BomberBombPairImage)
{
shapeFile = "turret_muzzlepoint.dts";
offset = "-2 -4 -0.5";
mountPoint = 10;
projectile = BomberBomb;
projectileType = BombProjectile;
usesEnergy = true;
useMountEnergy = true;
useCapacitor = true;
fireEnergy = 110.0;
minEnergy = 110.0;
stateName[0] = "WaitFire";
stateTransitionOnTriggerDown[0] = "Fire";
stateName[1] = "Fire";
stateTransitionOnTimeout[1] = "StopFire";
stateTimeoutValue[1] = 0.13;
stateFire[1] = true;
stateAllowImageChange[1] = false;
stateSequence[1] = "Fire";
stateScript[1] = "onFire";
stateSound[1] = BomberBombFireSound;
stateName[2] = "StopFire";
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "WaitFire";
stateScript[2] = "stopFire";
};
//**************************************************************
// WEAPONS SPECIAL EFFECTS
//**************************************************************
datablock TracerProjectileData(BomberCGBullet)
{
doDynamicClientHits = true;
directDamage = 0.0;
directDamageType = $DamageType::ACCG;
explosion = MissileExplosion;
splash = ChaingunSplash;
hasDamageRadius = true;
indirectDamage = 0.75;
damageRadius = 5.0;
radiusDamageType = $DamageType::ACCG;
kickBackStrength = 5;
sound = ChaingunProjectile;
dryVelocity = 2500.0;
wetVelocity = 1000.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 6000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 40.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.25;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = MG42Decal1;
decalData[1] = MG42Decal2;
decalData[2] = MG42Decal3;
decalData[3] = MG42Decal4;
decalData[4] = MG42Decal5;
decalData[5] = MG42Decal6;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.5 0.5 0.175";
};
datablock TurretImageData(BomberCGImage)
{
className = WeaponImage;
shapeFile = "turret_belly_barrell.dts";
offset = "0.1 0 0";
item = Chaingun;
projectile = BomberCGBullet;
projectileType = TracerProjectile;
projectileSpread = 2.0 / 1000.0;
emap = true;
casing = ShellDebris;
shellExitDir = "1.0 0.3 1.0";
shellExitOffset = "0.15 -0.56 -0.1";
shellExitVariance = 5.0;
shellVelocity = 0.0;
mountPoint = 1;
usesEnergy = true;
useMountEnergy = true;
useCapacitor = true;
minEnergy = 5;
fireEnergy = 5.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateSound[3] = SniperFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.4;
stateAllowImageChange[4] = false;
stateSound[4] = ChaingunDryFireSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = MissileReloadSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
function BomberTurretBarrelPair::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
MissileSet.add(%p);
%target = %obj.getLockedTarget();
%homein = missileCheckAirTarget(%target);
if(%target && %homein)
%p.setObjectTarget(%target);
else if(%obj.isLocked())
%p.setPositionTarget(%obj.getLockedPosition());
else
%p.setNoTarget();
}
function BomberTurretBarrel::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
MissileSet.add(%p);
%target = %obj.getLockedTarget();
%homein = missileCheckAirTarget(%target);
if(%target && %homein)
%p.setObjectTarget(%target);
else if(%obj.isLocked())
%p.setPositionTarget(%obj.getLockedPosition());
else
%p.setNoTarget();
}
function Bomberflyer::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}

View file

@ -0,0 +1,673 @@
$Bomber::SeekRadius = 500;
$Bomber::SeekTime = 0.25;
$Bomber::minSeekHeat = 0.6;
$Bomber::minTargetingDistance = 15;
$Bomber::useTargetAudio = true;
//**************************************************************
// Shrikes/Apaches/Scouts
//**************************************************************
datablock ParticleData(VehicleBoomSmoke)
{
dragCoeffiecient = 0.2;
gravityCoefficient = -0.25; // rises slowly
inheritedVelFactor = 0.025;
lifetimeMS = 4000;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
textureName = "special/Smoke/smoke_001";
colors[0] = "1.0 0.7 0.5 1.0";
colors[1] = "0.2 0.2 0.2 1.0";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 3.0;
sizes[1] = 8.0;
sizes[2] = 3.0;
times[0] = 0.0;
times[1] = 0.3;
times[2] = 1.0;
};
datablock ParticleEmitterData(VehicleBoomSmokeEmitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 10.0;
velocityVariance = 0.25;
thetaMin = 0.0;
thetaMax = 180.0;
lifetimeMS = 150;
particles = "VehicleBoomSmoke";
};
datablock ParticleData(MeDebrisFireParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = -0.2;
inheritedVelFactor = 0.0;
lifetimeMS = 350;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = false;
spinRandomMin = -160.0;
spinRandomMax = 160.0;
animateTexture = true;
framesPerSec = 15;
animTexName[0] = "special/Explosion/exp_0016";
animTexName[1] = "special/Explosion/exp_0018";
animTexName[2] = "special/Explosion/exp_0020";
animTexName[3] = "special/Explosion/exp_0022";
animTexName[4] = "special/Explosion/exp_0024";
animTexName[5] = "special/Explosion/exp_0026";
animTexName[6] = "special/Explosion/exp_0028";
animTexName[7] = "special/Explosion/exp_0030";
animTexName[8] = "special/Explosion/exp_0032";
colors[0] = "1.0 0.7 0.5 1.0";
colors[1] = "1.0 0.5 0.2 1.0";
colors[2] = "1.0 0.25 0.1 0.0";
sizes[0] = 0.5;
sizes[1] = 1.5;
sizes[2] = 0.7;
times[0] = 0.0;
times[1] = 0.2;
times[2] = 1.0;
};
datablock ParticleEmitterData(MeDebrisFireEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 1;
ejectionVelocity = 0.25;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 175.0;
particles = "MeDebrisFireParticle";
};
datablock ParticleData( MeDebrisSmokeParticle )
{
dragCoeffiecient = 4.0;
gravityCoefficient = -0.00; // rises slowly
inheritedVelFactor = 0.2;
lifetimeMS = 2500;
lifetimeVarianceMS = 100; // ...more or less
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -50.0;
spinRandomMax = 50.0;
colors[0] = "0.3 0.3 0.3 0.0";
colors[1] = "0.2 0.2 0.2 1.0";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 2;
sizes[1] = 3.0;
sizes[2] = 4.5;
times[0] = 0.0;
times[1] = 0.7;
times[2] = 1.0;
};
datablock ParticleEmitterData( MeDebrisSmokeEmitter )
{
ejectionPeriodMS = 15;
periodVarianceMS = 2;
ejectionVelocity = 1.0; // A little oomph at the back end
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 15.0;
useEmitterSizes = true;
particles = "MeDebrisSmokeParticle";
};
datablock DebrisData( MeVehicleFireballDebris )
{
emitters[0] = MeDebrisSmokeEmitter;
emitters[1] = MeDebrisFireEmitter;
explosion = DebrisExplosion;
explodeOnMaxBounce = true;
elasticity = 0.4;
friction = 0.2;
lifetime = 100.0;
lifetimeVariance = 30.0;
numBounces = 0;
bounceVariance = 0;
};
datablock DebrisData( MeVSpikeDebris )
{
emitters[0] = VSmokeSpikeEmitter;
explodeOnMaxBounce = true;
elasticity = 0.4;
friction = 0.2;
lifetime = 0.3;
lifetimeVariance = 0.02;
};
datablock ExplosionData(MeVSpikeExplosion)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
delayMS = 0;
offset = 0.0;
playSpeed = 0.75;
sizes[0] = "5.0 5.0 5.0";
sizes[1] = "5.0 5.0 5.0";
times[0] = 0.0;
times[1] = 1.0;
debris = MeVSpikeDebris;
debrisThetaMin = 10;
debrisThetaMax = 175;
debrisNum = 5;
debrisNumVariance = 3;
debrisVelocity = 30.0;
debrisVelocityVariance = 7.0;
};
datablock ExplosionData(MeVehicleExplosion)
{
explosionShape = "disc_explosion.dts";
playSpeed = 1.5;
soundProfile = VehicleExplosionSound;
faceViewer = true;
emitter[0] = VehicleBoomSmokeEmitter;
debris = MeVehicleFireballDebris;
debrisThetaMin = 60;
debrisThetaMax = 90;
debrisNum = 20;
debrisNumVariance = 5;
debrisVelocity = 25.0;
debrisVelocityVariance = 2.0;
subExplosion = MeVSpikeExplosion;
shakeCamera = true;
camShakeFreq = "11.0 13.0 9.0";
camShakeAmp = "40.0 40.0 40.0";
camShakeDuration = 0.7;
camShakeRadius = 25.0;
};
datablock ParticleData(MeHeavyDamageSmokeParticle)
{
dragCoefficient = 0.4;
gravityCoefficient = -0.01;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 5000;
lifetimeVarianceMS = 200;
useInvAlpha = true;
spinRandomMin = -60.0;
spinRandomMax = 60.0;
textureName = "particleTest";
colors[0] = "1.0 0.4 0.2 1.0";
colors[1] = "1.0 0.8 0.2 0.8";
colors[2] = "0.1 0.1 0.1 0.3";
colors[3] = "0.2 0.2 0.2 0.15";
colors[4] = "0.3 0.3 0.3 0.0";
sizes[0] = 2.0;
sizes[1] = 3.0;
sizes[2] = 4.5;
sizes[3] = 5.0;
sizes[4] = 8.0;
times[0] = 0.0;
times[1] = 0.05;
times[2] = 0.15;
times[3] = 0.4;
times[4] = 1.0;
};
datablock ParticleEmitterData(MeHeavyDamageSmoke)
{
ejectionPeriodMS = 3;
periodVarianceMS = 2;
ejectionVelocity = 3.0;
velocityVariance = 0.5;
ejectionOffset = 1.5;
thetaMin = 0;
thetaMax = 180;
overrideAdvances = false;
particles = "MeHeavyDamageSmokeParticle";
};
datablock ParticleData(MeLightDamageSmokeParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.01;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 4000;
lifetimeVarianceMS = 200;
useInvAlpha = true;
spinRandomMin = -45.0;
spinRandomMax = 45.0;
textureName = "particleTest";
colors[0] = "0.1 0.1 0.1 0.5";
colors[1] = "0.2 0.2 0.2 0.7";
colors[2] = "0.3 0.3 0.3 0.0";
sizes[0] = 1.5;
sizes[1] = 3.0;
sizes[2] = 4.0;
times[0] = 0.0;
times[1] = 0.3;
times[2] = 1.0;
};
datablock ParticleEmitterData(MeLightDamageSmoke)
{
ejectionPeriodMS = 15;
periodVarianceMS = 6;
ejectionVelocity = 4.0;
velocityVariance = 0.5;
ejectionOffset = 1.5;
thetaMin = 0;
thetaMax = 180;
overrideAdvances = false;
particles = "MeLightDamageSmokeParticle";
};
datablock ParticleData(MeDamageBubbleParticle)
{
dragCoefficient = 0.0;
gravityCoefficient = -0.04;
inheritedVelFactor = 0.5;
constantAcceleration = 0.0;
lifetimeMS = 2000;
lifetimeVarianceMS = 200;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 90.0;
textureName = "special/bubbles";
colors[0] = "0.7 0.7 0.7 0.0";
colors[1] = "0.3 0.3 0.3 1.0";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 0.4;
sizes[1] = 1.6;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(MeDamageBubbles)
{
ejectionPeriodMS = 15;
periodVarianceMS = 0;
ejectionVelocity = 3.0;
velocityVariance = 0.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 35;
overrideAdvances = false;
particles = "MeDamageBubbleParticle";
};
datablock DebrisData( MeShapeDebris )
{
explodeOnMaxBounce = false;
elasticity = 0.1;
friction = 0.5;
lifetime = 25.0;
lifetimeVariance = 0.0;
minSpinSpeed = 0;
maxSpinSpeed = 25;
numBounces = 10;
bounceVariance = 0;
staticOnMaxBounce = true;
useRadiusMass = true;
baseRadius = 1.0;
velocity = 17.0;
velocityVariance = 7.0;
};
datablock DebrisData( GShapeDebris )
{
explodeOnMaxBounce = false;
elasticity = 0.0;
friction = 0.5;
lifetime = 25.0;
lifetimeVariance = 0.0;
minSpinSpeed = 0;
maxSpinSpeed = 5;
numBounces = 10;
bounceVariance = 0;
staticOnMaxBounce = true;
useRadiusMass = true;
baseRadius = 1.0;
velocity = 0.0;
velocityVariance = 0.0;
};
//**************************************************************
// Bombers/Havocs/Blackhawks
//**************************************************************
datablock ExplosionData(MFVSubExplosion)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
delayMS = 0;
offset = 0.0;
playSpeed = 0.65;
sizes[0] = "8.0 8.0 8.0";
sizes[1] = "8.0 8.0 8.0";
times[0] = 0.0;
times[1] = 1.0;
debris = MeVSpikeDebris;
debrisThetaMin = 10;
debrisThetaMax = 175;
debrisNum = 5;
debrisNumVariance = 3;
debrisVelocity = 30.0;
debrisVelocityVariance = 7.0;
};
datablock ExplosionData(MFVehicleExplosion)
{
explosionShape = "disc_explosion.dts";
playSpeed = 1.5;
soundProfile = VehicleExplosionSound;
faceViewer = true;
emitter[0] = VehicleBoomSmokeEmitter;
debris = MeVehicleFireballDebris;
debrisThetaMin = 35;
debrisThetaMax = 95;
debrisNum = 25;
debrisNumVariance = 5;
debrisVelocity = 20.0;
debrisVelocityVariance = 5.0;
subExplosion = MFVSubExplosion;
shakeCamera = true;
camShakeFreq = "11.0 13.0 9.0";
camShakeAmp = "40.0 40.0 40.0";
camShakeDuration = 0.7;
camShakeRadius = 35.0;
};
datablock ParticleEmitterData(MFHeavyDamageSmoke)
{
ejectionPeriodMS = 5;
periodVarianceMS = 2;
ejectionVelocity = 5.0;
velocityVariance = 1.0;
ejectionOffset = 2.5;
thetaMin = 0;
thetaMax = 180;
overrideAdvances = false;
particles = "MeHeavyDamageSmokeParticle";
};
datablock ParticleEmitterData(MFLightDamageSmoke)
{
ejectionPeriodMS = 15;
periodVarianceMS = 6;
ejectionVelocity = 5.0;
velocityVariance = 1.0;
ejectionOffset = 2.0;
thetaMin = 0;
thetaMax = 180;
overrideAdvances = false;
particles = "MeLightDamageSmokeParticle";
};
//**************************************************************
// Tanks/APC/MPB
//**************************************************************
datablock ParticleEmitterData(MeHGHeavyDamageSmoke)
{
ejectionPeriodMS = 7;
periodVarianceMS = 2;
ejectionVelocity = 3.0;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 135;
overrideAdvances = false;
particles = "MeLightDamageSmokeParticle";
};
datablock ParticleData(HGVExplosionSmoke)
{
dragCoeffiecient = 0.4;
gravityCoefficient = 0.0; // rises slowly
inheritedVelFactor = 0.025;
lifetimeMS = 2000;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -200.0;
spinRandomMax = 200.0;
textureName = "special/Smoke/smoke_001";
colors[0] = "1.0 0.7 0.0 1.0";
colors[1] = "0.2 0.2 0.2 0.5";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 5.0;
sizes[1] = 10.0;
sizes[2] = 12.0;
times[0] = 0.0;
times[1] = 0.4;
times[2] = 1.0;
};
datablock ParticleEmitterData(HGVExplosionSmokeEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 20.0;
velocityVariance = 4.0;
thetaMin = 70.0;
thetaMax = 110.0;
lifetimeMS = 150;
particles = "HGVExplosionSmoke";
};
datablock ExplosionData(HGVSubExplosion)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
lifetimeMS = 3000;
delayMS = 0;
offset = 0.0;
playSpeed = 0.5;
sizes[0] = "8.0 8.0 8.0";
sizes[1] = "8.0 8.0 8.0";
times[0] = 0.0;
times[1] = 1.0;
emitter[0] = VehicleBoomSmokeEmitter;
debris = MeVehicleFireballDebris;
debrisThetaMin = 60;
debrisThetaMax = 90;
debrisNum = 10;
debrisNumVariance = 5;
debrisVelocity = 10.0;
debrisVelocityVariance = 9.0;
};
datablock ExplosionData(HGVSubExplosion2)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
lifetimeMS = 3000;
delayMS = 200;
offset = 8.0;
playSpeed = 0.75;
sizes[0] = "4.0 4.0 4.0";
sizes[1] = "4.0 4.0 4.0";
times[0] = 0.0;
times[1] = 1.0;
emitter[0] = HGVExplosionSmokeEmitter;
debris = MeVehicleFireballDebris;
debrisThetaMin = 60;
debrisThetaMax = 120;
debrisNum = 5;
debrisNumVariance = 2;
debrisVelocity = 15.0;
debrisVelocityVariance = 5.0;
};
datablock ExplosionData(HGVSubExplosion3)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
lifetimeMS = 3000;
delayMS = 400;
offset = 12.0;
playSpeed = 0.8;
sizes[0] = "3.5 3.5 3.5";
sizes[1] = "3.5 3.5 3.5";
times[0] = 0.0;
times[1] = 1.0;
emitter[0] = HGVExplosionSmokeEmitter;
debris = MeVehicleFireballDebris;
debrisThetaMin = 60;
debrisThetaMax = 120;
debrisNum = 5;
debrisNumVariance = 2;
debrisVelocity = 15.0;
debrisVelocityVariance = 5.0;
};
datablock ExplosionData(HGVSubExplosion4)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
lifetimeMS = 3000;
delayMS = 600;
offset = 15.0;
playSpeed = 0.8;
sizes[0] = "3.0 3.0 3.0";
sizes[1] = "3.0 3.0 3.0";
times[0] = 0.0;
times[1] = 1.0;
emitter[0] = HGVExplosionSmokeEmitter;
debris = MeVehicleFireballDebris;
debrisThetaMin = 60;
debrisThetaMax = 120;
debrisNum = 5;
debrisNumVariance = 2;
debrisVelocity = 15.0;
debrisVelocityVariance = 5.0;
};
datablock ExplosionData(HGVSubExplosion5)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
lifetimeMS = 3000;
delayMS = 900;
offset = 20.0;
playSpeed = 0.4;
sizes[0] = "5.0 5.0 5.0";
sizes[1] = "5.0 5.0 5.0";
times[0] = 0.0;
times[1] = 1.0;
emitter[0] = VehicleBoomSmokeEmitter;
debris = MeVehicleFireballDebris;
debrisThetaMin = 0;
debrisThetaMax = 90;
debrisNum = 10;
debrisNumVariance = 0;
debrisVelocity = 15.0;
debrisVelocityVariance = 5.0;
};
datablock ExplosionData(HGVehicleExplosion)
{
soundProfile = VehicleExplosionSound;
subExplosion[0] = HGVSubExplosion;
subExplosion[1] = HGVSubExplosion2;
subExplosion[2] = HGVSubExplosion3;
subExplosion[3] = HGVSubExplosion4;
subExplosion[4] = HGVSubExplosion5;
shakeCamera = true;
camShakeFreq = "11.0 13.0 9.0";
camShakeAmp = "40.0 40.0 40.0";
camShakeDuration = 1.0;
camShakeRadius = 40.0;
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,464 @@
//**************************************************************
// HAVOC HEAVY TRANSPORT FLIER
//**************************************************************
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(HAPCFlyerEngineEffect)
{
effectname = "vehicles/htransport_thrust";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(HAPCFlyerThrustEffect)
{
effectname = "vehicles/htransport_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(HAPCFlyerEngineSound)
{
filename = "fx/vehicles/htransport_thrust.wav";
description = AudioDefaultLooping3d;
effect = HAPCFlyerEngineEffect;
};
datablock AudioProfile(HAPCFlyerThrustSound)
{
filename = "fx/vehicles/htransport_boost.wav";
description = AudioDefaultLooping3d;
effect = HAPCFlyerThrustEffect;
};
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(HAPCFlyer) : HavocDamageProfile
{
spawnOffset = "0 0 6";
renderWhenDestroyed = false;
catagory = "Vehicles";
shapeFile = "vehicle_air_hapc.dts";
multipassenger = true;
computeCRC = true;
debrisShapeName = "vehicle_air_hapc.dts";
debris = ShapeDebris;
drag = 0.2;
density = 1.0;
mountPose[0] = sitting;
// mountPose[1] = sitting;
numMountPoints = 6;
isProtectedMountPoint[0] = true;
isProtectedMountPoint[1] = false;
isProtectedMountPoint[2] = false;
isProtectedMountPoint[3] = false;
isProtectedMountPoint[4] = false;
isProtectedMountPoint[5] = false;
canControl = true;
cameraMaxDist = 17;
cameraOffset = 2;
cameraLag = 8.5;
explosion = MFVehicleExplosion;
explosionDamage = 1.5;
explosionRadius = 20.0;
maxDamage = 8.0;
destroyedLevel = 8.0;
HDAddMassLevel = 5.6;
HDMassImage = HFlyerHDMassImage;
isShielded = false;
rechargeRate = 1.0;
energyPerDamagePoint = 175;
maxEnergy = 550;
minDrag = 100; // Linear Drag
rotationalDrag = 2700; // Anguler Drag
// Auto stabilize speed
maxAutoSpeed = 10;
autoAngularForce = 3000; // Angular stabilizer force
autoLinearForce = 450; // Linear stabilzer force
autoInputDamping = 0.95; //
// Maneuvering
maxSteeringAngle = 8;
horizontalSurfaceForce = 10; // Horizontal center "wing"
verticalSurfaceForce = 10; // Vertical center "wing"
maneuveringForce = 6000; // Horizontal jets
steeringForce = 1000; // Steering jets
steeringRollForce = 2500; // Steering jets
rollForce = 12; // Auto-roll
hoverHeight = 6; // Height off the ground at rest
createHoverHeight = 6; // Height off the ground when created
maxForwardSpeed = 90; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 5000;
minJetEnergy = 55;
jetEnergyDrain = 3.0;
vertThrustMultiple = 3.0;
dustEmitter = LargeVehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 2.0;
damageEmitter[0] = MFLightDamageSmoke;
damageEmitter[1] = MFHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "3.0 -3.0 0.0 ";
damageEmitterOffset[1] = "-3.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 2;
// Rigid body
mass = 450;
bodyFriction = 0;
bodyRestitution = 0.3;
minRollSpeed = 0;
softImpactSpeed = 12; // Sound hooks. This is the soft hit.
hardImpactSpeed = 15; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 25; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.060;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 28;
collDamageMultiplier = 0.020;
//
minTrailSpeed = 15;
trailEmitter = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = HAPCFlyerThrustSound;
engineSound = HAPCFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 8.0;
hardSplashSoundVelocity = 12.0;
exitSplashSoundVelocity = 8.0;
exitingWater = VehicleExitWaterHardSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterHardSound;
waterWakeSound = VehicleWakeHardSplashSound;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingHAPCIcon;
cmdMiniIconName = "commander/MiniIcons/com_hapc_grey";
targetNameTag = 'HVC Golem';
targetTypeTag = 'Heavy Transport';
sensorData = PlayerSensor;
checkRadius = 7.8115;
observeParameters = "1 15 15";
stuckTimerTicks = 32; // If the hapc spends more than 1 sec in contact with something
stuckTimerAngle = 80; // with a > 80 deg. pitch, BOOM!
shieldEffectScale = "1.0 0.9375 0.45";
max[PlasmaAmmo] = 20;
replaceTime = 40;
};
function HAPCFlyer::hasDismountOverrides(%data, %obj)
{
return true;
}
function HAPCFlyer::getDismountOverride(%data, %obj, %mounted)
{
%node = -1;
for (%i = 0; %i < %data.numMountPoints; %i++)
{
if (%obj.getMountNodeObject(%i) == %mounted)
{
%node = %i;
break;
}
}
if (%node == -1)
{
warning("Couldn't find object mount point");
return "0 0 1";
}
if (%node == 3 || %node == 2)
{
return "-1 0 1";
}
else if (%node == 5 || %node == 4)
{
return "1 0 1";
}
else
{
return "0 0 1";
}
}
//**************************************************************
// Vehicle pickup
//**************************************************************
datablock ShapeBaseImageData(FFTmountImage)
{
className = "WeaponImage";
shapeFile = "vehicle_land_mpbase.dts";
item = Disc;
offset = "0 0 -6";
emap = true;
mass = 500;
};
datablock ShapeBaseImageData(PanzermountImage)
{
className = "WeaponImage";
shapeFile = "vehicle_grav_tank.dts";
item = Disc;
offset = "0 0 -6";
emap = true;
mass = 325;
};
datablock ShapeBaseImageData(WC1Image)
{
className = "WeaponImage";
shapeFile = "vehicle_grav_scout.dts";
item = Disc;
offset = "0 0 -5"; // L/R - F/B - T/B
emap = true;
mass = 50;
};
datablock ShapeBaseImageData(WC2Image)
{
className = "WeaponImage";
shapeFile = "vehicle_grav_scout.dts";
item = Disc;
offset = "0 4 -5"; // L/R - F/B - T/B
emap = true;
mass = 50;
};
function HAPCflyer::onTrigger(%data, %obj, %trigger, %state)
{
if(!%obj.hasVEH && %state == 1 && %trigger == 0)
{
%mask = $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::VehicleObjectType;
%dir = %obj.getTransform();
%dir = getWord(%dir, 5);
if(%dir > 0)
%dir *= -1;
if(vectorDot("0 0 -10", "0 0 "@ %dir) < 9)
return;
%vector = vectorAdd(%obj.getWorldBoxCenter(), "0 0 -10");
%searchResult = containerRayCast(%obj.getWorldBoxCenter(), %vector, %mask, %obj);
if(%searchResult)
{
%searchObj = GetWord(%searchResult, 0);
if(%searchObj.getClassName() $= "wheeledVehicle"){
%searchObj.setTransform(vectorAdd(%searchObj.getPosition(), "0 0 10000"));
%searchObj.setCloaked(true);
%obj.mountImage(FFTmountImage, 6);
%searchObj.setFrozenState(true);
%obj.hasVEH = true;
%obj.VEHmounted = %searchObj;
}
else if(%searchObj.getClassName() $= "HoverVehicle"){
%searchObj.setTransform(vectorAdd(%searchObj.getPosition(), "0 0 10000"));
%searchObj.setCloaked(true);
%searchObj.setFrozenState(true);
%obj.hasVEH = true;
%obj.VEHmounted = %searchObj;
if(%searchObj.getDataBlock().getName() $= "ScoutVehicle")
%obj.mountImage(WC1Image, 6);
else
%obj.mountImage(PanzermountImage, 6);
}
}
}
else if(%obj.hasVEH && %state == 1 && %trigger == 0)
{
%dir = %obj.getTransform();
%dir = getWord(%dir, 5);
if(%dir > 0)
%dir *= -1;
//echo(vectorDot("0 0 -10", "0 0 "@ %dir));
if(vectorDot("0 0 -10", "0 0 "@ %dir) < 9)
return;
%mask = $TypeMasks::InteriorObjectType | $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::TerrainObjectType;
%vector = vectorAdd(%obj.getWorldBoxCenter(), "0 0 -15");
%searchResult = containerRayCast(%obj.getWorldBoxCenter(), %vector, %mask, %obj);
%vec = %Obj.getvelocity();
if(%searchResult)
{
return;
}
if (%obj.VEHmounted !$= "")
{
%obj.VEHmounted.setFrozenState(false);
%obj.VEHmounted.setTransform(%obj.getTransform());
%vector = vectorAdd("0 0 -13", %obj.getWorldBoxCenter());
%obj.VEHmounted.setTransform(%vector);
%obj.VEHmounted.applyImpulse(%obj.VEHmounted.getPosition(),vectorScale(%vec,%obj.VEHmounted.getDataBlock().mass));
%obj.VEHmounted.setCloaked(false);
%obj.unMountImage(6);
%obj.unMountObject(%obj.MPBstaticMount);
%obj.hasVEH = false;
%obj.VEHmounted = "";
%obj.canpickupWC = false;
}
}
else if (%trigger ==4) // Throw flare
{
switch (%state)
{
case 0:
%obj.fireWeapon = false;
%obj.setImageTrigger(5, false);
case 1:
if (%obj.inv[PlasmaAmmo] > 0)
{
%obj.fireWeapon = true;
%obj.setImageTrigger(5, true);
%obj.decInventory(PlasmaAmmo, 1);
%p = new FlareProjectile()
{
dataBlock = FlareGrenadeProj;
initialDirection = "0 0 -1";
initialPosition = getBoxCenter(%obj.getWorldBox());
sourceObject = %obj;
sourceSlot = 0;
};
FlareSet.add(%p);
MissionCleanup.add(%p);
serverPlay3D(GrenadeThrowSound, getBoxCenter(%obj.getWorldBox()));
%p.schedule(6000, "delete");
// miscellaneous grenade-throwing cleanup stuff
%obj.lastThrowTime[%data] = getSimTime();
%obj.throwStrength = 0;
}
}
}
%up = %obj.getUpVector();
if(%state == 1 && %trigger == 5 && vectorDist(%up,"0 0 1") <= 0.3){
%frd = %obj.getForwardVector();
%right = vectorNormalize(vectorSub(%obj.getEdge("1 0 0"),%obj.getEdge("-1 0 0")));
for(%i = 2; %i < 6; %i++){
if(%obj.getMountNodeObject(%i)){
%plyr = %obj.getMountNodeObject(%i);
%plyr.unmount();
%plyr.setPosition("0 0 1000");
%vec = vectorAdd(vectorScale(%right,getWord($PodPos[%i],0)),vectorScale(%frd,getWord($PodPos[%i],1)));
%pos = vectorAdd(%obj.getPosition(),%vec);
%pod = MakeDropPod(vectorAdd(%pos,"0 0 -15"),%obj.team);
slowDropPod(%pod);
// Eolk - was wrong. Didn't mount right.
// %pod.schedule(10, "mountObject", %plyr, 0);
%plyr.getDatablock().schedule(10, "onCollision", %plyr, %pod, 0);
commandToClient(%plyr.client, 'setHudMode', 'Standard', "", 0);
}
}
}
}
$PodPos[2] = "-3 7";
$PodPos[3] = "-3 3";
$PodPos[4] = "3 3";
$PodPos[5] = "3 7";
function HAPCflyer::onDestroyed(%data, %obj, %prevState){
%vec = %Obj.getvelocity();
if (%obj.VEHmounted !$= "")
{
%obj.VEHmounted.setFrozenState(false);
%obj.VEHmounted.setTransform(%obj.getTransform());
%vector = vectorAdd("0 0 -13", %obj.getWorldBoxCenter());
%obj.VEHmounted.setTransform(%vector);
%obj.VEHmounted.applyImpulse(%obj.VEHmounted.getPosition(),vectorScale(%vec,%obj.VEHmounted.getDataBlock().mass));
%obj.VEHmounted.setCloaked(false);
%obj.unMountImage(6);
%obj.unMountObject(%obj.MPBstaticMount);
%obj.hasVEH = false;
%obj.VEHmounted = "";
%obj.canpickupWC = false;
if(%obj.hasWC){
%obj.WCmounted.setFrozenState(false);
%obj.WCmounted.setTransform(%obj.getTransform());
%vector = vectorAdd("0 6 -13", %obj.getWorldBoxCenter());
%obj.WCmounted.setTransform(%vector);
%obj.WCmounted.applyImpulse(%obj.MPBmounted.getPosition(), vectorScale(%vec,ScoutVehicle.mass));
%obj.WCmounted.setCloaked(false);
%obj.unMountImage(7);
%obj.unMountObject(%obj.MPBstaticMount);
%obj.hasWC = false;
%obj.WCmounted = "";
}
}
Parent::onDestroyed(%data, %obj, %prevState);
}
function HAPCflyer::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}

View file

@ -0,0 +1,414 @@
//**************************************************************
// SHRIKE SCOUT FLIER
//**************************************************************
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(HawkFlyer) : ShrikeDamageProfile
{
spawnOffset = "0 0 2";
catagory = "Vehicles";
shapeFile = "vehicle_air_scout.dts";
multipassenger = false;
computeCRC = true;
debrisShapeName = "vehicle_air_scout_debris.dts";
debris = ShapeDebris;
renderWhenDestroyed = false;
drag = 0.15;
density = 1.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
cameraMaxDist = 15;
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = VehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
maxDamage = 1.40;
destroyedLevel = 1.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 = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 15; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 400; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 300; // 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
// Maneuvering
maxSteeringAngle = 5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 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 = 3000; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 1200; // Steering jets (force applied when you move the mouse)
steeringRollForce = 400; // Steering jets (how much you heel over when you turn)
rollForce = 4; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 5; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
maxForwardSpeed = 100; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 2000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 0.0; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 3.0;
// Rigid body
mass = 150; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 14; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // 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 = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = ScoutFlyerThrustSound;
engineSound = ScoutFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 15.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
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 = 1;
//
max[chaingunAmmo] = 1000;
minMountDist = 4;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
targetNameTag = 'Hawk';
targetTypeTag = 'Interceptor';
sensorData = AWACPulseSensor;
sensorRadius = AWACPulseSensor.detectRadius;
sensorColor = "255 194 9";
checkRadius = 5.5;
observeParameters = "1 10 10";
runningLight[0] = ShrikeLight1;
// runningLight[1] = ShrikeLight2;
shieldEffectScale = "0.937 1.125 0.60";
};
//**************************************************************
// WEAPONS
//**************************************************************
datablock TracerProjectileData(HawkChaingunBullet)
{
doDynamicClientHits = true;
directDamage = 0.1;
directDamageType = $DamageType::Bullet;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
kickBackStrength = 0.0;
sound = ChaingunProjectile;
dryVelocity = 425.0;
wetVelocity = 100.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 10.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.10;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
};
datablock ShapeBaseImageData(HawkChaingunPairImage)
{
className = WeaponImage;
shapeFile = "weapon_chaingun.dts";
projectile = HawkChaingunBullet;
projectileType = TracerProjectile;
mountPoint = 10;
offset = "0.84 -0.52 1.8";
rotation = "1 0 0 0";
usesEnergy = true;
useMountEnergy = true;
minEnergy = 3;
fireEnergy = 1;
fireTimeout = 125;
casing = ShellDebris;
shellExitDir = "0 -0.5 1.0";
shellExitOffset = "0 -0.56 -0.11";
shellExitVariance = 15.0;
shellVelocity = 5.0;
projectileSpread = 6.0 / 1000.0;
//--------------------------------------
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateSound[0] = ChaingunSwitchSound;
stateAllowImageChange[0] = false;
//
stateTimeoutValue[0] = 0.3;
stateTransitionOnTimeout[0] = "Ready";
stateTransitionOnNoAmmo[0] = "NoAmmo";
//--------------------------------------
stateName[1] = "Ready";
stateSpinThread[1] = Stop;
//
stateTransitionOnTriggerDown[1] = "Spinup";
stateTransitionOnNoAmmo[1] = "NoAmmo";
//--------------------------------------
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateSpinThread[2] = Stop;
stateTransitionOnTriggerDown[2] = "DryFire";
//--------------------------------------
stateName[3] = "Spinup";
stateSpinThread[3] = SpinUp;
// stateSound[3] = ChaingunSpinupSound;
//
stateTimeoutValue[3] = 0.05;
stateWaitForTimeout[3] = false;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Spindown";
//--------------------------------------
stateName[4] = "Fire";
stateSequence[4] = "Fire";
stateSequenceRandomFlash[4] = true;
stateSpinThread[4] = FullSpeed;
stateSound[4] = ChaingunFireSound;
//stateRecoil[4] = LightRecoil;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateFire[4] = true;
stateEjectShell[4] = true;
//
stateTimeoutValue[4] = 0.09;
stateTransitionOnTimeout[4] = "Fire";
stateTransitionOnTriggerUp[4] = "Spindown";
stateTransitionOnNoAmmo[4] = "EmptySpindown";
//--------------------------------------
stateName[5] = "Spindown";
// stateSound[5] = ChaingunSpinDownSound;
stateSpinThread[5] = SpinDown;
//
stateTimeoutValue[5] = 0.05;
stateWaitForTimeout[5] = true;
stateTransitionOnTimeout[5] = "Ready";
stateTransitionOnTriggerDown[5] = "Spinup";
//--------------------------------------
stateName[6] = "EmptySpindown";
// stateSound[6] = ChaingunSpinDownSound;
stateSpinThread[6] = SpinDown;
//
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
//--------------------------------------
stateName[7] = "DryFire";
stateSound[7] = ChaingunDryFireSound;
stateTimeoutValue[7] = 0.3;
stateTransitionOnTimeout[7] = "NoAmmo";
};
datablock ShapeBaseImageData(HawkChaingunImage) : HawkChaingunPairImage
{
//*wingtips** offset = "-2.04 -0.52 -0.05";
offset = "-1.04 -0.52 1.8";
rotation = "1 0 0 0";
stateScript[3] = "onTriggerDown";
stateScript[5] = "onTriggerUp";
stateScript[6] = "onTriggerUp";
};
datablock ShapeBaseImageData(HawkChaingunParam)
{
mountPoint = 2;
shapeFile = "weapon_chaingun.dts";
projectile = HawkChaingunBullet;
projectileType = TracerProjectile;
};
//********* FUNCTIONS ***********
function HawkFlyer::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.mountImage(HawkChaingunParam, 0);
%obj.mountImage(HawkChaingunImage, 2);
%obj.mountImage(HawkChaingunPairImage, 3);
%obj.nextWeaponFire = 2;
%obj.schedule(5500, "playThread", $ActivateThread, "activate");
}
function HawkFlyer::playerMounted(%data, %obj, %player, %node)
{
// AdminFighter flyer == SUV (single-user vehicle)
commandToClient(%player.client, 'setHudMode', 'Pilot', "Shrike", %node);
$numVWeapons = 1;
// update observers who are following this guy...
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
}
function HawkFlyer::onTrigger(%data, %obj, %trigger, %state)
{
// data = AdminFighterFlyer datablock
// obj = AdminFighterFlyer object number
// trigger = 0 for "fire", 1 for "jump", 3 for "thrust"
// state = 1 for firing, 0 for not firing
if(%trigger == 0)
{
switch (%state) {
case 0:
%obj.fireWeapon = false;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
case 1:
%obj.setImageTrigger(2, true);
%obj.setImageTrigger(3, true);
}
}
}
function HawkFlyer::playerDismounted(%data, %obj, %player)
{
%obj.fireWeapon = false;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
setTargetSensorGroup(%obj.getTarget(), %obj.team);
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, true );
}
function HawkChaingunImage::onFire(%data,%obj,%slot)
{
// obj = AdminFighterFlyer object number
// slot = 2
Parent::onFire(%data,%obj,%slot);
// %obj.nextWeaponFire = 3;
// schedule(%data.fireTimeout, 0, "fireNextGun", %obj);
}
function HawkChaingunPairImage::onFire(%data,%obj,%slot)
{
// obj = ScoutFlyer object number
// slot = 3
Parent::onFire(%data,%obj,%slot);
// %obj.nextWeaponFire = 2;
// schedule(%data.fireTimeout, 0, "fireNextGun", %obj);
}
function HawkChaingunImage::onTriggerDown(%this, %obj, %slot)
{
}
function HawkChaingunImage::onTriggerUp(%this, %obj, %slot)
{
}
function HawkChaingunImage::onMount(%this, %obj, %slot)
{
// %obj.setImageAmmo(%slot,true);
}
function HawkChaingunPairImage::onMount(%this, %obj, %slot)
{
// %obj.setImageAmmo(%slot,true);
}
function HawkChaingunImage::onUnmount(%this,%obj,%slot)
{
}
function HawkChaingunPairImage::onUnmount(%this,%obj,%slot)
{
}

View file

@ -0,0 +1,288 @@
//**************************************************************
// JERICHO FORWARD BASE (Mobile Point Base)
//**************************************************************
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(MPBEngineEffect)
{
effectname = "vehicles/mpb_thrust";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(MPBThrustEffect)
{
effectname = "vehicles/mpb_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(MPBEngineSound)
{
filename = "fx/vehicles/mpb_thrust.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = MPBEngineEffect;
};
datablock AudioProfile(MPBThrustSound)
{
filename = "fx/vehicles/mpb_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = MPBThrustEffect;
};
datablock AudioProfile(MobileBaseDeploySound)
{
filename = "fx/vehicles/MPB_deploy.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(MobileBaseUndeploySound)
{
filename = "fx/vehicles/MPB_undeploy_turret.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(MobileBaseTurretDeploySound)
{
filename = "fx/vehicles/MPB_deploy_turret.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(MobileBaseTurretUndeploySound)
{
filename = "fx/vehicles/MPB_undeploy_turret.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(MobileBaseStationUndeploySound)
{
filename = "fx/vehicles/MPB_close_lid.wav";
description = AudioClose3d;
preload = true;
};
//**************************************************************
// LIGHTS
//**************************************************************
datablock RunningLightData(MPBLight1)
{
pointSize = 3.0;
pointColor = "1.0 1.0 1.0 0.3";
pointNodeName = "Headlight_node01";
texture = "special/expFlare";
};
datablock RunningLightData(MPBLight2)
{
pointSize = 3.0;
pointColor = "1.0 1.0 1.0 0.3";
pointNodeName = "Headlight_node02";
texture = "special/expFlare";
};
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock SensorData(MPBDeployedSensor) : VehiclePulseSensor
{
jams = true;
jamsOnlyGroup = true;
jamsUsingLOS = false;
jamRadius = 50;
};
datablock WheeledVehicleData(MobileBaseVehicle) : MPBDamageProfile
{
spawnOffset = "0 0 1.0";
renderWhenDestroyed = false;
canControl = true;
catagory = "Vehicles";
shapeFile = "vehicle_land_mpbase.dts";
multipassenger = false;
computeCRC = true;
debrisShapeName = "vehicle_land_mpbase.dts";
debris = GShapeDebris;
drag = 0.0;
density = 20.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
cantAbandon = 1;
cantTeamSwitch = 1;
cameraMaxDist = 20;
cameraOffset = 6;
cameraLag = 1.5;
explosion = HGVehicleExplosion;
explosionDamage = 1.25;
explosionRadius = 20.0;
maxSteeringAngle = 0.3; // 20 deg.
// Used to test if the station can deploy
stationPoints[1] = "-2.3 -7.38703 -0.65";
stationPoints[2] = "-2.3 -11.8 -0.65";
stationPoints[3] = "0 -7.38703 -0.65";
stationPoints[4] = "0 -11.8 -0.65";
stationPoints[5] = "2.3 -7.38703 -0.65";
stationPoints[6] = "2.3 -11.8 -0.65";
// Rigid Body
mass = 2000;
bodyFriction = 0.8;
bodyRestitution = 0.5;
minRollSpeed = 3;
gyroForce = 400;
gyroDamping = 0.3;
stabilizerForce = 10;
minDrag = 10;
softImpactSpeed = 15; // Play SoftImpact Sound
hardImpactSpeed = 25; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 24;
speedDamageScale = 0.025;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 15;
collDamageMultiplier = 0.03;
// Engine
engineTorque = 7.0 * 745;
breakTorque = 7.0 * 745;
maxWheelSpeed = 20;
// Springs
springForce = 8000;
springDamping = 1300;
antiSwayForce = 6000;
staticLoadScale = 2;
// Tires
tireRadius = 1.6;
tireFriction = 10.0;
tireRestitution = 0.5;
tireLateralForce = 3000;
tireLateralDamping = 400;
tireLateralRelaxation = 1;
tireLongitudinalForce = 12000;
tireLongitudinalDamping = 600;
tireLongitudinalRelaxation = 1;
tireEmitter = TireEmitter;
//
maxDamage = 6.5;
destroyedLevel = 6.5;
HDAddMassLevel = 5.0;
HDMassImage = APCHDMassImage;
isShielded = false;
energyPerDamagePoint = 125;
maxEnergy = 600;
jetForce = 2800;
minJetEnergy = 60;
jetEnergyDrain = 2.75;
rechargeRate = 1.0;
jetSound = MPBThrustSound;
engineSound = MPBEngineSound;
squeelSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 8.0;
hardSplashSoundVelocity = 12.0;
exitSplashSoundVelocity = 8.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterHardSound;
waterWakeSound = VehicleWakeMediumSplashSound;
minMountDist = 3;
damageEmitter[0] = LightDamageSmoke;
damageEmitter[1] = MeHGHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "3.0 0.5 0.0 ";
damageEmitterOffset[1] = "-3.0 0.5 0.0 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 2;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDGroundMPBIcon;
cmdMiniIconName = "commander/MiniIcons/com_mpb_grey";
targetNameTag = 'Jericho';
targetTypeTag = 'MPB';
sensorData = VehiclePulseSensor;
checkRadius = 7.5225;
observeParameters = "1 12 12";
runningLight[0] = MPBLight1;
runningLight[1] = MPBLight2;
shieldEffectScale = "0.85 1.2 0.7";
replaceTime = 120;
};
//**************************************************************
// WEAPONS
//**************************************************************
datablock TurretData(MobileTurretBase)
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "turret_base_mpb.dts";
preload = true;
mass = 1.0; // Not really relevant
maxDamage = MobileBaseVehicle.maxDamage;
destroyedLevel = MobileBaseVehicle.destroyedLevel;
thetaMin = 15;
thetaMax = 140;
energyPerDamagePoint = 33;
inheritEnergyFromMount = true;
firstPersonOnly = true;
sensorData = AWACSensor;
sensorRadius = AWACSensor.detectRadius;
sensorColor = "255 194 9";
cmdCategory = "Tactical";
cmdMiniIconName = "commander/MiniIcons/com_turret_grey";
targetNameTag = 'Jericho';
targetTypeTag = 'Turret';
canControl = true;
};

View file

@ -0,0 +1,502 @@
//**************************************************************
// S11 Recon Drone
//**************************************************************
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(S11) : ShrikeDamageProfile
{
spawnOffset = "0 0 2";
canControl = false;
catagory = "Vehicles";
shapeFile = "nexuscap.dts";
multipassenger = false;
computeCRC = true;
debrisShapeName = "debris_generic_small.dts";
debris = MeShapeDebris;
renderWhenDestroyed = false;
drag = 0.15;
density = 1.0;
mountPose[0] = sitting;
mountPose[1] = sitting;
numMountPoints = 2;
isProtectedMountPoint[0] = false;
isProtectedMountPoint[1] = false;
cameraMaxDist = 15;
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = MeVehicleExplosion;
explosionDamage = 1.0;
explosionRadius = 10.0;
maxDamage = 1.2;
destroyedLevel = 1.2;
HDAddMassLevel = 1.0;
HDMassImage = LflyerHDMassImage;
isShielded = false;
energyPerDamagePoint = 0;
maxEnergy = 1200; // Afterburner and any energy weapon pool
rechargeRate = 4;
minDrag = 22; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 100; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 400; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 0; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 0; // Dampen control input so you don't` whack out at very slow speeds
// Maneuvering
maxSteeringAngle = 4.5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 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 = 3500; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 300; // Steering jets (force applied when you move the mouse)
steeringRollForce = 2000; // Steering jets (how much you heel over when you turn)
rollForce = 7; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 2.5; // Height off the ground at rest
createHoverHeight = 2; // Height off the ground when created
maxForwardSpeed = 120; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 2500; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 7; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 1.25;
// Rigid body
mass = 90; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 14; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 20; // 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 = 150; // The speed your contrail shows up at.
trailEmitter = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = ScoutFlyerThrustSound;
engineSound = ScoutFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 15.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 1.0;
damageEmitter[0] = MeLightDamageSmoke;
damageEmitter[1] = MeHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "0.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.65;
damageLevelTolerance[1] = 0.8;
numDmgEmitterAreas = 1;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
targetNameTag = 'S11';
targetTypeTag = 'Recon Drone';
sensorData = combatSensor;
sensorRadius = combatSensor.detectRadius;
sensorColor = "9 9 255";
checkRadius = 5.5;
observeParameters = "1 10 10";
runningLight[0] = ShrikeLight1;
shieldEffectScale = "0.937 1.125 0.60";
replaceTime = 90;
max[AALauncherAmmo] = 1;
};
datablock StaticShapeData(S11wing) : StaticShapeDamageProfile {
shapeFile = "deploy_inventory.dts";
mass = 1.0;
repairRate = 0;
dynamicType = $TypeMasks::StaticShapeObjectType;
heatSignature = 0;
};
datablock StaticShapeData(S11sensor) : StaticShapeDamageProfile {
shapeFile = "deploy_sensor_pulse.dts";
mass = 1.0;
repairRate = 0;
dynamicType = $TypeMasks::StaticShapeObjectType;
heatSignature = 0;
};
//-------------------------------------
// CHOPPER BELLY TURRET CHARACTERISTICS
//-------------------------------------
datablock TurretData(S11Turret) : ShrikeDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "turret_belly_base.dts"; //turret_sentry.dts
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingBomberIcon;
cmdMiniIconName = "commander/MiniIcons/com_turret_grey";
mass = 1.0; // Not really relevant
repairRate = 0;
maxDamage = S11.maxDamage;
destroyedLevel = S11.destroyedLevel;
thetaMin = 90;
thetaMax = 180;
heatSignature = 0.0;
// capacitor
maxCapacitorEnergy = 500;
capacitorRechargeRate = 5.0;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
numWeapons = 2;
targetNameTag = 'S11';
targetTypeTag = 'Turret';
max[AALauncherAmmo] = 1;
};
datablock TurretImageData(S11TL)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
mountPoint = 0;
offset = "0 0 0";
projectile = GunshipTlProj;
projectileType = TargetProjectile;
deleteLastProjectile = false;
usesEnergy = true;
useMountEnergy = true;
useCapacitor = false;
minEnergy = 0;
fireEnergy = 1.0;
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Ready";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateName[2] = "Fire";
stateEnergyDrain[2] = 0;
stateFire[2] = true;
stateScript[2] = "onFire";
stateTransitionOnTriggerUp[2] = "Deconstruct";
stateName[3] = "Deconstruct";
stateScript[3] = "onDecon";
stateTimeoutValue[3] = 0.1;
stateTransitionOnTimeout[3] = "Ready";
};
datablock TurretImageData(S11MissileImage)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
item = MissileLauncher;
ammo = AALauncherAmmo;
projectile = HammerATMissile;
projectileType = SeekerProjectile;
mountPoint = 1;
usesEnergy = false;
useMountEnergy = true;
fireEnergy = 0.0;
minEnergy = 0.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateSound[3] = MissileFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 5.0;
stateAllowImageChange[4] = false;
stateSound[4] = MissileReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ShrikeBlasterDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock TurretImageData(S11TurretParam)
{
mountPoint = 3;
shapeFile = "turret_muzzlepoint.dts";
offset = "0.0 0.0 -1.5";
projectile = snipergunBullet;
projectileType = TracerProjectile;
activationMS = 10;
deactivateDelayMS = 15;
thinkTimeMS = 20;
degPerSecTheta = 50;
degPerSecPhi = 80;
attackRadius = 1200;
};
function S11::onAdd(%this, %obj){
Parent::onAdd(%this, %obj);
%turret = TurretData::create(S11Turret);
MissionCleanup.add(%turret);
%turret.team = %obj.team;
%turret.setSelfPowered();
%obj.mountObject(%turret, 10);
%turret.mountImage(S11TurretParam, 0);
%turret.mountImage(S11TL, 2);
%turret.mountImage(S11MissileImage, 3);
%turret.setInventory(AALauncherAmmo, 1);
%obj.turret = %turret;
%obj.turretobject = %turret;
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
%turret.vehicleMounted = %obj;
%turret.setAutoFire(false);
%turret.mountobj = %obj;
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
%obj.startFade(0,10,1);
%wing = new StaticShape()
{
scale = "2.5 4 0.12";
dataBlock = "S11wing";
};
MissionCleanup.add(%wing);
%obj.mountObject(%wing, 1);
%wing.vehicleMounted = %obj;
%wing.deploy();
%sensor = new StaticShape()
{
scale = "1.5 1.5 0.5";
dataBlock = "S11sensor";
};
MissionCleanup.add(%sensor);
%obj.mountObject(%sensor, 2);
%sensor.vehicleMounted = %obj;
%sensor.deploy();
schedule(5000, 0, "S11TurretAttackCheck",%obj);
}
function S11::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(10);
if (!%turret)
return;
if (%client = %turret.getControllingClient())
{
%client.player.setControlObject(%client.player);
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
%client.player.bomber = false;
%client.player.isBomber = false;
}
%turret.schedule(500, delete);
%body = %obj.getMountNodeObject(2);
if (isObject(%body))
%body.schedule(1000, delete);
%wing = %obj.getMountNodeObject(1);
if (isObject(%wing))
%wing.schedule(2000, delete);
$teamRepCredits[%obj.team] += getWord($commsatPurchase[1],1);
$teamUsedCredits[%obj.team] -= getWord($commsatPurchase[1],1);
}
function S11Turret::onTrigger(%data, %obj, %trigger, %state)
{
switch (%trigger)
{
case 0:
%obj.fireTrigger = %state;
if(%obj.selectedWeapon == 1)
{
%obj.setImageTrigger(3, false);
if(%state)
%obj.setImageTrigger(2, true);
else
%obj.setImageTrigger(2, false);
}
else
{
%obj.setImageTrigger(2, false);
if(%state)
%obj.setImageTrigger(3, true);
else
%obj.setImageTrigger(3, false);
}
case 2:
if(%state)
{
%obj.getDataBlock().playerDismount(%obj);
}
}
}
function S11MissileImage::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
MissileSet.add(%p);
if(isObject(%obj.TLB)){
%p.setObjectTarget(%obj.TLB);
%obj.TLB.setPosition(%obj.target.getPosition());
}
%obj.lastmissile = %p;
}
function S11TL::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
schedule(400,0,"S11TLmakebeacon",%obj,%p);
}
function S11TLmakebeacon(%obj,%p){
%p.setTarget(%obj.team);
%p.beacon = new BeaconObject() {
dataBlock = "SubBeacon";
beaconType = "vehicle";
position = %p.getTargetPoint();
};
%beacon.team = %obj.team;
%beacon.setTarget(%obj.team);
%obj.TLB = %p.beacon;
%obj.TL = %p;
%p.turret = %obj;
}
function S11TL::onDecon(%data,%obj,%slot){
%obj.TL.delete();
removeTLBcheck(%obj.TLB,%obj.lastmissile);
}
function removeTLBcheck(%TLB,%p){
if(!isObject(%TLB))
return;
if(!isObject(%p)){
%TLB.delete();
return;
}
schedule(500, 0, "removeTLBcheck", %TLB, %p);
}
function S11TurretAttackCheck(%obj){
if(!isObject(%obj))
return;
if(%obj.mode $= "RECON"){
%valid = 0;
%TargetSearchMask = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::StationObjectType | $TypeMasks::GeneratorObjectType | $TypeMasks::SensorObjectType | $TypeMasks::TurretObjectType;
InitContainerRadiusSearch(%obj.getPosition(),1200,%TargetSearchMask);
while ((%potentialTarget = ContainerSearchNext()) != 0) {
if (%potentialtarget && %valid != 1) {
%PTT = %potentialtarget.team;
if(%PTT $= "")
%PTT = %obj.team;
if(!(%PTT == %obj.team)){
%valid = 1;
%target = %potentialtarget;
}
}
}
if(%valid == 1){
%obj.turretobject.setTargetObject(%target);
%obj.turretobject.aquireTime = getSimTime();
%obj.turretobject.setImageTrigger(2,true);
}
else{
%obj.turretobject.setImageTrigger(2,false);
%obj.turretObject.clearTarget();
}
}
schedule(250, 0, "S11TurretAttackCheck",%obj);
}

View file

@ -0,0 +1,732 @@
//**************************************************************
// SHRIKE SCOUT FLIER
//**************************************************************
datablock SensorData(combatSensor)
{
detects = true;
detectsUsingLOS = true;
detectsPassiveJammed = false;
detectsActiveJammed = false;
detectsCloaked = false;
detectionPings = true;
detectRadius = 500;
};
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(ScoutFlyerThrustEffect)
{
effectname = "vehicles/shrike_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(ScoutFlyerEngineEffect)
{
effectname = "vehicles/shrike_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(ShrikeBlasterFireEffect)
{
effectname = "vehicles/shrike_blaster";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(ScoutFlyerThrustSound)
{
filename = "fx/vehicles/shrike_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = ScoutFlyerThrustEffect;
};
datablock AudioProfile(ScoutFlyerEngineSound)
{
filename = "fx/vehicles/shrike_engine.wav";
description = AudioDefaultLooping3d;
preload = true;
};
datablock AudioProfile(ShrikeBlasterFire)
{
filename = "fx/vehicles/tank_chaingun.wav";
description = AudioDefault3d;
preload = true;
effect = ScoutFlyerEngineEffect;
};
datablock AudioProfile(ShrikeBlasterProjectile)
{
filename = "fx/weapons/shrike_blaster_projectile.wav";
description = ProjectileLooping3d;
preload = true;
effect = ShrikeBlasterFireEffect;
};
datablock AudioProfile(ShrikeBlasterDryFireSound)
{
filename = "fx/weapons/chaingun_dryfire.wav";
description = AudioClose3d;
preload = true;
};
//**************************************************************
// LIGHTS
//**************************************************************
datablock RunningLightData(ShrikeLight1)
{
type = 1;
radius = 2.0;
length = 3.0;
color = "1.0 1.0 1.0 1.0";
direction = "0.0 1.0 -1.0 ";
offset = "0.0 0.0 -0.5";
texture = "special/lightcone04";
};
datablock RunningLightData(ShrikeLight2)
{
radius = 1.5;
color = "1.0 1.0 1.0 0.3";
direction = "0.0 0.0 -1.0";
offset = "0.0 0.8 -1.2";
texture = "special/headlight4";
};
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock FlyingVehicleData(ScoutFlyer) : ShrikeDamageProfile
{
spawnOffset = "0 0 2";
canControl = false;
catagory = "Vehicles";
shapeFile = "vehicle_air_scout.dts";
multipassenger = false;
computeCRC = true;
debrisShapeName = "vehicle_air_scout.dts";
debris = MeShapeDebris;
renderWhenDestroyed = false;
drag = 0.15;
density = 1.0;
mountPose[0] = sitting;
numMountPoints = 1;
isProtectedMountPoint[0] = false;
cameraMaxDist = 15;
cameraOffset = 2.5;
cameraLag = 0.9;
explosion = MeVehicleExplosion;
explosionDamage = 1.0;
explosionRadius = 10.0;
maxDamage = 2.5;
destroyedLevel = 2.5;
HDAddMassLevel = 1.9;
HDMassImage = LflyerHDMassImage;
isShielded = false;
energyPerDamagePoint = 0;
maxEnergy = 1200; // Afterburner and any energy weapon pool
rechargeRate = 4;
minDrag = 22; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 900; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 50; // Autostabilizer kicks in when less than this speed. (meters/second)
autoAngularForce = 400; // Angular stabilizer force (this force levels you out when autostabilizer kicks in)
autoLinearForce = 1; // Linear stabilzer force (this slows you down when autostabilizer kicks in)
autoInputDamping = 0.8; // Dampen control input so you don't` whack out at very slow speeds
// Maneuvering
maxSteeringAngle = 4.5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 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 = 5250; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 675; // Steering jets (force applied when you move the mouse)
steeringRollForce = 3000; // Steering jets (how much you heel over when you turn)
rollForce = 1; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 2.5; // Height off the ground at rest
createHoverHeight = 1; // Height off the ground when created
maxForwardSpeed = 165; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 2500; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 10; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 1.25;
// Rigid body
mass = 150; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.5; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 0; // Don't mess with this.
softImpactSpeed = 14; // Sound hooks. This is the soft hit.
hardImpactSpeed = 25; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 20; // 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 = 150; // The speed your contrail shows up at.
trailEmitter = ContrailEmitter;
forwardJetEmitter = FlyerJetEmitter;
downJetEmitter = FlyerJetEmitter;
//
jetSound = ScoutFlyerThrustSound;
engineSound = ScoutFlyerEngineSound;
softImpactSound = SoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 15.0;
hardSplashSoundVelocity = 20.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 4.0;
dustHeight = 1.0;
damageEmitter[0] = MeLightDamageSmoke;
damageEmitter[1] = MeHeavyDamageSmoke;
damageEmitter[2] = MeDamageBubbles;
damageEmitterOffset[0] = "0.0 -3.0 0.0 ";
damageLevelTolerance[0] = 0.4;
damageLevelTolerance[1] = 0.75;
numDmgEmitterAreas = 1;
//
max[chaingunAmmo] = 1500;
max[MissileLauncherAmmo] = 4;
max[MortarAmmo] = 3;
minMountDist = 7;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDFlyingScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
targetNameTag = 'F39 RaptorII';
targetTypeTag = 'Interceptor';
sensorData = combatSensor;
sensorRadius = combatSensor.detectRadius;
sensorColor = "9 9 255";
checkRadius = 5.5;
observeParameters = "1 10 10";
runningLight[0] = ShrikeLight1;
// runningLight[1] = ShrikeLight2;
shieldEffectScale = "0.937 1.125 0.60";
numWeapons = 3;
replaceTime = 90;
max[plasmaammo] = 15;
flaretime = 250;
flarelife = 750;
flarechance = 0.5;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock TracerProjectileData(Shrike_special_gun)
{
doDynamicClientHits = true;
directDamage = 0.175;
directDamageType = $DamageType::Bullet;
explosion = ChaingunExplosion;
splash = ChaingunSplash;
hasDamageRadius = true;
indirectDamage = 0.025;
damageRadius = 0.5;
radiusDamageType = $DamageType::Bullet;
kickBackStrength = 5;
sound = ChaingunProjectile;
dryVelocity = 1750.0;
wetVelocity = 1250.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 6000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 40.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.20;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.5 0.5 0.175";
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock SeekerProjectileData(sidewinder)
{
casingShapeName = "weapon_missile_casement.dts";
projectileShapeName = "weapon_missile_projectile.dts";
hasDamageRadius = true;
indirectDamage = 1.5;
damageRadius = 6.0;
radiusDamageType = $DamageType::MissileTurret;
kickBackStrength = 500;
flareDistance = 200;
flareAngle = 30;
minSeekHeat = 0.0;
explosion = "MissileExplosion";
velInheritFactor = 1.0;
splash = MissileSplash;
baseEmitter = MissileSmokeEmitter;
delayEmitter = MissileFireEmitter;
puffEmitter = MissilePuffEmitter;
lifetimeMS = 15000; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 12.0;
maxVelocity = 225.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 50.0;
acceleration = 100.0;
proximityRadius = 4;
terrainAvoidanceSpeed = 100;
terrainScanAhead = 50;
terrainHeightFail = 50;
terrainAvoidanceRadius = 150;
useFlechette = true;
flechetteDelayMs = 225;
casingDeb = FlechetteDebris;
};
//**************************************************************
// WEAPONS
//**************************************************************
datablock ShapeBaseImageData(ScoutChaingunPairImage)
{
className = WeaponImage;
shapeFile = "turret_tank_barrelchain.dts";
item = Chaingun;
ammo = ChaingunAmmo;
projectile = Shrike_special_gun;
projectileType = TracerProjectile;
mountPoint = 10;
//**original** offset = ".73 0 0";
offset = "1.05 0.8 0.45";
projectileSpread = 1.0 / 1000.0;
usesEnergy = false;
useMountEnergy = true;
// DAVEG -- balancing numbers below!
minEnergy = 1;
fireEnergy = 1;
fireTimeout = 125;
//--------------------------------------
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateAllowImageChange[0] = false;
stateTimeoutValue[0] = 0.05;
stateTransitionOnTimeout[0] = "Ready";
stateTransitionOnNoAmmo[0] = "NoAmmo";
//--------------------------------------
stateName[1] = "Ready";
stateSpinThread[1] = Stop;
stateTransitionOnTriggerDown[1] = "Spinup";
stateTransitionOnNoAmmo[1] = "NoAmmo";
//--------------------------------------
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateSpinThread[2] = Stop;
stateTransitionOnTriggerDown[2] = "DryFire";
//--------------------------------------
stateName[3] = "Spinup";
stateSpinThread[3] = SpinUp;
stateTimeoutValue[3] = 0.01;
stateWaitForTimeout[3] = false;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Spindown";
//--------------------------------------
stateName[4] = "Fire";
stateSpinThread[4] = FullSpeed;
stateRecoil[4] = LightRecoil;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateFire[4] = true;
stateSound[4] = ShrikeBlasterFire;
// IMPORTANT! The stateTimeoutValue below has been replaced by fireTimeOut
// above.
stateTimeoutValue[4] = 0.01;
stateTransitionOnTimeout[4] = "checkState";
//--------------------------------------
stateName[5] = "Spindown";
stateSpinThread[5] = SpinDown;
stateTimeoutValue[5] = 0.01;
stateWaitForTimeout[5] = false;
stateTransitionOnTimeout[5] = "Ready";
stateTransitionOnTriggerDown[5] = "Spinup";
//--------------------------------------
stateName[6] = "EmptySpindown";
// stateSound[6] = ChaingunSpindownSound;
stateSpinThread[6] = SpinDown;
stateTransitionOnAmmo[6] = "Ready";
stateTimeoutValue[6] = 0.01;
stateTransitionOnTimeout[6] = "NoAmmo";
//--------------------------------------
stateName[7] = "DryFire";
stateSound[7] = ShrikeBlasterDryFireSound;
stateTransitionOnTriggerUp[7] = "NoAmmo";
stateTimeoutValue[7] = 0.25;
stateTransitionOnTimeout[7] = "NoAmmo";
stateName[8] = "checkState";
stateTransitionOnTriggerUp[8] = "Spindown";
stateTransitionOnNoAmmo[8] = "EmptySpindown";
stateTimeoutValue[8] = 0.01;
stateTransitionOnTimeout[8] = "ready";
};
datablock ShapeBaseImageData(ScoutChaingunImage) : ScoutChaingunPairImage
{
//**original** offset = "-.73 0 0";
offset = "-1.05 0.8 0.45";
stateScript[3] = "onTriggerDown";
stateScript[5] = "onTriggerUp";
stateScript[6] = "onTriggerUp";
};
datablock ShapeBaseImageData(ShrikeMissileImage)
{
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = MissileLauncher;
ammo = MissileLauncherAmmo;
projectile = sidewinder;
projectileType = SeekerProjectile;
mountPoint = 10;
offset = "0 -0 -0.15"; // L/R - F/B - T/B
usesEnergy = false;
useMountEnergy = true;
minEnergy = 100;
fireEnergy = 100;
fireTimeout = 125;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateSound[3] = MissileFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 5.0;
stateAllowImageChange[4] = false;
stateSound[4] = MissileReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ShrikeBlasterDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock BombProjectileData(shrikeBomb)
{
projectileShapeName = "bomb.dts";
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = true;
indirectDamage = 3.5;
damageRadius = 20;
radiusDamageType = $DamageType::BomberBombs;
kickBackStrength = 2500;
explosion = "VehicleBombExplosion";
velInheritFactor = 1.0;
grenadeElasticity = 0.25;
grenadeFriction = 0.4;
armingDelayMS = 100;
muzzleVelocity = 0.1;
drag = 0.05;
minRotSpeed = "1.0 0.0 0.0";
maxRotSpeed = "2.0 0.0 0.0";
scale = "1.0 1.0 1.0";
sound = BomberBombProjectileSound;
};
datablock ShapeBaseImageData(ShrikeBombImage)
{
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = Mortar;
ammo = MortarAmmo;
projectile = shrikeBomb;
projectileType = BombProjectile;
mountPoint = 10;
offset = "0 -0 -0.15"; // L/R - F/B - T/B
usesEnergy = false;
useMountEnergy = true;
minEnergy = 100;
fireEnergy = 100;
fireTimeout = 125;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
stateSound[3] = BomberBombFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.5;
stateAllowImageChange[4] = false;
stateSound[4] = MissileReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = BomberBombDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock ShapeBaseImageData(ScoutChaingunParam)
{
mountPoint = 2;
shapeFile = "turret_muzzlepoint.dts";
projectile = sidewinder;
projectileType = SeekerProjectile;
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 45;
seekTime = 0.25;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = 50;
useTargetAudio = $Bomber::useTargetAudio;
};
function shrikeMissileImage::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%obj.getMountNodeObject(0).decInventory(%data.ammo, 1);
MissileSet.add(%p);
if(%obj.isdrone == 1)
%p.setObjectTarget(%obj.target);
else{
if (%obj.getControllingClient())
%target = %obj.getLockedTarget();
else
%target = %obj.getTargetObject();
%homein = missileCheckAirTarget(%target);
if(%target && %homein)
%p.setObjectTarget(%target);
else if(%obj.isLocked())
%p.setPositionTarget(%obj.getLockedPosition());
else
%p.setNoTarget();
}
}
function shrikebombImage::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%obj.getMountNodeObject(0).decInventory(%data.ammo, 1);
MissileSet.add(%p);
}
function scoutflyer::onDestroyed(%data, %obj, %prevState)
{
if(%obj.lastPilot.lastVehicle == %obj)
if(%obj.getMountNodeObject(0) == %obj.lastPilot)
schedule(200, %obj.lastPilot, "scKillPilot", %obj.lastPilot, %obj.lastDamagedBy);
Parent::onDestroyed(%data, %obj, %prevState);
}
function scKillPilot(%player, %source)
{
if(isObject(%player) && %player.getState() !$= "Dead")
%player.damage(%source, %player.position, %player.getDatablock().maxDamage, $DamageType::ShotDown);
}
function scoutflyer::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}
function fighterdropflares(%obj,%time,%life,%chance){
if(%obj.flaring != 1)
return;
if(%obj.inv[plasmaAmmo] <= 0){
%obj.flaring = 0;
return;
}
%up = %obj.getUpVector();
%frd = %obj.getForwardVector();
%vec = vectorAdd(%frd,vectorscale(%up,-1));
%vec = vectorNormalize(%vec);
%x = (getRandom() - 0.5) * 2 * 3.1415926 * 0.3;
%y = (getRandom() - 0.5) * 2 * 3.1415926 * 0.3;
%z = (getRandom() - 0.5) * 2 * 3.1415926 * 0.3;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%vector = MatrixMulVector(%mat, %vec);
%obj.decInventory(PlasmaAmmo, 1);
%p = new FlareProjectile()
{
dataBlock = FlareGrenadeProj;
initialDirection = %vector;
initialPosition = getBoxCenter(%obj.getWorldBox());
sourceObject = %obj;
sourceSlot = 0;
};
%rnd = getRandom()*(1/%chance);
if(%rnd >= 1)
FlareSet.add(%p);
MissionCleanup.add(%p);
serverPlay3D(GrenadeThrowSound, getBoxCenter(%obj.getWorldBox()));
%p.schedule(%life, "delete");
schedule(%time,0,"FighterDropFlares",%obj,%time,%life,%chance);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,847 @@
//**************************************************************
// BEOWULF ASSAULT VEHICLE
//**************************************************************
datablock EffectProfile(InboundTorpPingEffect)
{
effectname = "weapons/spinfusor_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(InboundTorpPing)
{
filename = "gui/Objective_Notification.wav";
description = AudioClose3d;
preload = true;
effect = InboundTorpPingEffect;
};
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(Sub) : SubDamageProfile
{
spawnOffset = "0 0 4";
canControl = false;
floatingGravMag = 2.0;
catagory = "Vehicles";
shapeFile = "vehicle_air_bomber.dts";
multipassenger = true;
computeCRC = true;
renderWhenDestroyed = false;
weaponNode = 1;
debrisShapeName = "vehicle_air_bomber.dts";
debris = GShapeDebris;
drag = 0.0;
density = 0.9;
mountPose[0] = sitting;
mountPose[1] = sitting;
numMountPoints = 2;
isProtectedMountPoint[0] = true;
isProtectedMountPoint[1] = true;
cameraMaxDist = 20;
cameraOffset = 3;
cameraLag = 1.5;
explosion = HGVehicleExplosion;
explosionDamage = 1.5;
explosionRadius = 25.0;
maxSteeringAngle = 0.5; // 20 deg.
maxDamage = 5.0;
destroyedLevel = 5.0;
HDAddMassLevel = 3.5;
HDMassImage = BoatHDMassImage;
isShielded = false;
rechargeRate = 1.0;
energyPerDamagePoint = 135;
maxEnergy = 1000;
minJetEnergy = 15;
jetEnergyDrain = 0.0;
// Rigid Body
mass = 1000;
bodyFriction = 1.2;
bodyRestitution = 0.5;
minRollSpeed = 3;
gyroForce = 400;
gyroDamping = 0.3;
stabilizerForce = 20;
minDrag = 10;
softImpactSpeed = 5; // Play SoftImpact Sound
hardImpactSpeed = 10; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 5;
speedDamageScale = 0.005;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 18;
collDamageMultiplier = 0.005;
dragForce = 40 / 20;
vertFactor = 0.0;
floatingThrustFactor = 0.0;
mainThrustForce = 35;
reverseThrustForce = 17;
strafeThrustForce = 0.0;
turboFactor = 1.1;
brakingForce = 10;
brakingActivationSpeed = 10;
stabLenMin = 0.1;
stabLenMax = 1.6;
stabSpringConstant = 0;
stabDampingConstant = 20;
gyroDrag = 20;
normalForce = 20;
restorativeForce = 10;
steeringForce = 10;
rollForce = 10;
pitchForce = 15;
dustEmitter = TankDustEmitter;
triggerDustHeight = 3.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 3.6;
dustTrailFreqMod = 15.0;
jetSound = AssaultVehicleThrustSound;
engineSound = AssaultVehicleEngineSound;
floatSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
wheelImpactSound = WheelImpactSound;
forwardJetEmitter = TankJetEmitter;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 15.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
minMountDist = 10;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = MeHGHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -1.5 3.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 1;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'Darwine IV';
targetTypeTag = 'Submarine';
sensorData = VehiclePulseSensor;
checkRadius = 5.5535;
observeParameters = "1 10 10";
runningLight[0] = TankLight1;
runningLight[1] = TankLight2;
runningLight[2] = TankLight3;
runningLight[3] = TankLight4;
shieldEffectScale = "0.9 1.0 0.6";
showPilotInfo = 1;
replaceTime = 60;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock SeekerProjectileData(Torpedo)
{
casingShapeName = "weapon_missile_casement.dts";
projectileShapeName = "weapon_missile_projectile.dts";
hasDamageRadius = true;
indirectDamage = 2.0;
damageRadius = 25.0;
radiusDamageType = $DamageType::Missile;
kickBackStrength = 1250;
explosion = "MissileExplosion";
splash = MissileSplash;
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
// is cranked up to full so the missile doesn't start
// out behind the player when the player is moving
// very quickly - bramage
baseEmitter = GrenadeBubbleEmitter;
delayEmitter = LoadingE2;
puffEmitter = LoadingE;
bubbleEmitter = GrenadeBubbleEmitter;
bubbleEmitTime = 1.0;
exhaustEmitter = MissileLauncherExhaustEmitter;
exhaustTimeMs = 300;
exhaustNodeName = "muzzlePoint1";
lifetimeMS = 60000; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 5.0;
maxVelocity = 25.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 35.0;
acceleration = 10.0;
proximityRadius = 10;
// terrainAvoidanceSpeed = 0;
// terrainScanAhead = 0;
// terrainHeightFail = 0;
// terrainAvoidanceRadius = 0;
flareDistance = 1;
flareAngle = 1;
minSeekHeat = 0.0;
sound = MissileProjectileSound;
hasLight = true;
lightRadius = 5.0;
lightColor = "0.2 0.05 0";
useFlechette = false;
flechetteDelayMs = 100;
casingDeb = FlechetteDebris;
explodeOnWaterImpact = false;
};
datablock ShapeBaseImageData(SubTorpedoLauncher)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
item = Chaingun;
ammo = ChaingunAmmo;
projectile = Torpedo;
projectileType = SeekerProjectile;
offset = "1.68 -2.75 2.0";
mountPoint = 10;
usesEnergy = true;
useMountEnergy = true;
minEnergy = 1;
fireEnergy = 1;
fireTimeout = 125;
// State transitions
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "WaitFire1";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = BomberTurretActivateSound;
stateName[1] = "WaitFire1";
stateTransitionOnTriggerDown[1] = "Fire1";
stateTransitionOnNoAmmo[1] = "NoAmmo1";
stateName[2] = "Fire1";
stateTransitionOnTimeout[2] = "Reload1";
stateTimeoutValue[2] = 0.75;
stateFire[2] = true;
stateRecoil[2] = LightRecoil;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateSound[2] = BomberTurretFireSound;
stateName[3] = "Reload1";
stateSequence[3] = "Reload";
stateTimeoutValue[3] = 0.75;
stateAllowImageChange[3] = false;
stateTransitionOnTimeout[3] = "WaitFire2";
stateTransitionOnNoAmmo[3] = "NoAmmo1";
stateName[4] = "NoAmmo1";
stateTransitionOnAmmo[4] = "Reload1";
stateSequence[4] = "NoAmmo1";
stateTransitionOnTriggerDown[4] = "DryFire1";
stateName[5] = "DryFire1";
stateSound[5] = BomberTurretDryFireSound;
stateTimeoutValue[5] = 0.75;
stateTransitionOnTimeout[5] = "NoAmmo1";
stateName[6] = "WaitFire2";
stateTransitionOnTriggerDown[6] = "Fire2";
stateTransitionOnNoAmmo[6] = "NoAmmo2";
stateName[7] = "Fire2";
stateTransitionOnTimeout[7] = "Reload2";
stateTimeoutValue[7] = 10.0;
stateScript[7] = "FirePair";
stateName[8] = "Reload2";
stateSequence[8] = "Reload";
stateTimeoutValue[8] = 0.75;
stateAllowImageChange[8] = false;
stateTransitionOnTimeout[8] = "WaitFire1";
stateTransitionOnNoAmmo[8] = "NoAmmo2";
stateName[9] = "NoAmmo2";
stateTransitionOnAmmo[9] = "Reload2";
stateSequence[9] = "NoAmmo2";
stateTransitionOnTriggerDown[9] = "DryFire2";
stateName[10] = "DryFire2";
stateSound[10] = BomberTurretDryFireSound;
stateTimeoutValue[10] = 0.75;
stateTransitionOnTimeout[10] = "NoAmmo2";
};
datablock ShapeBaseImageData(SubTorpedoLauncherPair)
{
className = WeaponImage;
shapeFile = "turret_muzzlepoint.dts";
item = Chaingun;
ammo = ChaingunAmmo;
projectile = Torpedo;
projectileType = SeekerProjectile;
offset = "-1.68 -2.75 2.0";
mountPoint = 10;
usesEnergy = true;
useMountEnergy = true;
minEnergy = 1;
fireEnergy = 1;
fireTimeout = 125;
stateName[0] = "WaitFire";
stateTransitionOnTriggerDown[0] = "Fire";
stateName[1] = "Fire";
stateTransitionOnTimeout[1] = "StopFire";
stateTimeoutValue[1] = 0.13;
stateFire[1] = true;
stateRecoil[1] = LightRecoil;
stateAllowImageChange[1] = false;
stateSequence[1] = "Fire";
stateScript[1] = "onFire";
stateSound[1] = BomberTurretFireSound;
stateName[2] = "StopFire";
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "WaitFire";
stateScript[2] = "stopFire";
};
datablock ShapeBaseImageData(SubAIAiming)
{
shapeFile = "turret_muzzlepoint.dts";
mountPoint = 2;
projectile = Torpedo;
projectileType = SeekerProjectile;
isSeeker = false;
};
datablock TurretData(SubAATurret) : TankDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "turret_base_large.dts";
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'Boat CG';
targetTypeTag = 'Turret';
mass = 1.0; // Not really relevant
maxEnergy = 1000;
maxDamage = sub.maxDamage;
destroyedLevel = sub.destroyedLevel;
repairRate = 0;
// capacitor
maxCapacitorEnergy = 100;
capacitorRechargeRate = 1.5;
thetaMin = 20;
thetaMax = 100;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
numWeapons = 1;
cameraDefaultFov = 90.0;
cameraMinFov = 5.0;
cameraMaxFov = 120.0;
targetNameTag = 'Sub Anti Aircraft';
targetTypeTag = 'Turret';
explosion = HandGrenadeExplosion;
expDmgRadius = 5.0;
expDamage = 0.25;
debrisShapeName = "debris_generic_small.dts";
debris = DeployableDebris;
repairRate = 0.0;
max[plasmaammo] = 4;
};
datablock TurretImageData(Sub50MMTurretBarrel)
{
shapeFile = "turret_tank_barrelchain.dts";
mountPoint = 0;
projectile = APCT_bullet;
projectileType = TracerProjectile;
casing = ShellDebris;
shellExitDir = "1.0 0.3 1.0";
shellExitOffset = "0.15 -0.56 -0.1";
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 6.0 / 1000.0;
useCapacitor = true;
usesEnergy = true;
useMountEnergy = true;
fireEnergy = 1.0;
minEnergy = 5.0;
// Turret parameters
activationMS = 500;
deactivateDelayMS = 550;
thinkTimeMS = 200;
degPerSecTheta = 500;
degPerSecPhi = 500;
attackRadius = 225;
// State transitions
stateName[0] = "Activate";
stateTransitionOnNotLoaded[0] = "Dead";
stateTransitionOnLoaded[0] = "ActivateReady";
stateSound[0] = AssaultTurretActivateSound;
stateName[1] = "ActivateReady";
stateSequence[1] = "Activate";
stateSound[1] = AssaultTurretActivateSound;
stateTimeoutValue[1] = 1;
stateTransitionOnTimeout[1] = "Ready";
stateTransitionOnNotLoaded[1] = "Deactivate";
stateName[2] = "Ready";
stateTransitionOnNotLoaded[2] = "Deactivate";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateName[3] = "Fire";
stateSequence[3] = "Fire";
stateSequenceRandomFlash[3] = true;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSound[3] = AssaultChaingunFireSound;
stateScript[3] = "onFire";
stateTimeoutValue[3] = 0.1;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Reload";
stateTransitionOnNoAmmo[3] = "noAmmo";
stateName[4] = "Reload";
stateSequence[4] = "Reload";
stateTimeoutValue[4] = 0.1;
stateAllowImageChange[4] = false;
stateTransitionOnTimeout[4] = "Ready";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateWaitForTimeout[4] = true;
stateName[5] = "Deactivate";
stateSequence[5] = "Activate";
stateDirection[5] = false;
stateTimeoutValue[5] = 30;
stateTransitionOnTimeout[5] = "ActivateReady";
stateName[6] = "Dead";
stateTransitionOnLoaded[6] = "ActivateReady";
stateTransitionOnTriggerDown[6] = "DryFire";
stateName[7] = "DryFire";
stateSound[7] = AssaultChaingunDryFireSound;
stateTimeoutValue[7] = 1.0;
stateTransitionOnTimeout[7] = "NoAmmo";
stateName[8] = "NoAmmo";
stateTransitionOnAmmo[8] = "Reload";
stateSequence[8] = "NoAmmo";
stateTransitionOnTriggerDown[8] = "DryFire";
stateName[9] = "WetFire";
stateSound[9] = ChaingunDryFireSound;
stateTimeoutValue[9] = 1.0;
stateTransitionOnTimeout[9] = "Ready";
stateName[10] = "CheckWet";
stateTransitionOnWet[10] = "WetFire";
stateTransitionOnNotWet[10] = "Fire";
};
datablock TurretImageData(SubTurretParam)
{
mountPoint = 0;
shapeFile = "turret_muzzlepoint.dts";
offset = "0.0 0.0 3.0";
projectile = APCT_bullet;
projectileType = TracerProjectile;
useCapacitor = false;
usesEnergy = true;
// Turret parameters
activationMS = 500;
deactivateDelayMS = 550;
thinkTimeMS = 200;
degPerSecTheta = 500;
degPerSecPhi = 500;
attackRadius = 225;
};
//******************************************************
// sub main functions
//******************************************************
function sub::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
%obj.mountImage(SubAIAiming, 0);
%obj.mountImage(SubTorpedoLauncher, 2);
%obj.mountImage(SubTorpedoLauncherPair, 3);
%obj.selectedWeapon = 1;
%obj.schedule(5500, "playThread", $ActivateThread, "activate");
%turret = TurretData::create(SubAATurret);
%turret.selectedWeapon = 1;
MissionCleanup.add(%turret);
%turret.team = %obj.teamBought;
%turret.setSelfPowered();
%obj.mountObject(%turret, 2);
%turret.mountImage(Sub50MMTurretBarrel, 2);
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
%obj.turretObject = %turret;
%turret.setAutoFire(false);
%turret.mountImage(SubTurretParam, 0);
%turret.setInventory(PlasmaAmmo, 4);
setTargetSensorGroup(%turret.getTarget(), %turret.team);
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
}
function sub::deleteAllMounted(%data, %obj)
{
%turret = %obj.getMountNodeObject(2);
if (!%turret)
return;
if (%client = %turret.getControllingClient())
{
%client.player.setControlObject(%client.player);
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
}
%turret.schedule(1000, delete);
if(isObject(%obj.beacon))
%obj.beacon.schedule(50, delete);
}
function sub::playerMounted(%data, %obj, %player, %node)
{
Cancel(%player.DrownLoop);
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
if (%node == 0) {
commandToClient(%player.client, 'setHudMode', 'Pilot', "Assault", %node);
}
else if (%node == 1)
{
%turret = %obj.getMountNodeObject(2);
%player.vehicleTurret = %turret;
%player.setTransform("0 0 0 0 0 1 0");
%player.lastWeapon = %player.getMountedImage($WeaponSlot);
%player.unmountImage($WeaponSlot);
if (!%player.client.isAIControlled())
{
%player.setControlObject(%turret);
%player.client.setObjectActiveImage(%turret, 2);
}
%turret.turreteer = %player;
$aWeaponActive = 0;
%obj.getMountNodeObject(10).selectedWeapon = 1;
commandToClient(%player.client, 'setHudMode', 'Pilot', "Assault", %node);
}
else
{
commandToClient(%player.client, 'setHudMode', 'Passenger', "HAPC", %node);
}
if ( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
bottomPrint(%player.client, "ONLY use on water will not move well on land", 5, 2 );
%passString = buildPassengerString(%obj);
for(%i = 0; %i < %data.numMountPoints; %i++)
if (%obj.getMountNodeObject(%i) > 0)
commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString);
}
//******************************************************
// sub fireing functions
//******************************************************
function sub::onTrigger(%data, %obj, %trigger, %state)
{
switch (%trigger)
{
case 0:
%obj.fireTrigger = %state;
if(%state)
%obj.setImageTrigger(2, true);
else
%obj.setImageTrigger(2, false);
case 2:
if(%state)
{
%obj.getDataBlock().playerDismount(%obj);
}
}
}
function SubTorpedoLauncher::firePair(%this, %obj, %slot)
{
%obj.setImageTrigger( 3, true);
}
function SubTorpedoLauncherPair::stopFire(%this, %obj, %slot)
{
%obj.setImageTrigger( 3, false);
}
function SubTorpedoLauncher::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%p.torpseekloop = schedule(5500, 0, "TorpedoSeekLoop", %p);
}
function SubTorpedoLauncherPair::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
%p.torpseekloop = schedule(5500, 0, "TorpedoSeekLoop", %p);
}
datablock StaticShapeData(SubBeacon)
{
shapeFile = "turret_muzzlepoint.dts";
targetNameTag = 'beacon';
isInvincible = true;
dynamicType = $TypeMasks::SensorObjectType;
};
function TorpedoSeekLoop(%p)
{
if(!isObject(%p))
return;
InitContainerRadiusSearch(%p.getPosition(), 100, $TypeMasks::VehicleObjectType);
%searchResult = containersearchnext();
if(%searchResult)
{
%SearchObj = FirstWord(%SearchResult);
if(%searchObj.getDataBlock().getName() $= "Sub" || %searchObj.getDataBlock().getName() $= "Boat")
{
if(%SearchObj.beacon)
{
%SearchObj.beacon.setPosition(%SearchObj.getWorldBoxCenter());
}
else{
%SearchObj.beacon = new BeaconObject() {
dataBlock = "SubBeacon";
beaconType = "vehicle";
position = %SearchObj.getWorldBoxCenter();
};
%SearchObj.beacon.playThread($AmbientThread, "ambient");
%SearchObj.beacon.team = %p.team;
%SearchObj.beacon.sourceObject = %SearchObj;
// give it a team target
%SearchObj.beacon.setTarget(0);
MissionCleanup.add(%SearchObj.beacon);
}
%p.setObjectTarget(%searchObj.beacon);
serverPlay3d("InboundTorpPing",%SearchObj.getWorldBoxCenter());
}
}
%p.torpseekloop = schedule(500, 0, "TorpedoSeekLoop", %p);
}
//******************************************************
// turret functions
//******************************************************
function SubAATurret::onDamage(%data, %obj)
{
%newDamageVal = %obj.getDamageLevel();
if(%obj.lastDamageVal !$= "")
if(isObject(%obj.getObjectMount()) && %obj.lastDamageVal > %newDamageVal)
%obj.getObjectMount().setDamageLevel(%newDamageVal);
%obj.lastDamageVal = %newDamageVal;
}
function SubAATurret::damageObject(%this, %targetObject, %sourceObject, %position, %amount, %damageType ,%vec, %client, %projectile)
{
//If vehicle turret is hit then apply damage to the vehicle
%vehicle = %targetObject.getObjectMount();
if(%vehicle)
%vehicle.getDataBlock().damageObject(%vehicle, %sourceObject, %position, %amount, %damageType, %vec, %client, %projectile);
}
function SubAATurret::onTrigger(%data, %obj, %trigger, %state)
{
%Pos = posFromTransform(%obj.getPosition());
%vector = vectorAdd("0 0 -10", %pos);
%searchresult = containerRayCast(%Pos, %vector, $TypeMasks::WaterObjectType);
if(%searchresult){
switch (%trigger)
{
case 0:
%obj.fireTrigger = %state;
if(%state)
%obj.setImageTrigger(2, true);
else
%obj.setImageTrigger(2, false);
case 2:
if(%state)
{
%obj.getDataBlock().playerDismount(%obj);
}
}
}
if(%trigger == 4){
if(%state){
if (%obj.inv[PlasmaAmmo] > 0){
%mp = %obj.getMuzzlePoint(2);
%p = new (seekerprojectile)()
{
dataBlock = Torpedo;
initialDirection = "0 0 1";
initialPosition = %mp;
sourceObject = %obj;
damageFactor = 1;
sourceSlot = 2;
};
%obj.decInventory(PlasmaAmmo, 1);
schedule(3000, 0, "startCGM", %p);
}
}
}
}
function SubAATurret::playerDismount(%data, %obj)
{
//Passenger Exiting
%obj.fireTrigger = 0;
%obj.setImageTrigger(2, false);
%client = %obj.getControllingClient();
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
%client.player.mountVehicle = false;
setTargetSensorGroup(%obj.getTarget(), 0);
setTargetNeverVisMask(%obj.getTarget(), 0xffffffff);
}
function Sub::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(1.0);
case 1:
//Ocean Water
%obj.setHeat(1.0);
case 2:
//River Water
%obj.setHeat(1.0);
case 3:
//Stagnant Water
%obj.setHeat(1.0);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}
function Sub::onLeaveLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(1.0);
case 1:
//Ocean Water
%obj.setHeat(1.0);
case 2:
//River Water
%obj.setHeat(1.0);
case 3:
//Stagnant Water
%obj.setHeat(1.0);
case 4:
//Lava
case 5:
//Hot Lava
case 6:
//Crusty Lava
case 7:
//Quick Sand
}
}

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,149 @@
//**************************************************************
// SUPER WILDCAT GRAV CYCLE
//**************************************************************
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(SuperScoutVehicle) : WildcatDamageProfile
{
spawnOffset = "0 0 1";
canControl = true;
floatingGravMag = 3.5;
catagory = "Vehicles";
shapeFile = "vehicle_grav_scout.dts";
computeCRC = true;
debrisShapeName = "vehicle_grav_scout_debris.dts";
debris = ShapeDebris;
renderWhenDestroyed = false;
drag = 0.0;
density = 0.9;
mountPose[0] = scoutRoot;
cameraMaxDist = 5.0;
cameraOffset = 0.7;
cameraLag = 0.5;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
explosion = VehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
lightOnly = 1;
maxDamage = 1.60;
destroyedLevel = 1.60;
HDAddMassLevel = 1.3;
HDMassImage = WCHDMassImage;
isShielded = true;
rechargeRate = 0.9;
energyPerDamagePoint = 1;
maxEnergy = 450;
minJetEnergy = 1;
jetEnergyDrain = 0.1;
// Rigid Body
mass = 400;
bodyFriction = 0.1;
bodyRestitution = 0.5;
softImpactSpeed = 120; // Play SoftImpact Sound
hardImpactSpeed = 128; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 129;
speedDamageScale = 0.010;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 123;
collDamageMultiplier = 0.030;
dragForce = 45 / 45.0;
vertFactor = 0.0;
floatingThrustFactor = 0.35;
mainThrustForce = 90;
reverseThrustForce = 90;
strafeThrustForce = 90;
turboFactor = 3.5;
brakingForce = 90;
brakingActivationSpeed = 4;
stabLenMin = 2.25;
stabLenMax = 3.75;
stabSpringConstant = 30;
stabDampingConstant = 16;
gyroDrag = 16;
normalForce = 30;
restorativeForce = 20;
steeringForce = 30;
rollForce = 15;
pitchForce = 7;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 2.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 30.6;
dustTrailFreqMod = 15.0;
jetSound = ScoutSqueelSound;
engineSound = ScoutEngineSound;
floatSound = ScoutThrustSound;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterSoftSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeSoftSplashSound;
minMountDist = 4;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = SmallHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -1.5 0.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 1;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
forwardJetEmitter = WildcatJetEmitter;
cmdCategory = Tactical;
cmdIcon = CMDHoverScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_landscout_grey";
targetNameTag = 'Super WildCat';
targetTypeTag = 'Grav Cycle';
sensorData = VehiclePulseSensor;
checkRadius = 1.7785;
observeParameters = "1 10 10";
runningLight[0] = WildcatLight1;
runningLight[1] = WildcatLight2;
runningLight[2] = WildcatLight3;
shieldEffectScale = "0.9375 1.125 0.6";
};

View file

@ -0,0 +1,928 @@
//**************************************************************
// BEOWULF ASSAULT VEHICLE
//**************************************************************
datablock AudioProfile(MobileBaseStationDeploySound)
{
filename = "fx/vehicles/MPB_deploy_station.wav";
description = AudioClose3d;
preload = true;
};
datablock ParticleData(ACCGSmoke)
{
dragCoeffiecient = 0.05;
gravityCoefficient = 0.1;
inheritedVelFactor = 0.025;
lifetimeMS = 1250;
lifetimeVarianceMS = 150;
textureName = "particleTest";
useInvAlpha = true;
spinRandomMin = -25.0;
spinRandomMax = 25.0;
textureName = "special/Smoke/bigSmoke";
colors[0] = "0.3 0.3 0.3 1.0";
colors[1] = "0.4 0.4 0.4 0.5";
colors[2] = "0.5 0.5 0.5 0.0";
sizes[0] = 1.0;
sizes[1] = 1.5;
sizes[2] = 2.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ACCGSmokeEmitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionOffset = 0.1;
ejectionVelocity = 4.0;
velocityVariance = 3.5;
thetaMin = 85.0;
thetaMax = 90.0;
lifetimeMS = 100;
particles = "ACCGSmoke";
};
datablock ParticleEmitterData(ACCGSmokeEmitter2)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionOffset = 0.1;
ejectionVelocity = 5.5;
velocityVariance = 5.5;
thetaMin = 0.0;
thetaMax = 15.0;
lifetimeMS = 150;
particles = "ACCGSmoke";
};
datablock ExplosionData(ACCGSubExplosion)
{
explosionShape = "effect_plasma_explosion.dts";
faceViewer = true;
delayMS = 0;
offset = 0.0;
playSpeed = 2.0;
sizes[0] = "0.1 0.1 0.1";
sizes[1] = "0.1 0.1 0.1";
times[0] = 0.0;
times[1] = 1.0;
};
datablock ExplosionData(ACCGExplosion)
{
soundProfile = plasmaExpSound;
subExplosion[0] = ACCGSubExplosion;
emitter[0] = ACCGSmokeEmitter;
emitter[1] = ACCGSmokeEmitter2;
shakeCamera = false;
};
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(AssaultVehicleEngineEffect)
{
effectname = "vehicles/tank_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultVehicleThrustEffect)
{
effectname = "vehicles/tank_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultTurretActivateEffect)
{
effectname = "vehicles/tank_activate";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultMortarDryFireEffect)
{
effectname = "weapons/mortar_dryfire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultMortarFireEffect)
{
effectname = "vehicles/tank_mortar_fire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultMortarReloadEffect)
{
effectname = "weapons/mortar_reload";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultChaingunFireEffect)
{
effectname = "weapons/chaingun_fire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(AssaultVehicleSkid)
{
filename = "fx/vehicles/tank_skid.wav";
description = ClosestLooping3d;
preload = true;
};
datablock AudioProfile(AssaultVehicleEngineSound)
{
filename = "fx/vehicles/tank_engine.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = AssaultVehicleEngineEffect;
};
datablock AudioProfile(AssaultVehicleThrustSound)
{
filename = "fx/vehicles/tank_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = AssaultVehicleThrustEffect;
};
datablock AudioProfile(AssaultChaingunFireSound)
{
filename = "fx/vehicles/tank_chaingun.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = AssaultChaingunFireEffect;
};
datablock AudioProfile(AssaultChaingunReloadSound)
{
filename = "fx/weapons/chaingun_dryfire.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(TankChaingunProjectile)
{
filename = "fx/weapons/chaingun_projectile.wav";
description = ProjectileLooping3d;
preload = true;
};
datablock AudioProfile(AssaultTurretActivateSound)
{
filename = "fx/vehicles/tank_activate.wav";
description = AudioClose3d;
preload = true;
effect = AssaultTurretActivateEffect;
};
datablock AudioProfile(AssaultChaingunDryFireSound)
{
filename = "fx/weapons/chaingun_dryfire.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(AssaultChaingunIdleSound)
{
filename = "fx/misc/diagnostic_on.wav";
description = ClosestLooping3d;
preload = true;
};
datablock AudioProfile(AssaultMortarDryFireSound)
{
filename = "fx/weapons/mortar_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = AssaultMortarDryFireEffect;
};
datablock AudioProfile(AssaultMortarFireSound)
{
filename = "fx/vehicles/tank_mortar_fire.wav";
description = AudioClose3d;
preload = true;
effect = AssaultMortarFireEffect;
};
datablock AudioProfile(AssaultMortarReloadSound)
{
filename = "fx/weapons/mortar_reload.wav";
description = AudioClose3d;
preload = true;
effect = AssaultMortarReloadEffect;
};
datablock AudioProfile(AssaultMortarIdleSound)
{
filename = "fx/misc/diagnostic_on.wav";
description = ClosestLooping3d;
preload = true;
};
//**************************************************************
// LIGHTS
//**************************************************************
datablock RunningLightData(TankLight1)
{
radius = 1.5;
color = "1.0 1.0 1.0 0.2";
nodeName = "Headlight_node01";
direction = "0.0 1.0 0.0";
texture = "special/headlight4";
};
datablock RunningLightData(TankLight2)
{
radius = 1.5;
color = "1.0 1.0 1.0 0.2";
nodeName = "Headlight_node02";
direction = "0.0 1.0 0.0";
texture = "special/headlight4";
};
datablock RunningLightData(TankLight3)
{
radius = 1.5;
color = "1.0 1.0 1.0 0.2";
nodeName = "Headlight_node03";
direction = "0.0 1.0 0.0";
texture = "special/headlight4";
};
datablock RunningLightData(TankLight4)
{
radius = 1.5;
color = "1.0 1.0 1.0 0.2";
nodeName = "Headlight_node04";
direction = "0.0 1.0 0.0";
texture = "special/headlight4";
};
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(AssaultVehicle) : TankDamageProfile
{
spawnOffset = "0 0 4";
canControl = false;
floatingGravMag = 4.5;
catagory = "Vehicles";
shapeFile = "vehicle_grav_tank.dts";
multipassenger = true;
computeCRC = true;
renderWhenDestroyed = false;
weaponNode = 1;
debrisShapeName = "vehicle_grav_tank.dts";
debris = GShapeDebris;
drag = 0.0;
density = 0.9;
mountPose[0] = sitting;
mountPose[1] = sitting;
numMountPoints = 2;
isProtectedMountPoint[0] = true;
isProtectedMountPoint[1] = true;
cameraMaxDist = 20;
cameraOffset = 3;
cameraLag = 1.5;
explosion = HGVehicleExplosion;
explosionDamage = 2.0;
explosionRadius = 30.0;
maxSteeringAngle = 0.5; // 20 deg.
maxDamage = 3.0;
destroyedLevel = 3.0;
HDAddMassLevel = 2.1;
HDMassImage = TankHDMassImage;
isShielded = false;
rechargeRate = 1.0;
energyPerDamagePoint = 135;
maxEnergy = 400;
minJetEnergy = 15;
jetEnergyDrain = 2.0;
// Rigid Body
mass = 1500;
bodyFriction = 0.8;
bodyRestitution = 0.5;
minRollSpeed = 3;
gyroForce = 400;
gyroDamping = 0.3;
stabilizerForce = 20;
minDrag = 10;
softImpactSpeed = 15; // Play SoftImpact Sound
hardImpactSpeed = 18; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 30;
speedDamageScale = 0.020;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 18;
collDamageMultiplier = 0.045;
dragForce = 40 / 20;
vertFactor = 0.0;
floatingThrustFactor = 0.15;
mainThrustForce = 80;
reverseThrustForce = 35;
strafeThrustForce = 0;
turboFactor = 1.5;
brakingForce = 20;
brakingActivationSpeed = 4;
stabLenMin = 3.25;
stabLenMax = 4;
stabSpringConstant = 50;
stabDampingConstant = 20;
gyroDrag = 20;
normalForce = 20;
restorativeForce = 10;
steeringForce = 30;
rollForce = 0;
pitchForce = 3;
dustEmitter = TankDustEmitter;
triggerDustHeight = 3.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 3.6;
dustTrailFreqMod = 15.0;
jetSound = AssaultVehicleThrustSound;
engineSound = AssaultVehicleEngineSound;
floatSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
wheelImpactSound = WheelImpactSound;
forwardJetEmitter = TankJetEmitter;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 15.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
minMountDist = 7;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = MeHGHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -1.5 3.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 1;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'M4A1 Wolf';
targetTypeTag = 'Light Tank';
sensorData = combatSensor;
sensorRadius = combatSensor.detectRadius;
sensorColor = "9 9 255";
checkRadius = 5.5535;
observeParameters = "1 10 10";
runningLight[0] = TankLight1;
runningLight[1] = TankLight2;
runningLight[2] = TankLight3;
runningLight[3] = TankLight4;
shieldEffectScale = "0.9 1.0 0.6";
showPilotInfo = 1;
replaceTime = 45;
};
//**************************************************************
// WEAPONS
//**************************************************************
//-------------------------------------
// ASSAULT CHAINGUN (projectile)
//-------------------------------------
datablock TracerProjectileData(AssaultChaingunBullet)
{
doDynamicClientHits = true;
projectileShapeName = "";
directDamage = 0.4;
directDamageType = $DamageType::TankChaingunH;
hasDamageRadius = false;
splash = ChaingunSplash;
kickbackstrength = 0.0;
sound = TankChaingunProjectile;
dryVelocity = 1250.0;
wetVelocity = 500.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 15.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.10;
crossSize = 0.25;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = MG42Decal1;
decalData[1] = MG42Decal2;
decalData[2] = MG42Decal3;
decalData[3] = MG42Decal4;
decalData[4] = MG42Decal5;
decalData[5] = MG42Decal6;
activateDelayMS = 100;
explosion = ACCGExplosion;
};
//-------------------------------------
// ASSAULT CHAINGUN CHARACTERISTICS
//-------------------------------------
datablock TurretData(AssaultPlasmaTurret) : TurretDamageProfile
{
className = VehicleTurret;
catagory = "Turrets";
shapeFile = "Turret_tank_base.dts";
//turret_assaulttank_plasma.dts
preload = true;
canControl = false;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'light';
targetTypeTag = 'Assault Tank turret';
mass = 1.0; // Not really relevant
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 30;
seekTime = $Bomber::SeekTime;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = $Bomber::minTargetingDistance;
useTargetAudio = $Bomber::useTargetAudio;
maxEnergy = 1;
maxDamage = AssaultVehicle.maxDamage;
destroyedLevel = AssaultVehicle.destroyedLevel;
repairRate = 0;
// capacitor
maxCapacitorEnergy = 200;
capacitorRechargeRate = 0.45;
thetaMin = 0;
thetaMax = 100;
inheritEnergyFromMount = true;
firstPersonOnly = true;
useEyePoint = true;
numWeapons = 2;
cameraDefaultFov = 90.0;
cameraMinFov = 5.0;
cameraMaxFov = 120.0;
targetNameTag = 'light Tank';
targetTypeTag = 'Turret';
};
datablock TurretImageData(AssaultPlasmaTurretBarrel)
{
shapeFile = "turret_tank_barrelchain.dts";
mountPoint = 1;
projectile = AssaultChaingunBullet;
projectileType = TracerProjectile;
casing = ShellDebris;
shellExitDir = "1.0 0.3 1.0";
shellExitOffset = "0.15 -0.56 -0.1";
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 1.5 / 1000.0;
useCapacitor = true;
usesEnergy = true;
useMountEnergy = true;
fireEnergy = 0.01;
minEnergy = 5.0;
// Turret parameters
activationMS = 4000;
deactivateDelayMS = 500;
thinkTimeMS = 200;
degPerSecTheta = 360;
degPerSecPhi = 360;
attackRadius = 75;
// State transitions
stateName[0] = "Activate";
stateTransitionOnNotLoaded[0] = "Dead";
stateTransitionOnLoaded[0] = "ActivateReady";
stateSound[0] = AssaultTurretActivateSound;
stateName[1] = "ActivateReady";
stateSequence[1] = "Activate";
stateSound[1] = AssaultTurretActivateSound;
stateTimeoutValue[1] = 1;
stateTransitionOnTimeout[1] = "Ready";
stateTransitionOnNotLoaded[1] = "Deactivate";
stateName[2] = "Ready";
stateTransitionOnNotLoaded[2] = "Deactivate";
stateTransitionOnTriggerDown[2] = "Fire";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateName[3] = "Fire";
stateSequence[3] = "Fire";
stateSequenceRandomFlash[3] = true;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSound[3] = AssaultChaingunFireSound;
stateScript[3] = "onFire";
stateTimeoutValue[3] = 0.14;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Reload";
stateTransitionOnNoAmmo[3] = "noAmmo";
stateName[4] = "Reload";
stateSequence[4] = "Reload";
stateTimeoutValue[4] = 0.2;
stateAllowImageChange[4] = false;
stateTransitionOnTimeout[4] = "Ready";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateWaitForTimeout[4] = true;
stateName[5] = "Deactivate";
stateSequence[5] = "Activate";
stateDirection[5] = false;
stateTimeoutValue[5] = 30;
stateTransitionOnTimeout[5] = "ActivateReady";
stateName[6] = "Dead";
stateTransitionOnLoaded[6] = "ActivateReady";
stateTransitionOnTriggerDown[6] = "DryFire";
stateName[7] = "DryFire";
stateSound[7] = AssaultChaingunDryFireSound;
stateTimeoutValue[7] = 0.5;
stateTransitionOnTimeout[7] = "NoAmmo";
stateName[8] = "NoAmmo";
stateTransitionOnAmmo[8] = "Reload";
stateSequence[8] = "NoAmmo";
stateTransitionOnTriggerDown[8] = "DryFire";
};
//-------------------------------------
// ASSAULT MORTAR (projectile)
//-------------------------------------
datablock ItemData(AssaultMortarAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "repair_kit.dts";
mass = 1;
elasticity = 0.5;
friction = 0.6;
pickupRadius = 1;
computeCRC = true;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock SeekerProjectileData(TankRocket)
{
casingShapeName = "weapon_missile_casement.dts";
projectileShapeName = "weapon_missile_projectile.dts";
hasDamageRadius = true;
indirectDamage = 0.75;
damageRadius = 10.0;
radiusDamageType = $DamageType::MissileTurret;
kickBackStrength = 500;
flareDistance = 200;
flareAngle = 30;
minSeekHeat = 0.6;
explosion = "MissileExplosion";
velInheritFactor = 1.0;
splash = MissileSplash;
baseEmitter = MissileSmokeEmitter;
delayEmitter = MissileFireEmitter;
puffEmitter = MissilePuffEmitter;
lifetimeMS = 20000; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 40.0;
maxVelocity = 300.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 60.0;
acceleration = 100.0;
proximityRadius = 7;
terrainAvoidanceSpeed = 40;
terrainScanAhead = 50;
terrainHeightFail = 5;
terrainAvoidanceRadius = 10;
useFlechette = true;
flechetteDelayMs = 225;
casingDeb = FlechetteDebris;
};
//-------------------------------------
// ASSAULT MORTAR CHARACTERISTICS
//-------------------------------------
datablock TurretImageData(AssaultMortarTurretBarrel)
{
shapeFile = "stackable2m.dts";
rotation = "-1 0 0 90";
offset = "0 0.7 0";
mountPoint = 0;
projectile = TankRocket;
projectileType = SeekerProjectile;
usesEnergy = true;
useMountEnergy = true;
fireEnergy = 50.00;
minEnergy = 50.00;
useCapacitor = true;
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 30;
seekTime = $Bomber::SeekTime;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = $Bomber::minTargetingDistance;
useTargetAudio = $Bomber::useTargetAudio;
// Turret parameters
activationMS = 4000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 360;
degPerSecPhi = 360;
attackRadius = 75;
// State transitions
stateName[0] = "Activate";
stateTransitionOnNotLoaded[0] = "Dead";
stateTransitionOnLoaded[0] = "ActivateReady";
stateName[1] = "ActivateReady";
stateSequence[1] = "Activate";
stateSound[1] = AssaultTurretActivateSound;
stateTimeoutValue[1] = 1.0;
stateTransitionOnTimeout[1] = "Ready";
stateTransitionOnNotLoaded[1] = "Deactivate";
stateName[2] = "Ready";
stateTransitionOnNotLoaded[2] = "Deactivate";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateSequence[3] = "Fire";
stateTransitionOnTimeout[3] = "NextFire";
stateTimeoutValue[3] = 0.5;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSound[3] = MissileFireSound;
stateScript[3] = "onFire";
stateName[4] = "NextFire";
stateTransitionOnNotLoaded[4] = "Deactivate";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "Fire2";
stateSequence[5] = "Fire";
stateTransitionOnTimeout[5] = "NextFire2";
stateTimeoutValue[5] = 0.5;
stateFire[5] = true;
stateRecoil[5] = LightRecoil;
stateAllowImageChange[5] = false;
stateSound[5] = MissileFireSound;
stateScript[5] = "onFire";
stateName[6] = "NextFire2";
stateTransitionOnNotLoaded[6] = "Deactivate";
stateTransitionOnNoAmmo[6] = "NoAmmo";
stateTransitionOnTriggerDown[6] = "Fire";
stateName[7] = "Fire3";
stateSequence[7] = "Fire";
stateTransitionOnTimeout[7] = "NextFire3";
stateTimeoutValue[7] = 0.5;
stateFire[7] = true;
stateRecoil[7] = LightRecoil;
stateAllowImageChange[7] = false;
stateSound[7] = MissileFireSound;
stateScript[7] = "onFire";
stateName[8] = "NextFire3";
stateTransitionOnNotLoaded[8] = "Deactivate";
stateTransitionOnNoAmmo[8] = "NoAmmo";
stateTransitionOnTriggerDown[8] = "Fire";
stateName[9] = "Fire4";
stateSequence[9] = "Fire";
stateTransitionOnTimeout[9] = "Reload";
stateTimeoutValue[9] = 0.5;
stateFire[9] = true;
stateRecoil[9] = LightRecoil;
stateAllowImageChange[9] = false;
stateSound[9] = MissileFireSound;
stateScript[9] = "onFire";
stateName[10] = "Reload";
stateSequence[10] = "Reload";
stateTimeoutValue[10] = 8;
stateAllowImageChange[10] = false;
stateTransitionOnTimeout[10] = "ReloadSound";
stateWaitForTimeout[10] = true;
stateName[11] = "ReloadSound";
stateTimeoutValue[11] = 2;
stateAllowImageChange[11] = false;
stateTransitionOnTimeout[11] = "Ready";
stateSound[11] = MobileBaseStationDeploySound;
stateWaitForTimeout[11] = true;
stateName[12] = "Deactivate";
stateDirection[12] = false;
stateSequence[12] = "Activate";
stateTimeoutValue[12] = 1.0;
stateTransitionOnLoaded[12] = "ActivateReady";
stateTransitionOnTimeout[12] = "Dead";
stateName[13] = "Dead";
stateTransitionOnLoaded[13] = "ActivateReady";
stateTransitionOnTriggerDown[13] = "DryFire";
stateName[14] = "DryFire";
stateSound[14] = AssaultMortarDryFireSound;
stateTimeoutValue[14] = 1.0;
stateTransitionOnTimeout[14] = "NoAmmo";
stateName[15] = "NoAmmo";
stateSequence[15] = "NoAmmo";
stateTransitionOnAmmo[15] = "Reload";
stateTransitionOnTriggerDown[15] = "DryFire";
};
datablock TurretImageData(AssaultTurretParam)
{
mountPoint = 2;
shapeFile = "turret_muzzlepoint.dts";
projectile = AssaultChaingunBullet;
projectileType = TracerProjectile;
useCapacitor = true;
usesEnergy = true;
// Turret parameters
activationMS = 1000;
deactivateDelayMS = 1500;
thinkTimeMS = 200;
degPerSecTheta = 500;
degPerSecPhi = 500;
isSeeker = true;
seekRadius = $Bomber::SeekRadius;
maxSeekAngle = 30;
seekTime = $Bomber::SeekTime;
minSeekHeat = $Bomber::minSeekHeat;
minTargetingDistance = $Bomber::minTargetingDistance;
useTargetAudio = $Bomber::useTargetAudio;
attackRadius = 500;
};
function AssaultMortarTurretBarrel::onFire(%data,%obj,%slot)
{
%p = Parent::onFire(%data, %obj, %slot);
MissileSet.add(%p);
if (%obj.getControllingClient())
%target = %obj.getLockedTarget();
else
%target = %obj.getTargetObject();
%homein = missileCheckAirTarget(%target);
if(%target && %homein)
%p.setObjectTarget(%target);
else if(%obj.isLocked())
%p.setPositionTarget(%obj.getLockedPosition());
else
%p.setNoTarget();
}
function AssaultVehicle::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 1:
//Ocean Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 2:
//River Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 3:
//Stagnant Water
%obj.setHeat(0.0);
%obj.liquidDamage(%data, 0.1, $DamageType::Crash);
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}

View file

@ -0,0 +1,250 @@
//**************************************************************
// BEOWULF ASSAULT VEHICLE
//**************************************************************
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock HoverVehicleData(PersonelBoat) : TankDamageProfile
{
spawnOffset = "0 0 4";
canControl = false;
floatingGravMag = 4.0;
catagory = "Vehicles";
shapeFile = "vehicle_air_scout.dts";
multipassenger = true;
computeCRC = true;
renderWhenDestroyed = false;
weaponNode = 1;
debrisShapeName = "vehicle_air_scout.dts";
debris = GShapeDebris;
drag = 0.0;
density = 0.9;
mountPose[0] = sitting;
numMountPoints = 6;
isProtectedMountPoint[0] = true;
isProtectedMountPoint[1] = true;
isProtectedMountPoint[2] = true;
isProtectedMountPoint[3] = true;
isProtectedMountPoint[4] = true;
isProtectedMountPoint[5] = true;
cameraMaxDist = 20;
cameraOffset = 3;
cameraLag = 1.5;
explosion = HGVehicleExplosion;
explosionDamage = 3.0;
explosionRadius = 25.0;
maxSteeringAngle = 0.5; // 20 deg.
maxDamage = 4.0;
destroyedLevel = 4.0;
HDAddMassLevel = 3.2;
HDMassImage = BoatHDMassImage;
isShielded = false;
rechargeRate = 1.0;
energyPerDamagePoint = 135;
maxEnergy = 1000;
minJetEnergy = 15;
jetEnergyDrain = 0.0;
// Rigid Body
mass = 950;
bodyFriction = 1.0;
bodyRestitution = 0.5;
minRollSpeed = 3;
gyroForce = 400;
gyroDamping = 0.3;
stabilizerForce = 20;
minDrag = 10;
softImpactSpeed = 5; // Play SoftImpact Sound
hardImpactSpeed = 10; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 5;
speedDamageScale = 0.005;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 18;
collDamageMultiplier = 0.005;
dragForce = 40 / 20;
vertFactor = 0.0;
floatingThrustFactor = 0.0;
mainThrustForce = 75;
reverseThrustForce = 30;
strafeThrustForce = 0.0;
turboFactor = 1.0;
brakingForce = 15;
brakingActivationSpeed = 4;
stabLenMin = 0.1;
stabLenMax = 1.6;
stabSpringConstant = 45;
stabDampingConstant = 20;
gyroDrag = 20;
normalForce = 20;
restorativeForce = 10;
steeringForce = 12;
rollForce = 4;
pitchForce = 0;
dustEmitter = TankDustEmitter;
triggerDustHeight = 3.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 3.6;
dustTrailFreqMod = 15.0;
jetSound = AssaultVehicleThrustSound;
engineSound = AssaultVehicleEngineSound;
floatSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
wheelImpactSound = WheelImpactSound;
forwardJetEmitter = TankJetEmitter;
//
softSplashSoundVelocity = 5.0;
mediumSplashSoundVelocity = 10.0;
hardSplashSoundVelocity = 15.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterMediumSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterMediumSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeMediumSplashSound;
minMountDist = 10;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = MeHGHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -1.5 3.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 1;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
cmdCategory = "Tactical";
cmdIcon = CMDGroundTankIcon;
cmdMiniIconName = "commander/MiniIcons/com_tank_grey";
targetNameTag = 'Grandens Transport';
targetTypeTag = 'Boat';
sensorData = PlayerSensor;
checkRadius = 5.5535;
observeParameters = "1 10 10";
runningLight[0] = TankLight1;
runningLight[1] = TankLight2;
runningLight[2] = TankLight3;
runningLight[3] = TankLight4;
shieldEffectScale = "0.9 1.0 0.6";
showPilotInfo = 1;
replaceTime = 20;
};
function PersonelBoat::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.schedule(6000, "playThread", $ActivateThread, "activate");
}
function PersonelBoat::playerMounted(%data, %obj, %player, %node)
{
if (%obj.clientControl)
serverCmdResetControlObject(%obj.clientControl);
if (%node == 0) {
commandToClient(%player.client, 'setHudMode', 'Pilot', "HAPC", %node);
}
else
{
// all others
commandToClient(%player.client, 'setHudMode', 'Passenger', "HAPC", %node);
}
if ( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
bottomPrint(%player.client, "ONLY use on water will not move well on land", 5, 2 );
%passString = buildPassengerString(%obj);
for(%i = 0; %i < %data.numMountPoints; %i++)
if (%obj.getMountNodeObject(%i) > 0)
commandToClient(%obj.getMountNodeObject(%i).client, 'checkPassengers', %passString);
}
function PersonelBoat::onEnterLiquid(%data, %obj, %coverage, %type)
{
switch(%type)
{
case 0:
//Water
case 1:
//Ocean Water
case 2:
//River Water
case 3:
//Stagnant Water
case 4:
//Lava
%obj.liquidDamage(%data, $VehicleDamageLava, $DamageType::Lava);
case 5:
//Hot Lava
%obj.liquidDamage(%data, $VehicleDamageHotLava, $DamageType::Lava);
case 6:
//Crusty Lava
%obj.liquidDamage(%data, $VehicleDamageCrustyLava, $DamageType::Lava);
case 7:
//Quick Sand
}
}
function PersonelBoat::onLeaveLiquid(%data, %obj, %type)
{
switch(%type)
{
case 0:
//Water
case 1:
//Ocean Water
case 2:
//River Water
case 3:
//Stagnant Water
case 4:
//Lava
case 5:
//Hot Lava
case 6:
//Crusty Lava
case 7:
//Quick Sand
}
if (%obj.lDamageSchedule !$= "")
{
cancel(%obj.lDamageSchedule);
%obj.lDamageSchedule = "";
}
}

View file

@ -0,0 +1,411 @@
//**************************************************************
// VEHICLE CHARACTERISTICS
//**************************************************************
datablock EffectProfile(ScoutEngineEffect)
{
effectname = "vehicles/outrider_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(ScoutThrustEffect)
{
effectname = "vehicles/outrider_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(ScoutSqueelSound)
{
filename = "fx/vehicles/outrider_skid.wav";
description = ClosestLooping3d;
preload = true;
};
datablock AudioProfile(ScoutEngineSound)
{
filename = "fx/vehicles/outrider_engine.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = ScoutEngineEffect;
};
datablock AudioProfile(ScoutThrustSound)
{
filename = "fx/vehicles/outrider_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = ScoutThrustEffect;
};
datablock AudioProfile(ScoutturretFireSound)
{
filename = "fx/vehicles/tank_chaingun.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = AssaultChaingunFireEffect;
};
datablock HoverVehicleData(scoutVehicle) : WildcatDamageProfile
{
spawnOffset = "0 0 1";
floatingGravMag = 3.5;
catagory = "Vehicles";
shapeFile = "vehicle_grav_scout.dts";
computeCRC = true;
debrisShapeName = "vehicle_grav_scout_debris.dts";
debris = ShapeDebris;
renderWhenDestroyed = false;
drag = 0.0;
density = 0.9;
mountPose[0] = scoutRoot;
cameraMaxDist = 5.0;
cameraOffset = 0.7;
cameraLag = 0.5;
numMountPoints = 1;
isProtectedMountPoint[0] = true;
explosion = VehicleExplosion;
explosionDamage = 0.5;
explosionRadius = 5.0;
lightOnly = 1;
maxDamage = 0.80;
destroyedLevel = 0.80;
isShielded = false;
rechargeRate = 0.7;
energyPerDamagePoint = 50;
maxEnergy = 150;
minJetEnergy = 15;
jetEnergyDrain = 1.5;
// Rigid Body
mass = 400;
bodyFriction = 0.1;
bodyRestitution = 0.5;
softImpactSpeed = 20; // Play SoftImpact Sound
hardImpactSpeed = 28; // Play HardImpact Sound
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 29;
speedDamageScale = 0.010;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23;
collDamageMultiplier = 0.030;
dragForce = 28 / 45.0;
vertFactor = 0.0;
floatingThrustFactor = 0.35;
mainThrustForce = 25;
reverseThrustForce = 15;
strafeThrustForce = 15;
turboFactor = 1.5;
brakingForce = 25;
brakingActivationSpeed = 4;
stabLenMin = 2.25;
stabLenMax = 3.75;
stabSpringConstant = 30;
stabDampingConstant = 16;
gyroDrag = 16;
normalForce = 30;
restorativeForce = 20;
steeringForce = 25;
rollForce = 15;
pitchForce = 7;
dustEmitter = VehicleLiftoffDustEmitter;
triggerDustHeight = 2.5;
dustHeight = 1.0;
dustTrailEmitter = TireEmitter;
dustTrailOffset = "0.0 -1.0 0.5";
triggerTrailHeight = 3.6;
dustTrailFreqMod = 15.0;
jetSound = ScoutSqueelSound;
engineSound = ScoutEngineSound;
floatSound = ScoutThrustSound;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;
mediumSplashSoundVelocity = 20.0;
hardSplashSoundVelocity = 30.0;
exitSplashSoundVelocity = 10.0;
exitingWater = VehicleExitWaterSoftSound;
impactWaterEasy = VehicleImpactWaterSoftSound;
impactWaterMedium = VehicleImpactWaterSoftSound;
impactWaterHard = VehicleImpactWaterMediumSound;
waterWakeSound = VehicleWakeSoftSplashSound;
minMountDist = 4;
damageEmitter[0] = SmallLightDamageSmoke;
damageEmitter[1] = SmallHeavyDamageSmoke;
damageEmitter[2] = DamageBubbles;
damageEmitterOffset[0] = "0.0 -1.5 0.5 ";
damageLevelTolerance[0] = 0.3;
damageLevelTolerance[1] = 0.7;
numDmgEmitterAreas = 1;
splashEmitter[0] = VehicleFoamDropletsEmitter;
splashEmitter[1] = VehicleFoamEmitter;
shieldImpact = VehicleShieldImpact;
forwardJetEmitter = WildcatJetEmitter;
cmdCategory = Tactical;
cmdIcon = CMDHoverScoutIcon;
cmdMiniIconName = "commander/MiniIcons/com_landscout_grey";
targetNameTag = 'MK II WildCat';
targetTypeTag = 'Grav Cycle';
sensorData = VehiclePulseSensor;
checkRadius = 1.7785;
observeParameters = "1 10 10";
runningLight[0] = WildcatLight1;
runningLight[1] = WildcatLight2;
runningLight[2] = WildcatLight3;
shieldEffectScale = "0.9375 1.125 0.6";
};
//**************************************************************
// WEAPONS
//**************************************************************
datablock ShapeBaseImageData(hornetChaingunPairImage)
{
className = WeaponImage;
shapeFile = "weapon_chaingun.dts";
projectile = MG42Bullet;
projectileType = TracerProjectile;
mountPoint = 3;
//*wintips* offset = "1.84 -0.52 -0.05";
offset = "0.3 0.9 0.4";
rotation = "1 0 0 0";
usesEnergy = true;
useMountEnergy = true;
minEnergy = 5;
fireEnergy = 0;
fireTimeout = 125;
casing = ShellDebris;
shellExitDir = "0 -0.5 1.0";
shellExitOffset = "0 -0.56 -0.11";
shellExitVariance = 15.0;
shellVelocity = 3.0;
projectileSpread = 3.0 / 1000.0;
//--------------------------------------
stateName[0] = "Activate";
stateSequence[0] = "Activate";
stateSound[0] = ChaingunSwitchSound;
stateAllowImageChange[0] = false;
//
stateTimeoutValue[0] = 0.3;
stateTransitionOnTimeout[0] = "Ready";
stateTransitionOnNoAmmo[0] = "NoAmmo";
//--------------------------------------
stateName[1] = "Ready";
stateSpinThread[1] = Stop;
//
stateTransitionOnTriggerDown[1] = "Spinup";
stateTransitionOnNoAmmo[1] = "NoAmmo";
//--------------------------------------
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateSpinThread[2] = Stop;
stateTransitionOnTriggerDown[2] = "DryFire";
//--------------------------------------
stateName[3] = "Spinup";
stateSpinThread[3] = SpinUp;
stateSound[3] = ChaingunSpinupSound;
//
stateTimeoutValue[3] = 0.05;
stateWaitForTimeout[3] = false;
stateTransitionOnTimeout[3] = "Fire";
stateTransitionOnTriggerUp[3] = "Spindown";
//--------------------------------------
stateName[4] = "Fire";
stateSequence[4] = "Fire";
stateSequenceRandomFlash[4] = true;
stateSpinThread[4] = FullSpeed;
stateSound[4] = ChaingunFireSound;
//stateRecoil[4] = LightRecoil;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateFire[4] = true;
stateEjectShell[4] = true;
//
stateTimeoutValue[4] = 0.05;
stateTransitionOnTimeout[4] = "Fire";
stateTransitionOnTriggerUp[4] = "Spindown";
stateTransitionOnNoAmmo[4] = "EmptySpindown";
//--------------------------------------
stateName[5] = "Spindown";
stateSound[5] = ChaingunSpinDownSound;
stateSpinThread[5] = SpinDown;
//
stateTimeoutValue[5] = 0.05;
stateWaitForTimeout[5] = true;
stateTransitionOnTimeout[5] = "Ready";
stateTransitionOnTriggerDown[5] = "Spinup";
//--------------------------------------
stateName[6] = "EmptySpindown";
stateSound[6] = ChaingunSpinDownSound;
stateSpinThread[6] = SpinDown;
//
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
//--------------------------------------
stateName[7] = "DryFire";
stateSound[7] = ChaingunDryFireSound;
stateTimeoutValue[7] = 0.3;
stateTransitionOnTimeout[7] = "NoAmmo";
};
datablock ShapeBaseImageData(hornetChaingunImage) : hornetChaingunPairImage
{
offset = "-0.45 0.9 0.4";
rotation = "1 0 0 0";
stateScript[3] = "onTriggerDown";
stateScript[5] = "onTriggerUp";
stateScript[6] = "onTriggerUp";
};
datablock ShapeBaseImageData(hornetChaingunParam)
{
mountPoint = 2;
shapeFile = "weapon_chaingun.dts";
projectile = MG42Bullet;
projectileType = TracerProjectile;
};
//********* FUNCTIONS ***********
function scoutVehicle::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.mountImage(hornetChaingunParam, 0);
%obj.mountImage(hornetChaingunImage, 2);
%obj.mountImage(hornetChaingunPairImage, 3);
%obj.nextWeaponFire = 2;
%obj.schedule(5500, "playThread", $ActivateThread, "activate");
}
function scoutVehicle::playerMounted(%data, %obj, %player, %node)
{
// scout == SUV (single-user vehicle)
commandToClient(%player.client, 'setHudMode', 'Pilot', "Hoverbike", %node);
$numVWeapons = 1;
// update observers who are following this guy...
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, false );
}
function scoutVehicle::onTrigger(%data, %obj, %trigger, %state)
{
// data = scout datablock
// obj = scout object number
// trigger = 0 for "fire", 1 for "jump", 3 for "thrust"
// state = 1 for firing, 0 for not firing
if(%trigger == 0)
{
switch (%state) {
case 0:
%obj.fireWeapon = false;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
case 1:
%obj.setImageTrigger(2, true);
%obj.setImageTrigger(3, true);
}
}
}
function scoutVehicle::playerDismounted(%data, %obj, %player)
{
%obj.fireWeapon = false;
%obj.setImageTrigger(2, false);
%obj.setImageTrigger(3, false);
setTargetSensorGroup(%obj.getTarget(), %obj.team);
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, true );
}
function hornetChaingunImage::onFire(%data,%obj,%slot)
{
// obj = AdminFighterFlyer object number
// slot = 2
Parent::onFire(%data,%obj,%slot);
// %obj.nextWeaponFire = 3;
// schedule(%data.fireTimeout, 0, "fireNextGun", %obj);
}
function hornetChaingunPairImage::onFire(%data,%obj,%slot)
{
// obj = ScoutFlyer object number
// slot = 3
Parent::onFire(%data,%obj,%slot);
// %obj.nextWeaponFire = 2;
// schedule(%data.fireTimeout, 0, "fireNextGun", %obj);
}
function hornetChaingunImage::onTriggerDown(%this, %obj, %slot)
{
}
function hornetChaingunImage::onTriggerUp(%this, %obj, %slot)
{
}
function hornetChaingunImage::onMount(%this, %obj, %slot)
{
// %obj.setImageAmmo(%slot,true);
}
function hornetChaingunPairImage::onMount(%this, %obj, %slot)
{
// %obj.setImageAmmo(%slot,true);
}
function hornetChaingunImage::onUnmount(%this,%obj,%slot)
{
}
function hornetChaingunPairImage::onUnmount(%this,%obj,%slot)
{
}