//----------------------------Naming
Name M5A1 Stuart [37mm]
ShortName 44_M5A1Stuart

//----------------------------Visuals
RotateWheels True
Icon 44_M5A1Stuart
Model W44.M5A1Stuart
Texture Skin44_M5A1Stuart

//----------------------------Third Person Camera Distance
CameraDistance 7.5

//----------------------------Throttle
MaxThrottle 1.13
MaxNegativeThrottle 0.5729
ClutchBrake 0.02825

//----------------------------Steering modifiers
TurnLeftSpeed 0.565
TurnRightSpeed 0.565

//For calculating whether wheels are on the ground or not for driving
WheelRadius 1.0

//----------------------------Wheel positions for collision handling. Tanks still have 4 wheels, they are just the corner ones.
WheelPosition 0 -32 -8 -18
WheelPosition 1 -32 -8 18
WheelPosition 2 32 -8 18
WheelPosition 3 32 -8 -18
WheelSpringStrength 0.5

//Bouncy bouncy
Bounciness 0.3

//If true, then all wheels will apply drive forces
//----------------------------Tank mode activate
Tank true
FourWheelDrive true

//----------------------------Fuel Tank Size (1 point of fuel will keep one propeller going with throttle at 1 for 1 tick)
FuelTankSize 2000

//----------------------------Inventory Slots
CargoSlots 20
ShellSlots 3
AllowAllAmmo false

//----------------------------Driver and passenger positions
Driver 0 28 0 -360 360 -8 15
RotatedDriverOffset -8 0 8
Passengers 1
Passenger 1 20 7 10 core -10 10 -10 10 44_30Cal PassengerGun1
GunOrigin 1 44 -12 8
// X + 5 , -Y -20
//----------------------------Ammo
AddAmmo 44_37APShell
AddAmmo 44_SmallHEShell
AllowAllAmmo False
//Secondary gun
AddGun 15 33 4 turret 44_30Cal
AddGun 6 40 17 turret 44_30Cal
ShootDelay 2
ShellDelay 60

VehicleGunReloadTick 40
ShootReloadSound Breach
//----------------------------Sounds
PlaceTimePrimary 80
StartSound TankIdle1
StartSoundLength 41
EngineSound Engine_LT_M5
EngineSoundLength 39
BackSoundLength 39
BackSound Engine_LT_M5
StartSoundRange 12
EngineSoundRange 50
BackSoundRange 25
PlaceSoundPrimary TankPlace
ReloadSoundSecondary 50CalReload
ReloadTimeSecondary 100

ShootSoundPrimary Shoot_37mUS
ShootSoundSecondary 30CalShoot

//----------------------------Recipe
//The sections are tailWheel, tail, bay, topWing, leftWingWheel, leftWing, rightWingWheel,
//rightWing, nose, turret, coreWheel, core
AddRecipeParts turret 1 44_Light_Tank_Turret 1 44_Vehicle_Seat
AddRecipeParts core 1 44_Light_Tank_Chassis 1 44_Vehicle_Seat
AddRecipeParts leftTrack 1 44_Tank_Track
AddRecipeParts rightTrack 1 44_Tank_Track
//Dye colours are "black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"
AddDye 3 green

//Health and collision
SetupPart core 1500 -48 -2 -24 96 42 48
SetupPart leftTrack 300 -42 -10 -24 87 19 9
SetupPart rightTrack 300 -42 -10 15 87 19 9

BulletDetection 2

//Size Multiplier; scales up the model
ModelScale 0.95
Description American Light Tank__Uses : 37mm AP Tank Shell_Small Cal. HE Tank Shell __Year Introduced : 1942

//----------------------------Barrel

