function JetEngineCheck(%obj)
{
// return;
if(!isObject(%obj))
return;
%speed = vectorLen(%obj.getVelocity());
if(%speed < %obj.dataBlock.minJetEngineSpeed) // If the speed is less than 20
{
if(%obj.getMountedImage(0) !$= "") // and an image is mounted to slot 0
{
%obj.unMountImage(0); // unmount it
}
}
else //otherwise
{
if(%obj.getMountedImage(0) $= 0) // if an image isnt mounted to slot 0
{
%obj.mountImage(JetEngineImage2,0); //mount this one
}
}
//Jet Engine Image 2 goes into slot 0 above
//notably, Jet Engine Image 1 does not check for speed
if(%obj.getMountedObject(0))// I believe, "If Jet Engine Image 2 is mounted", try changing it
// to %obj.getMountedImage(0) !$= ""
{
if(%obj.getMountedImage(1) $= 0)// and Jet Engine Image 1 is not mounted to slot 1
{
%obj.mountImage(JetEngineImage1,1); //mount Jet Engine Image 1 to slot 1
}
}
else // if Jet Engine Image 2 isn't mounted
{
if(%obj.getMountedImage(1) !$= "") // and Jet Engine Image 1 is
{
%obj.unMountImage(1); // unmount Jet Engine Image 1
}
}
if(%obj.getMountedObject(0))//Repeat of the above, no changes. This part may be removable.
{
if(%obj.getMountedImage(1) $= 0)
{
%obj.mountImage(JetEngineImage1,1);
}
}
else
{
if(%obj.getMountedImage(1) !$= "")
{
%obj.unMountImage(1);
}
}
schedule(2000,0,"JetEngineCheck",%obj);
}
If Jet Engine Image 2 is mounted, the code assumes the speed matches the requirement and proceeds to mount Jet Engine Image 1
based on whether or not Jet Engine Image 2 is mounted currently.
It then proceeds to check and mount it a second time.
If you need additional explanation you'll have to be more clear in what you don't understand.
"I just don't know if it does something at that speed I need to code so that the other jet will appear.":
The other jet relies on Jet Engine Image 2's existance (or anything in the 0 image slot, for that matter) to be spawned instead of the
speed check used to spawn Jet Engine Image 1.
I would assume additional jet code would be
if(%obj.getMountedObject(0))//Repeat of the above, no changes. This part may be removable.
{
if(%obj.getMountedImage(2) $= 0)
{
%obj.mountImage(JetEngineImage3,2);
}
}
else
{
if(%obj.getMountedImage(2) !$= "")
{
%obj.unMountImage(2);
}
}