module Base
{

	model KI5trailersWheel1L
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel1,
		shader = vehiclewheel,
		scale = 0.1,
	}

    model KI5trailersWheel1R
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel1,
		shader = vehiclewheel,
		scale = 0.1,
        invertX = TRUE,
	}

    model KI5trailersWheel2L
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel2,
		shader = vehiclewheel,
		scale = 0.1,
	}

    model KI5trailersWheel2R
	{
		mesh = vehicles/Vehicles_damnBasic_tires|damn_stock_tire0,
		texture = vehicles/Vehicles_damnBasic_Wheel2,
		shader = vehiclewheel,
		scale = 0.1,
        invertX = TRUE,
	}

	template vehicle KI5TRTiresFront
	{
		part TireFrontLeft
		{
            model KI5TRTire0
			{
				file = KI5trailersWheel1L,
			}

            model KI5TRTire1
			{
				file = KI5trailersWheel2L,
			}

			area = TireFrontLeft,
			wheel = FrontLeft,
			table install
			{
				complete = KI5TR.InstallComplete.TireFrontLeft,
				requireInstalled = SuspensionFrontLeft,
			}
			table uninstall
			{
				complete = KI5TR.UninstallComplete.TireFrontLeft,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = KI5TR.Init.TireFrontLeft,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}

		}

		part TireFrontRight
		{
            model KI5TRTire0
			{
				file = KI5trailersWheel1R,
			}

            model KI5TRTire1
			{
				file = KI5trailersWheel2R,
			}

			area = TireFrontRight,
			wheel = FrontRight,
            table install
			{
				complete = KI5TR.InstallComplete.TireFrontRight,
				requireInstalled = SuspensionFrontRight,
			}
			table uninstall
			{
				complete = KI5TR.UninstallComplete.TireFrontRight,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = KI5TR.Init.TireFrontRight,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part Tire*
		{
			category = tire,
            specificItem = false,
			itemType = damnCraft.SmallTire1;damnCraft.SmallTire2,
			container
			{
				capacity = 35,
				test = Vehicles.ContainerAccess.Tire,
				contentType = Air,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.InstallTest.Default,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.UninstallTest.Default,
			}

		}
	}

    template vehicle KI5TRTiresRear
	{

		part TireRearLeft
		{
            model KI5TRTire0
			{
				file = KI5trailersWheel1L,
			}

            model KI5TRTire1
			{
				file = KI5trailersWheel2L,
			}

			area = TireRearLeft,
			wheel = RearLeft,
			table install
			{
				complete = KI5TR.InstallComplete.TireRearLeft,
				requireInstalled = SuspensionRearLeft,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = KI5TR.Init.TireRearLeft,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part TireRearRight
		{
            model KI5TRTire0
			{
				file = KI5trailersWheel1R,
			}

            model KI5TRTire1
			{
				file = KI5trailersWheel2R,
			}

			area = TireRearRight,
			wheel = RearRight,
			table install
			{
				complete = KI5TR.InstallComplete.TireRearRight,
				requireInstalled = SuspensionRearRight,
			}
			table uninstall
			{
				complete = KI5TR.UninstallComplete.TireRearRight,
			}

			lua
			{
				create = Vehicles.Create.Tire,
				init = KI5TR.Init.TireRearRight,
				checkOperate = Vehicles.CheckOperate.Tire,
				update = Vehicles.Update.Tire,
			}
		}

		part Tire*
		{
			category = tire,
            specificItem = false,
			itemType = damnCraft.SmallTire1;damnCraft.SmallTire2,
			container
			{
				capacity = 35,
				test = Vehicles.ContainerAccess.Tire,
				contentType = Air,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.InstallTest.Default,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Jack,
						count = 1,
						keep = true,
					}
					2
					{
						type = Base.LugWrench,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 400,
				skills = Mechanics:1,
				test = Vehicles.UninstallTest.Default,
			}

		}
	}
}