@@ -30,6 +30,7 @@ public class M113TowMod : MelonMod
3030 GameObject [ ] vic_gos ;
3131 MelonPreferences_Entry < int > random_chance ;
3232 MelonPreferences_Entry < bool > thermals ;
33+ MelonPreferences_Entry < bool > stab ;
3334
3435 public override void OnInitializeMelon ( )
3536 {
@@ -38,6 +39,7 @@ public override void OnInitializeMelon()
3839 random_chance . Comment = "Integer (default: 40)" ;
3940 thermals = cfg . CreateEntry < bool > ( "Has Thermals" , false ) ;
4041 thermals . Comment = "the thermal sight blocks a ton of frontal vision in commander view lol" ;
42+ stab = cfg . CreateEntry < bool > ( "Has Stabilizer" , false ) ;
4143 }
4244
4345 public IEnumerator GetVics ( GameState _ )
@@ -68,12 +70,12 @@ public IEnumerator Convert(GameState _)
6870 Transform turret_ring = vic . transform . Find ( "M113A2_rig/HULL/Turret ring" ) ;
6971 turret_ring . GetChild ( 0 ) . gameObject . SetActive ( false ) ;
7072 turret_ring . GetChild ( 2 ) . gameObject . SetActive ( false ) ;
73+ turret_ring . GetChild ( 3 ) . localPosition = new Vector3 ( - 0.0055f , 0.7446f , 0.115f ) ;
7174
7275 GameObject tow = GameObject . Instantiate ( m220 , turret_ring ) ;
7376 tow . SetActive ( true ) ;
7477
7578 // 0.3672 -0.7227 0.711
76-
7779 //tow.transform.localPosition = new Vector3(0.3672f, -0.6927f, 0.711f);
7880 tow . transform . localPosition = new Vector3 ( 0.3272f , - 0.7127f , 0.641f ) ;
7981
@@ -90,6 +92,7 @@ public IEnumerator Convert(GameState _)
9092 main_gun . PreAimWeapon = WeaponSystemRole . MountedLauncher ;
9193 main_gun . Name = "M220 TOW launcher" ;
9294 main_gun . Weapon = tow_weapon ;
95+ main_gun . Weapon . _impulseLocation = vic . transform ;
9396
9497 main_gun . FCS = tow_weapon . FCS ;
9598 main_gun . FCS . MainOptic = elev_scripts . Find ( "day sight/GPS" ) . GetComponent < UsableOptic > ( ) ;
@@ -108,7 +111,22 @@ public IEnumerator Convert(GameState _)
108111 main_gun . FCS . Awake ( ) ;
109112 main_gun . FCS . Mounts [ 0 ] = vic . transform . Find ( "Turret ring scripts" ) . GetComponent < AimablePlatform > ( ) ;
110113 main_gun . FCS . Mounts [ 1 ] . Transform = tow . transform . Find ( "BGM71/AZIMUTH/ELEVATION" ) ;
114+ main_gun . FCS . Mounts [ 1 ] . LocalEulerLimits . x = - 10 ;
111115 main_gun . Weapon . Feed . _totalReloadTime = 12f ;
116+ for ( int i = 0 ; i <= 3 ; i ++ )
117+ main_gun . Weapon . Feed . ReadyRack . AddInvisibleClip ( main_gun . Weapon . Feed . ReadyRack . ClipTypes [ 0 ] ) ;
118+
119+ if ( stab . Value )
120+ {
121+ main_gun . FCS . CurrentStabMode = StabilizationMode . Vector ;
122+ main_gun . FCS . StabsActive = true ;
123+ for ( int i = 0 ; i <= 1 ; i ++ )
124+ {
125+ main_gun . FCS . Mounts [ i ] . Stabilized = true ;
126+ main_gun . FCS . Mounts [ i ] . _stabActive = true ;
127+ main_gun . FCS . Mounts [ i ] . _stabMode = StabilizationMode . Vector ;
128+ }
129+ }
112130
113131 vic . AimablePlatforms = main_gun . FCS . Mounts ;
114132
0 commit comments