function CreateEnemyVehicleTB(%name, %slot)
{
   %list = GetVehiclePolyList(%name);
   
   %starterpos = getRandom(1, 10000) SPC getRandom(1, 10000);  // this is needed so vehicles aren't created on top of each other
   
   %vehicle =    new t2dStaticSprite() {
                     canSaveDynamicFields = "1";
                     Position = %starterpos;
                     enemy = "1";
                     layer = "3";
                     class = "enemyclass";
                     CollisionPolyList = %list;
                     scenegraph = "sg";
                  };

   %vehicle.SetCollisionActive(true, true);
   %vehicle.vehiclename = %name;
   %vehicle.SetImageMap(%name);

   if(%name $= "trailertruck" || %name $= "flatbedtruck")            
      AttachTrailer(%vehicle);
   
   // this will hopefully keep them evenly divided
      
   %rand++;
      
   if(%rand == 3)
      %rand = 1;
      
   %value = getRandom(90, 140);      
   %var = %var+75;
   
   // mount bar
      
   %obj = CreateRedBar();
   if(%name $= "flatbedtruck" || %name $= "trailertruck")
      %obj.mount(%vehicle, "0 6", 0, true, true, true, true);   
   else
      %obj.mount(%vehicle, "0 1.5", 0, true, true, true, true);   

   %vehicle.marker = %obj;
            
   // give it some id
   
   %vehicle.slot = %slot;

   if($quickbattle $= "")
      %vehicle.topspeed = $enemyvehicles[%slot, topspeed];
   else
      %vehicle.topspeed = GetVehicleTopSpeed(%name);
         
   $enemyvehicles[%slot, battleid] = %vehicle;
   
   %vehicle.SetSize(GetSize(%name));
   
   MountEnemyTriggers(%vehicle);
   
   return %vehicle;
}