ShootParticlesPrimary largeexplode 0 0 0
ShootParticlesPrimary explode 1.5 0 0
ShootParticlesPrimary largesmoke 0.5 0 0.1
ShootParticlesPrimary largesmoke 0.5 0 -0.1
ShootParticlesPrimary largesmoke 0.5 0.06 0.06
ShootParticlesPrimary largesmoke 0.5 0.06 -0.06
ShootParticlesPrimary largesmoke 0.5 -0.06 0.06
ShootParticlesPrimary largesmoke 0.5 -0.06 -0.06
ShootParticlesPrimary largesmoke 0.5 -0.1 0
ShootParticlesPrimary largesmoke 0.5 0.1 0
ShootParticlesPrimary cloud 0.05 0 0.2
ShootParticlesPrimary cloud 0.05 0 -0.2
ShootParticlesPrimary cloud 0.05 0.13 0.13
ShootParticlesPrimary cloud 0.05 0.13 -0.13
ShootParticlesPrimary cloud 0.05 -0.13 0.13
ShootParticlesPrimary cloud 0.05 -0.13 -0.13
ShootParticlesPrimary cloud 0.05 -0.2 0
ShootParticlesPrimary cloud 0.05 0.2 0
ShootParticlesPrimary flansmod.fmflame 1 0 0
ShootParticlesPrimary flansmod.fmflame 1.75 0 0
ShootParticlesPrimary flansmod.fmflame 1.5 0 0
ShootParticlesPrimary flansmod.fmflame 1.25 0 0
ShootParticlesPrimary flansmod.fmflame 0.75 0 0
ShootParticlesPrimary flansmod.fmflame 0.5 0 0
ShootParticlesPrimary flansmod.fmflame 0.25 0 0
ShootParticlesPrimary flansmod.fmflame 1.5 0 0
ShootParticlesPrimary flansmod.fmflame 0.5 0 0.1
ShootParticlesPrimary flansmod.fmflame 0.5 0 -0.1
ShootParticlesPrimary flansmod.fmflame 0.5 0.06 0.06
ShootParticlesPrimary flansmod.fmflame 0.5 0.06 -0.06
ShootParticlesPrimary flansmod.fmflame 0.5 -0.06 0.06
ShootParticlesPrimary flansmod.fmflame 0.5 -0.06 -0.06
ShootParticlesPrimary flansmod.fmflame 0.5 -0.1 0
ShootParticlesPrimary flansmod.fmflame 0.5 0.1 0
ShootParticlesPrimary flansmod.fmflame 0.05 0 0.2
ShootParticlesPrimary flansmod.fmflame 0.05 0 -0.2
ShootParticlesPrimary flansmod.fmflame 0.05 0.13 0.13
ShootParticlesPrimary flansmod.fmflame 0.05 0.13 -0.13
ShootParticlesPrimary flansmod.fmflame 0.05 -0.13 0.13
ShootParticlesPrimary flansmod.fmflame 0.05 -0.13 -0.13
ShootParticlesPrimary flansmod.fmflame 0.05 -0.2 0
ShootParticlesPrimary flansmod.fmflame 0.05 0.2 0
ShootParticlesPrimary flansmod.fmflame 0.1 0 0.4
ShootParticlesPrimary flansmod.fmflame 0.1 0 -0.4
ShootParticlesPrimary flansmod.fmflame 0.1 0.26 0.26
ShootParticlesPrimary flansmod.fmflame 0.1 0.26 -0.26
ShootParticlesPrimary flansmod.fmflame 0.1 -0.26 0.26
ShootParticlesPrimary flansmod.fmflame 0.1 -0.26 -0.26
ShootParticlesPrimary flansmod.fmflame 0.1 -0.4 0
ShootParticlesPrimary flansmod.fmflame 0.1 0.4 0

ShootParticlesSecondary crit 0.5 0 0
BarrelPosition 47 30 0

CanRoll true

//----------------------------Smoke effects

//----------------------------Basic emission
AddEmitter smoke 1 [-52,16,7] [1,1,1] [0,0.5,0] -1 1 0 1 core
AddEmitter smoke 1 [-52,16,-7] [1,1,1] [0,0.5,0] -1 1 0 1 core

//----------------------------Damage
AddEmitter smoke 2 [-34,26,-23.25] [7,1,7] [0,0.5,0] -1 1 0 0.75 core
AddEmitter smoke 2 [-34,26,23.25] [7,1,7] [0,0.5,0] -1 1 0 0.75 core
AddEmitter smoke 2 [5,43,14] [3,1,3] [0,0.5,0] -1 1 0 0.75 turret

AddEmitter largesmoke 3 [-34,26,-23.25] [7,1,7] [0,1,0] -1 1 0 0.5 core
AddEmitter largesmoke 3 [-34,26,23.25] [7,1,7] [0,1,0] -1 1 0 0.5 core
AddEmitter largesmoke 2 [5,43,14] [3,1,3] [0,0.5,0] -1 1 0 0.5 turret

AddEmitter largesmoke 1 [-34,26,-23.25] [7,1,7] [0,1.5,0] -1 1 0 0.25 core
AddEmitter largesmoke 1 [-34,26,23.25] [7,1,7] [0,1.5,0] -1 1 0 0.25 core

