#define TA // This is a TA script #include "sfxtype.h" #include "exptype.h" piece base, body, turret, sleeve, barrel, tankflare, radio, hatch, rocket_rack, rocket1, rocket2, rocket3, grenade1, grenade2, mgantiaimer, MGstick, MG, MGflare1, MGflare2, rack, exaust, front, armF1, tireF1, armF2, tireF2, middle, armM1, tireM1, armM2, tireM2, rear, armR1, tireR1, armR2, tireR2, foomA, foomA1, foomA2, foomA3, foomA4, foomB, foomB1, foomB2, foomB3, foomB4, foomB5, foomB12, foomB22, foomB32, foomB42, rear2, front2, right_point, left_point, center, wake1, wake2, wake3, wake4, trooper, head, helmet, helmet_shieldA, helmet_NVG, helmet_shieldB, luparm, lloarm, lhand, ruparm, rloarm, rhand, roll1, roll2, gastank1, spare_tire1, spare_tire2, spare_tire3, crate1, crate2; static-var restore_delay, Static_Var_2, Static_Var_3, gun_2, gun_3, bMoving, over_water, Static_Var_7, RANDOA, count, original_speed, water_speed; // Signal definitions #define SIG_AIM 2 #define SIG_MOVE 4 #define SIG_AIM2 8 #define SIG_AIM_3 16 #define MAX_SPEED 75 #define lildirt 1024+0 helmetchooser() { RANDOA = rand(1 , 3); if (randoA == 1) { show helmet_shieldA; } if (randoA == 2) { show helmet_NVG; } if (randoA == 3) { show helmet_shieldB; } } clutterchooser() { while (count != 0) { RANDOA = rand(1 , 3); --count; if (count == 7) { if(RANDOA == 1 OR RANDOA == 3) { show crate1; } } if (count == 6) { if(RANDOA == 1 OR RANDOA == 3) { show crate2; } } if (count == 5) { if(RANDOA == 1 OR RANDOA == 3) { show spare_tire1; } } if (count == 4) { if(RANDOA == 1 OR RANDOA == 3) { show spare_tire2; } } if (count == 3) { if(RANDOA == 1 OR RANDOA == 3) { show spare_tire3; } } if (count == 2) { if(RANDOA == 1 OR RANDOA == 3) { show roll1; } } if (count == 1) { if(RANDOA == 1 OR RANDOA == 3) { show roll2; } } } } SmokeUnit(healthpercent, sleeptime, smoketype) { while( get BUILD_PERCENT_LEFT ) { sleep 400; } while( TRUE ) { healthpercent = get HEALTH; if( healthpercent < 66 ) { smoketype = 256 | 2; if( Rand( 1, 66 ) < healthpercent ) { smoketype = 256 | 1; } emit-sfx smoketype from base; } sleeptime = healthpercent * 50; if( sleeptime < 200 ) { sleeptime = 200; } sleep sleeptime; } } Reload() { Static_Var_7 = 1; sleep 10000; show rocket1; show rocket2; show rocket3; Static_Var_7 = 0; gun_3 = base; } StartMoving() { bMoving = TRUE; signal SIG_MOVE; set-signal-mask SIG_MOVE; var Func_Var_1, Func_Var_2; while( TRUE ) { if( !over_water ) { Func_Var_1 = get ATAN(get GROUND_HEIGHT(get PIECE_XZ(rear2)) - get GROUND_HEIGHT(get PIECE_XZ(front2)),get XZ_HYPOT(get PIECE_XZ(rear2) - get PIECE_XZ(front2))); Func_Var_2 = get ATAN(get GROUND_HEIGHT(get PIECE_XZ(right_point)) - get GROUND_HEIGHT(get PIECE_XZ(left_point)),get XZ_HYPOT(get PIECE_XZ(right_point) - get PIECE_XZ(left_point))); turn base to x-axis Func_Var_1 now; turn base to z-axis Func_Var_2 now; turn armF1 to x-axis Rand( <2.000000>, <-2.000000> ) speed <1000.000000>; turn armF2 to x-axis Rand( <2.000000>, <-2.000000> ) speed <1000.000000>; turn armM1 to x-axis Rand( <2.000000>, <-2.000000> ) speed <1000.000000>; turn armM2 to x-axis Rand( <2.000000>, <-2.000000> ) speed <1000.000000>; turn armR1 to x-axis Rand( <2.000000>, <-2.000000> ) speed <1000.000000>; turn armR2 to x-axis Rand( <2.000000>, <-2.000000> ) speed <1000.000000>; //emit-sfx lildirt from tireF1; //emit-sfx lildirt from tireF2; // dammit I need dust FX //emit-sfx lildirt from tireM1; //emit-sfx lildirt from tireM2; emit-sfx lildirt from tireR1; emit-sfx lildirt from tireR2; spin tireF1 around x-axis speed <200.000000>; spin tireF2 around x-axis speed <200.000000>; spin tireM1 around x-axis speed <200.000000>; spin tireM2 around x-axis speed <200.000000>; spin tireR1 around x-axis speed <200.000000>; spin tireR2 around x-axis speed <200.000000>; } if( over_water ) { stop-spin tireF1 around x-axis; stop-spin tireF2 around x-axis; stop-spin tireM1 around x-axis; stop-spin tireM2 around x-axis; stop-spin tireR1 around x-axis; stop-spin tireR2 around x-axis; turn armF1 to x-axis <0.000000> speed <1000.000000>; turn armF2 to x-axis <0.000000> speed <1000.000000>; turn armM1 to x-axis <0.000000> speed <1000.000000>; turn armM2 to x-axis <0.000000> speed <1000.000000>; turn armR1 to x-axis <0.000000> speed <1000.000000>; turn armR2 to x-axis <0.000000> speed <1000.000000>; emit-sfx 5 from wake1; emit-sfx 5 from wake2; emit-sfx 5 from wake3; emit-sfx 5 from wake4; turn base to x-axis <0.000000> speed <54.945055>; turn base to z-axis <0.000000> speed <54.945055>; } sleep 100; } } StopMoving() { bMoving = FALSE; signal SIG_MOVE; turn armF1 to x-axis <0.000000> speed <1000.000000>; turn armF2 to x-axis <0.000000> speed <1000.000000>; turn armM1 to x-axis <0.000000> speed <1000.000000>; turn armM2 to x-axis <0.000000> speed <1000.000000>; turn armR1 to x-axis <0.000000> speed <1000.000000>; turn armR2 to x-axis <0.000000> speed <1000.000000>; stop-spin tireF1 around x-axis; stop-spin tireF2 around x-axis; stop-spin tireM1 around x-axis; stop-spin tireM2 around x-axis; stop-spin tireR1 around x-axis; stop-spin tireR2 around x-axis; } /* SlopeAdjust(Func_Var_1, Func_Var_2) { while( TRUE ) { if( !over_water ) { Func_Var_1 = get ATAN(get GROUND_HEIGHT(get PIECE_XZ(rear2)) - get GROUND_HEIGHT(get PIECE_XZ(front2)),get XZ_HYPOT(get PIECE_XZ(rear2) - get PIECE_XZ(front2))); Func_Var_2 = get ATAN(get GROUND_HEIGHT(get PIECE_XZ(right_point)) - get GROUND_HEIGHT(get PIECE_XZ(left_point)),get XZ_HYPOT(get PIECE_XZ(right_point) - get PIECE_XZ(left_point))); turn base to x-axis Func_Var_1 now; turn base to z-axis Func_Var_2 now; SET MAX_SPEED to [4]; } if( over_water ) { turn base to x-axis <0.000000> speed <54.945055>; turn base to z-axis <0.000000> speed <54.945055>; SET MAX_SPEED to [250]; } sleep 100; } } */ setSFXoccupy(Func_Var_1) { if( Func_Var_1 == 0 ) { over_water = 1; SET MAX_SPEED to [.2]; } if( Func_Var_1 == 1 ) { over_water = 0; SET MAX_SPEED to [2]; } if( Func_Var_1 == 2 ) { over_water = 1; SET MAX_SPEED to [.2]; } if( Func_Var_1 == 3 ) { over_water = 1; SET MAX_SPEED to [.2]; } if( Func_Var_1 == 4 ) { over_water = 0; SET MAX_SPEED to [2]; } } Create() { hide helmet_shieldA; hide helmet_NVG; hide helmet_shieldB; hide spare_tire1; hide spare_tire2; hide spare_tire3; hide roll1; hide roll2; hide gastank1; hide crate1; hide crate2; original_speed = (get MAX_SPEED); count = 8; over_water = 0; start-script helmetchooser(); start-script clutterchooser(); restore_delay = 1000; turn rocket_rack to x-axis <-45.000000> now; gun_3 = base; start-script SmokeUnit(); } SetMaxReloadTime(Func_Var_1) { restore_delay = Func_Var_1 * 2; } RestoreAfterDelay() { sleep restore_delay; turn turret to y-axis <0.000000> speed <40.000000>; turn sleeve to x-axis <0.000000> speed <80.000000>; turn MG to x-axis <0.000000> speed <80.000000>; turn rocket_rack to x-axis <-45.000000> speed <80.000000>; } SweetSpot(piecenum) { piecenum = turret; } QueryPrimary(piecenum) { piecenum = tankflare; } AimFromPrimary(piecenum) { piecenum = turret; } AimPrimary(heading, pitch) { signal SIG_AIM; set-signal-mask SIG_AIM; while( over_water == 1 ) { sleep 500; } turn turret to y-axis heading speed <40.000000>; turn sleeve to x-axis <0.000000> - pitch speed <80.000000>; wait-for-turn turret around y-axis; wait-for-turn sleeve around x-axis; start-script RestoreAfterDelay(); return (1); } FirePrimary() { move barrel to z-axis [-2.500000] speed [500.000000]; wait-for-move barrel along z-axis; move barrel to z-axis [0.000000] speed [3.000000]; emit-sfx 0 from tankflare; sleep 10; emit-sfx 0 from foomA; sleep 10; emit-sfx 0 from foomA1; emit-sfx 0 from foomA2; emit-sfx 0 from foomA3; emit-sfx 0 from foomA4; sleep 10; emit-sfx 256 | 2 from foomA1; emit-sfx 256 | 2 from foomA2; emit-sfx 256 | 2 from foomA3; emit-sfx 256 | 2 from foomA4; emit-sfx 0 from foomB; sleep 10; emit-sfx 0 from foomB1; emit-sfx 0 from foomB2; emit-sfx 0 from foomB3; emit-sfx 0 from foomB4; emit-sfx 0 from foomB5; emit-sfx 0 from foomB12; emit-sfx 0 from foomB22; emit-sfx 0 from foomB32; emit-sfx 0 from foomB42; sleep 10; emit-sfx 256 | 2 from foomB1; emit-sfx 256 | 2 from foomB2; emit-sfx 256 | 2 from foomB3; emit-sfx 256 | 2 from foomB4; emit-sfx 256 | 2 from foomB5; emit-sfx 256 | 2 from foomB12; emit-sfx 256 | 2 from foomB22; emit-sfx 256 | 2 from foomB32; emit-sfx 256 | 2 from foomB42; sleep 10; } QuerySecondary(piecenum) { if( gun_2 == 0 ) { piecenum = MGflare1; return (0); } if( gun_2 == 1 ) { piecenum = MGflare2; return (0); } } AimFromSecondary(piecenum) { if( gun_2 == 0 ) { piecenum = MGflare1; return (0); } if( gun_2 == 1 ) { piecenum = MGflare2; return (0); }; } AimSecondary(heading, pitch) { signal SIG_AIM2; set-signal-mask SIG_AIM2; turn turret to y-axis heading speed <40.000000>; turn MG to x-axis <0.000000> - pitch speed <80.000000>; wait-for-turn turret around y-axis; wait-for-turn MG around x-axis; start-script RestoreAfterDelay(); return (1); } FireSecondary() { if( gun_2 == 0 ) { gun_2 = 1; emit-sfx 0 from MGflare1; return (0); } if( gun_3 == 1 ) { gun_2 = 0; emit-sfx 0 from MGflare2; return (0); } } QueryTertiary(piecenum) { if( gun_3 == 0 ) { piecenum = rocket1; return (0); } if( gun_3 == 1 ) { piecenum = rocket2; return (0); } if( gun_3 == 2 ) { piecenum = rocket3; return (0); } } AimFromTertiary(piecenum) { piecenum = rocket_rack; } AimTertiary(heading, pitch) { signal SIG_AIM_3; set-signal-mask SIG_AIM_3; turn turret to y-axis heading speed <40.000000>; turn rocket_rack to x-axis <0.000000> - pitch speed <80.000000>; wait-for-turn turret around y-axis; wait-for-turn rocket_rack around x-axis; start-script RestoreAfterDelay(); return (1); } FireTertiary() { if( gun_3 == 0 ) { gun_3 = body; hide rocket1; emit-sfx 0 from rocket1; return (0); } if( gun_3 == 1 ) { gun_3 = turret; hide rocket2; emit-sfx 0 from rocket2; return (0); } if( gun_3 == 2 ) { gun_3 = base; hide rocket3; emit-sfx 0 from rocket3; start-script Reload(); return (0); } } Killed(severity, corpsetype) { if( severity <= 25 ) { emit-sfx 0 from body; corpsetype = 1; return (0); } if( severity <= 50 ) { emit-sfx 0 from body; corpsetype = 2; return (0); } if( severity <= 99 ) { emit-sfx 0 from body; corpsetype = 3; return (0); } emit-sfx 0 from body; corpsetype = 3; }