Heres the code for the contrails. I have 4 mountpoints; 2 for afterburners and 2 for the contrails, and only one of the contrails appears.
datablock ShapeBaseImageData(F22AContrailImage1)
{
shapeFile = "base/data/shapes/empty.dts";
emap = false;
mountPoint = 3;
rotation = "1 0 0 -90";
stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;
stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = F22AContrailEmitter;
stateEmitterTime[1] = 10000;
stateName[2] = "Done";
stateScript[2] = "onDone";
};
function F22AContrailImage1::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}
datablock ShapeBaseImageData(F22AContrailImage2)
{
shapeFile = "base/data/shapes/empty.dts";
emap = false;
mountPoint = 4;
rotation = "1 0 0 -90";
stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;
stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = F22AContrailEmitter;
stateEmitterTime[1] = 10000;
stateName[2] = "Done";
stateScript[2] = "onDone";
};
function F22AContrailImage2::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}
function F22AContrailCheck(%obj)
{
// return;
if(!isObject(%obj))
return;
%speed = vectorLen(%obj.getVelocity());
if(%speed < %obj.dataBlock.minF22AContrailSpeed)
{
if(%obj.getMountedImage(3) !$= "")
{
%obj.unMountImage(3);
%obj.unMountImage(4);
}
}
else
{
if(%obj.getMountedImage(3) $= 0)
{
%obj.mountImage(F22AContrailImage1,3);
%obj.mountImage(F22AContrailImage2,4);
}
}
schedule(2000,0,"F22AContrailCheck",%obj);
}
function F22ASpeedCheck(%obj)
{
if(!isObject(%obj))
{
return;
}
%pos = %obj.getposition();
%typeMask = $TypeMasks::ProjectileObjectType;
InitContainerRadiusSearch(%pos, 10000, %typeMask);
//%threatdetection = containerFindFirst(%typeMask, %pos, 100000, 100000, 100000);
%obj.ECM="";
%threatDetection = ContainerSearchNext();
while(isobject(%threatDetection) && (%threatDetection.target $= %obj))
{
serverPlay3d(F22AtargetSound,%pos);
%obj.ECM="<color:f00000>[ WARNING : INCOMING MISSILE ]";
break;
}
%speed = vectorLen(%obj.getVelocity());
%obj.speed = mFloor(%speed+0.5);
%transform= %obj.gettransform();
%obj.health = mFloor(-1*((%obj.getDamageLevel()/%obj.getDatablock().maxdamage)*100)+100 + 0.5);
switch (%obj.F22Agear)
{
case 1:
%geart = "Up";
%stat = "<color:00FF00>";
%statnum = 1;
case 2:
%geart = "Down";
%stat = "<color:FF0000>";
%statnum = 0;
default:
%geart = "Down";
%stat = "<color:FF0000>";
%statnum = 0;
}
//F22A HUD
commandToClient(%obj.getMountedObject(0).client,'bottomprint',
"<just:left><font:Impact:24pt>\c3Speed <font:Impact:24pt>\c6: " @ %obj.speed @
"<just:center><font:Impact:24pt>\c3Altitude <font:Impact:24pt>\c6: " @ getcontrolobjectaltitude()
@
"<just:right><font:Impact:24pt>\c3[ L ] Gears <font:Impact:24pt>\c6: " @ %geart @
"<just:center><font:Impact:24pt>\c3[ > ] Armament <font:Impact:24pt>\c6: " @ %stat @ " " @
%obj.weapon , 1, 2, 3, 4);
commandToclient(%obj.getMountedObject(0).client,'centerprint',"<just:left><font:Impact:24pt>" @
%obj.lockstat @
"<just:center><font:Impact:24pt>" @ %obj.ECM @
"<just:right><font:Impact:24pt>\c3Health\c6: " @ %obj.health @ "%\n" @
"<just:right><font:Impact:24pt>" @ %obj.fColor @ "[FLARE]" @
"\n\n\n<just:center>[ ]" ,1,2,3,4);
if (mFloor(%speed+1.15) > %obj.getDatablock().minContrailSpeed)
{
%obj.mountImage(F22AContrailImage1,3);
%obj.mountImage(F22AContrailImage2,4);
}
else
{
%obj.unMountImage(3);
%obj.unMountImage(4);
}
// if(%obj.speed < 145)
// %obj.setVelocity(vectorScale(%obj.getVelocity(),1.03));
if(%obj.boost == true)
{
%obj.applyimpulse(%obj.gettransform(),vectorScale(%obj.getVelocity(),3.65)); //1.45
%obj.mountImage(F22AAfterBurnerImage1,1);
%obj.mountImage(F22AAfterBurnerImage2,2);
}
else
{
%obj.unMountImage(1);
%obj.unMountImage(2);
if((%obj.speed >= 165))
%obj.applyimpulse(%obj.gettransform(),vectorScale(%obj.getVelocity(),-4.0)); //-0.066
}
schedule(100,0,"F22ASpeedCheck",%obj);
}