AddEmitter flame 1 [-34,26,-23.25] [5,1,5] [0,1,0] -1 1 0 0.25 core
AddEmitter flame 1 [-34,26,23.25] [5,1,5] [0,1,0] -1 1 0 0.25 core
AddEmitter largesmoke 1 [5,43,14] [3,1,3] [0,1,0] -1 1 0 0.5 turret


//----------------------------Turret rotation stuff
DriverAimSpeed 1.13 1.03 0

DriverYawBeforePitch false

DriverTraverseSounds true

YawSound TurretTraverse1
YawSoundLength 21

PitchSound TurretTraverse2
PitchSoundLength 20


//----------------------------Exhaust Effects
//1st gear change

AddEmitter largesmoke 1 [-40,9,7] [1,1,1] [0,1.5,0] 0.02 0.07 0 1 core

AddEmitter largesmoke 1 [-40,9,-7] [1,1,1] [0,1.5,0] 0.02 0.07 0 1 core

//1st gear

AddEmitter explode 1 [-40,9,7] [1,1,1] [0,0.2,0] 0.05 0.2 0 1 core

AddEmitter explode 1 [-40,9,-7] [1,1,1] [0,0.2,0] 0.05 0.2 0 1 core

//2nd gear change

AddEmitter largesmoke 1 [-40,9,7] [1,1,1] [0,3,0] 0.2 0.25 0 1 core

AddEmitter largesmoke 1 [-40,9,-7] [1,1,1] [0,3,0] 0.2 0.25 0 1 core

//2nd gear

AddEmitter explode 1 [-40,9,7] [1,1,1] [0,0.7,0] 0.2 0.5 0 1 core

AddEmitter explode 1 [-40,9,-7] [1,1,1] [0,0.7,0] 0.2 0.5 0 1 core


//3rd gear change

AddEmitter largesmoke 1 [-40,9,7] [1,1,1] [0,4,0] 0.5 0.52 0 1 core

AddEmitter largesmoke 1 [-40,9,-7] [1,1,1] [0,4,0] 0.5 0.52 0 1 core

AddEmitter flame 1 [-40,9,7] [1,1,1] [0,2,0] 0.5 0.51 0 1 core

AddEmitter flame 1 [-40,9,-7] [1,1,1] [0,2,0] 0.5 0.51 0 1 core

//3rd gear
AddEmitter explode 1 [-40,9,7] [1,1,1] [0,0.7,0] 0.5 2 0 1 core

AddEmitter explode 1 [-40,9,-7] [1,1,1] [0,0.7,0] 0.5 2 0 1 core

AddEmitter largesmoke 3 [-40,9,7] [1,1,1] [0,0.5,0] 0.8 2 0 1 core

AddEmitter largesmoke 3 [-40,9,-7] [1,1,1] [0,0.5,0] 0.8 2 0 1 core

//4th gear change

AddEmitter largesmoke 1 [-40,9,7] [1,1,1] [0,5,0] 0.7 0.75 0 1 core

AddEmitter largesmoke 1 [-40,9,-7] [1,1,1] [0,5,0] 0.7 0.77 0 1 core

AddEmitter flame 1 [-40,9,7] [1,1,1] [0,5,0] 0.7 0.73 0 1 core

AddEmitter flame 1 [-40,9,-7] [1,1,1] [0,5,0] 0.7 0.73 0 1 core

//----------------------------Tracks

TrackLinkLength 3

RightLinkPoint [40.5,8,-19.2]
RightLinkPoint [43.5,6,-19.2]
RightLinkPoint [43.5,1,-19.2]
RightLinkPoint [33,-9.5,-19.2]
RightLinkPoint [-38,-9.5,-19.2]
RightLinkPoint [-41.3,-6,-19.2]
RightLinkPoint [-41.5,5,-19.2]
RightLinkPoint [-38,6,-19.2]
RightLinkPoint [-30,8,-19.2]
RightLinkPoint [20,9,-19.2]
RightLinkPoint [37,9,-19.2]

LeftLinkPoint [40.5,8,19.2]
LeftLinkPoint [43.5,6,19.2]
LeftLinkPoint [43.5,1,19.2]
LeftLinkPoint [33,-9.5,19.2]
LeftLinkPoint [-38,-9.5,19.2]
LeftLinkPoint [-41.3,-6,19.2]
LeftLinkPoint [-41.5,5,19.2]
LeftLinkPoint [-38,6,19.2]
LeftLinkPoint [-30,8,19.2]
LeftLinkPoint [20,9,19.2]
LeftLinkPoint [37,9,19.2]

BulletSpeed 10
BulletSpread 4
IsExplosionWhenDestroyed true