From 36042188536644168cdbfdaf0b3de248f13c35a7 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sat, 27 Jul 2024 11:40:43 +0100 Subject: [PATCH 1/5] v2 - Rewrote logic to use `MFKLexer`. - Improved logic to fix some bugs. - Split `SkipLocks` into separate settings for `Car` and `Costume` locks. --- Forced Car/CustomFiles.ini | 3 - Forced Car/CustomFiles.lua | 95 - .../CustomFiles/sound/scripts/car_tune.spt | 2660 ----------------- Forced Car/HandleMission.lua | 58 - ForcedCar/CustomFiles.ini | 12 + ForcedCar/CustomFiles.lua | 154 + {Forced Car => ForcedCar}/Meta.ini | 50 +- ForcedCar/Resources/HandleLevelInit.lua | 4 + ForcedCar/Resources/HandleLevelLoad.lua | 32 + ForcedCar/Resources/HandleMissionInit.lua | 4 + ForcedCar/Resources/HandleMissionLoad.lua | 142 + ForcedCar/Resources/HandleSundayDriveInit.lua | 31 + ForcedCar/Resources/lib/MFKLexer.lua | 809 +++++ 13 files changed, 1226 insertions(+), 2828 deletions(-) delete mode 100644 Forced Car/CustomFiles.ini delete mode 100644 Forced Car/CustomFiles.lua delete mode 100644 Forced Car/CustomFiles/sound/scripts/car_tune.spt delete mode 100644 Forced Car/HandleMission.lua create mode 100644 ForcedCar/CustomFiles.ini create mode 100644 ForcedCar/CustomFiles.lua rename {Forced Car => ForcedCar}/Meta.ini (80%) create mode 100644 ForcedCar/Resources/HandleLevelInit.lua create mode 100644 ForcedCar/Resources/HandleLevelLoad.lua create mode 100644 ForcedCar/Resources/HandleMissionInit.lua create mode 100644 ForcedCar/Resources/HandleMissionLoad.lua create mode 100644 ForcedCar/Resources/HandleSundayDriveInit.lua create mode 100644 ForcedCar/Resources/lib/MFKLexer.lua diff --git a/Forced Car/CustomFiles.ini b/Forced Car/CustomFiles.ini deleted file mode 100644 index 7a28029..0000000 --- a/Forced Car/CustomFiles.ini +++ /dev/null @@ -1,3 +0,0 @@ - -[PathHandlers] -*.mfk=HandleMission.lua \ No newline at end of file diff --git a/Forced Car/CustomFiles.lua b/Forced Car/CustomFiles.lua deleted file mode 100644 index 15afd3e..0000000 --- a/Forced Car/CustomFiles.lua +++ /dev/null @@ -1,95 +0,0 @@ --- CAR LIST -CarPool = { - "ambul", - "apu_v", - "atv_v", - "bart_v", - "bbman_v", - "bookb_v", - "burns_v", - "burnsarm", - "carhom_v", - "cArmor", - "cBlbart", - "cBone", - "cCellA", - "cCellB", - "cCellC", - "cCellD", - "cCola", - "cCube", - "cCurator", - "cDonut", - "cDuff", - "cFire_v", - "cHears", - "cKlimo", - "cletu_v", - "cLimo", - "cMilk", - "cNerd", - "cNonup", - "coffin", - "comic_v", - "compactA", - "cPolice", - "cSedan", - "cVan", - "dune_v", - "elect_v", - "famil_v", - "fishtruc", - "fone_v", - "frink_v", - "garbage", - "glastruc", - "gramp_v", - "gramR_v", - "hallo", - "hbike_v", - "homer_v", - "honor_v", - "hype_v", - "icecream", - "IStruck", - "knigh_v", - "krust_v", - "lisa_v", - "marge_v", - "minivanA", - "moe_v", - "mono_v", - "mrplo_v", - "nuctruck", - "oblit_v", - "otto_v", - "pickupA", - "pizza", - "plowk_v", - "redbrick", - "rocke_v", - "schoolbu", - "scorp_v", - "sedanA", - "sedanB", - "ship", - "skinn_v", - "smith_v", - "snake_v", - "sportsA", - "sportsB", - "SUVA", - "taxiA", - "tt", - "votetruc", - "wagonA", - "wiggu_v", - "willi_v", - "witchcar", - "zombi_v", -} - -CarChoice = GetSetting("Vehicle") + 1 -CarName = CarPool[CarChoice] - -print("Forced Car chosen is: " .. CarName) diff --git a/Forced Car/CustomFiles/sound/scripts/car_tune.spt b/Forced Car/CustomFiles/sound/scripts/car_tune.spt deleted file mode 100644 index 5c1a045..0000000 --- a/Forced Car/CustomFiles/sound/scripts/car_tune.spt +++ /dev/null @@ -1,2660 +0,0 @@ -create carSoundParameters named snake_v -{ - SetEngineClipName ( "snake_car" ) - SetEngineIdleClipName ( "snake_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "snake_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.600000 1.200000 ) - SetIdleEnginePitch ( 0.320000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.660000 ) - SetShiftPoint ( 3 0.945000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.530000 ) - SetGearShiftPitchDrop ( 2 0.610000 ) - SetGearShiftPitchDrop ( 3 0.570000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.390000 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 252.000000 ) - SetGearPitchRange ( 1 0.340000 1.710000 ) - SetGearPitchRange ( 2 0.830000 1.800000 ) - SetGearPitchRange ( 3 1.110000 1.600000 ) - SetGearPitchRange ( 4 1.350000 1.630000 ) - SetGearPitchRange ( 5 1.300000 1.540000 ) - SetDecayFinishTrim ( 0.740000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named bookb_v -{ - SetEngineClipName ( "bookb" ) - SetEngineIdleClipName ( "bookb" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "bookb_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.470000 1.070000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.790000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.380000 1.220000 ) - SetGearPitchRange ( 2 0.550000 1.260000 ) - SetGearPitchRange ( 3 0.920000 1.350000 ) - SetGearPitchRange ( 4 1.000000 1.390000 ) - SetGearPitchRange ( 5 0.850000 1.090000 ) - SetIdleEnginePitch ( 0.450000 ) - SetGearShiftPitchDrop ( 1 0.380000 ) - SetGearShiftPitchDrop ( 2 0.290000 ) - SetGearShiftPitchDrop ( 3 0.250000 ) - SetGearShiftPitchDrop ( 4 0.250000 ) - SetGearShiftPitchDrop ( 5 0.270000 ) - SetAttackTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 44 ) - SetDecayTimeMsecs ( 311.000000 ) - SetDecayFinishTrim ( 0.800000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "" ) -} -create carSoundParameters named marge_v -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "marge_car" ) - SetEngineIdleClipName ( "marge_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "marge_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.240000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.790000 ) - SetShiftPoint ( 4 0.960000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.510000 1.650000 ) - SetGearPitchRange ( 2 0.890000 1.600000 ) - SetGearPitchRange ( 3 1.260000 1.690000 ) - SetGearPitchRange ( 4 1.470000 1.560000 ) - SetGearPitchRange ( 5 1.320000 1.560000 ) - SetIdleEnginePitch ( 0.400000 ) - SetGearShiftPitchDrop ( 1 0.520000 ) - SetGearShiftPitchDrop ( 2 0.340000 ) - SetGearShiftPitchDrop ( 3 0.300000 ) - SetGearShiftPitchDrop ( 4 0.300000 ) - SetGearShiftPitchDrop ( 5 0.260000 ) - SetDecayTimeMsecs ( 155.000000 ) - SetDelayTimeMsecs ( 30 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDecayFinishTrim ( 0.750000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named carhom_v -{ - SetEngineClipName ( "carhom" ) - SetEngineIdleClipName ( "carhom" ) - SetIdleEnginePitch ( 0.360000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "carhom_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.440000 0.940000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.800000 ) - SetShiftPoint ( 4 0.970000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.570000 ) - SetGearShiftPitchDrop ( 2 0.510000 ) - SetGearShiftPitchDrop ( 3 0.650000 ) - SetGearShiftPitchDrop ( 4 0.600000 ) - SetGearShiftPitchDrop ( 5 0.350000 ) - SetGearPitchRange ( 1 0.400000 1.070000 ) - SetGearPitchRange ( 2 0.720000 1.170000 ) - SetGearPitchRange ( 3 0.850000 1.220000 ) - SetGearPitchRange ( 4 1.020000 1.170000 ) - SetGearPitchRange ( 5 0.940000 1.170000 ) - SetDecayTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 52 ) - SetAttackTimeMsecs ( 104.000000 ) - SetDecayFinishTrim ( 0.780000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named krust_v -{ - SetEngineClipName ( "krust_car" ) - SetEngineIdleClipName ( "krust_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "krust_horn" ) - SetReversePitchRange ( 0.300000 0.940000 ) - SetIdleEnginePitch ( 0.250000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.570000 ) - SetShiftPoint ( 3 0.820000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.380000 1.220000 ) - SetGearPitchRange ( 2 0.510000 1.260000 ) - SetGearPitchRange ( 3 0.870000 1.170000 ) - SetGearPitchRange ( 4 1.020000 1.150000 ) - SetGearPitchRange ( 5 1.020000 1.170000 ) - SetGearShiftPitchDrop ( 1 0.500000 ) - SetGearShiftPitchDrop ( 2 0.430000 ) - SetGearShiftPitchDrop ( 3 0.440000 ) - SetGearShiftPitchDrop ( 4 0.500000 ) - SetGearShiftPitchDrop ( 5 0.470000 ) - SetDecayTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 44 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDecayFinishTrim ( 0.640000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named bbman_v -{ - SetEngineClipName ( "bbman" ) - SetEngineIdleClipName ( "bbman" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "bbman_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.600000 0.940000 ) - SetIdleEnginePitch ( 0.390000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.800000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.350000 ) - SetGearShiftPitchDrop ( 2 0.390000 ) - SetGearShiftPitchDrop ( 3 0.450000 ) - SetGearShiftPitchDrop ( 4 0.320000 ) - SetGearShiftPitchDrop ( 5 0.360000 ) - SetGearPitchRange ( 1 0.380000 1.130000 ) - SetGearPitchRange ( 2 0.830000 1.220000 ) - SetGearPitchRange ( 3 1.020000 1.280000 ) - SetGearPitchRange ( 4 1.130000 1.240000 ) - SetGearPitchRange ( 5 1.150000 1.220000 ) - SetAttackTimeMsecs ( 74.000000 ) - SetDelayTimeMsecs ( 44 ) - SetDecayTimeMsecs ( 148.000000 ) - SetDecayFinishTrim ( 0.650000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named elect_v -{ - SetEngineClipName ( "lisa_car" ) - SetEngineIdleClipName ( "lisa_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "lisa_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.300000 0.940000 ) - SetIdleEnginePitch ( 0.350000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.340000 1.390000 ) - SetGearPitchRange ( 2 0.590000 1.390000 ) - SetGearPitchRange ( 3 0.620000 1.300000 ) - SetGearPitchRange ( 4 0.810000 1.300000 ) - SetGearPitchRange ( 5 0.980000 1.390000 ) - SetGearShiftPitchDrop ( 1 0.500000 ) - SetGearShiftPitchDrop ( 2 0.430000 ) - SetGearShiftPitchDrop ( 3 0.440000 ) - SetGearShiftPitchDrop ( 4 0.500000 ) - SetGearShiftPitchDrop ( 5 0.470000 ) - SetDecayTimeMsecs ( 30.000000 ) - SetDelayTimeMsecs ( 0 ) - SetAttackTimeMsecs ( 30.000000 ) - SetDecayFinishTrim ( 0.830000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named famil_v -{ - SetEngineClipName ( "famil" ) - SetEngineIdleClipName ( "famil" ) - SetIdleEnginePitch ( 0.460000 ) - SetHornClipName ( "famil_horn" ) - SetDamagedEngineClipName ( "fire" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.370000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.640000 ) - SetShiftPoint ( 3 0.950000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.420000 1.670000 ) - SetGearPitchRange ( 2 1.170000 1.820000 ) - SetGearPitchRange ( 3 1.450000 1.750000 ) - SetGearPitchRange ( 4 1.430000 1.690000 ) - SetGearPitchRange ( 5 1.280000 1.560000 ) - SetGearShiftPitchDrop ( 1 0.490000 ) - SetGearShiftPitchDrop ( 2 0.580000 ) - SetGearShiftPitchDrop ( 3 0.600000 ) - SetGearShiftPitchDrop ( 4 0.550000 ) - SetGearShiftPitchDrop ( 5 0.470000 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDelayTimeMsecs ( 44 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.730000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetCarDoorOpenClipName ( "famil_open" ) - SetCarDoorCloseClipName ( "famil_close" ) -} -create carSoundParameters named bart_v -{ - SetClipRPM ( 0.000000 ) - SetEngineClipName ( "bart_car" ) - SetEngineIdleClipName ( "bart_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "bart_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.800000 1.350000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.510000 ) - SetShiftPoint ( 3 0.850000 ) - SetShiftPoint ( 4 0.970000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.560000 ) - SetGearShiftPitchDrop ( 2 0.540000 ) - SetGearShiftPitchDrop ( 3 0.590000 ) - SetGearShiftPitchDrop ( 4 0.730000 ) - SetGearShiftPitchDrop ( 5 0.560000 ) - SetAttackTimeMsecs ( 96.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 303.000000 ) - SetDecayFinishTrim ( 0.770000 ) - SetGearPitchRange ( 1 0.550000 1.900000 ) - SetGearPitchRange ( 2 0.940000 1.930000 ) - SetGearPitchRange ( 3 1.200000 1.780000 ) - SetGearPitchRange ( 4 1.350000 1.730000 ) - SetGearPitchRange ( 5 1.450000 1.710000 ) - SetIdleEnginePitch ( 0.530000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named scorp_v -{ - SetEngineClipName ( "scorp" ) - SetEngineIdleClipName ( "scorp" ) - SetIdleEnginePitch ( 0.440000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "scorp_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.240000 1.070000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.930000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.810000 ) - SetGearShiftPitchDrop ( 2 0.710000 ) - SetGearShiftPitchDrop ( 3 0.660000 ) - SetGearShiftPitchDrop ( 4 0.640000 ) - SetGearShiftPitchDrop ( 5 0.610000 ) - SetGearPitchRange ( 1 0.440000 1.780000 ) - SetGearPitchRange ( 2 0.920000 1.990000 ) - SetGearPitchRange ( 3 1.300000 1.820000 ) - SetGearPitchRange ( 4 1.320000 1.860000 ) - SetGearPitchRange ( 5 0.980000 1.820000 ) - SetDecayTimeMsecs ( 311.000000 ) - SetDelayTimeMsecs ( 22 ) - SetAttackTimeMsecs ( 96.000000 ) - SetDecayFinishTrim ( 0.640000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named honor_v -{ - SetEngineClipName ( "honor" ) - SetEngineIdleClipName ( "honor" ) - SetIdleEnginePitch ( 0.620000 ) - SetHornClipName ( "honor_horn" ) - SetDamagedEngineClipName ( "fire" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.560000 1.110000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.550000 1.520000 ) - SetGearPitchRange ( 2 0.890000 1.560000 ) - SetGearPitchRange ( 3 1.220000 1.450000 ) - SetGearPitchRange ( 4 1.260000 1.350000 ) - SetGearPitchRange ( 5 1.320000 1.520000 ) - SetGearShiftPitchDrop ( 1 0.810000 ) - SetGearShiftPitchDrop ( 2 0.800000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) - SetAttackTimeMsecs ( 244.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 222.000000 ) - SetDecayFinishTrim ( 0.780000 ) - SetDownshiftDamperSize ( 0.100000 ) -} -create carSoundParameters named hbike_v -{ - SetEngineClipName ( "hbike" ) - SetEngineIdleClipName ( "hbike" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "frink_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.350000 0.810000 ) - SetIdleEnginePitch ( 0.250000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.310000 1.260000 ) - SetGearPitchRange ( 2 0.720000 1.300000 ) - SetGearPitchRange ( 3 0.870000 1.260000 ) - SetGearPitchRange ( 4 1.170000 1.220000 ) - SetGearPitchRange ( 5 1.200000 1.300000 ) - SetGearShiftPitchDrop ( 1 0.580000 ) - SetGearShiftPitchDrop ( 2 0.640000 ) - SetGearShiftPitchDrop ( 3 0.610000 ) - SetGearShiftPitchDrop ( 4 0.610000 ) - SetGearShiftPitchDrop ( 5 0.580000 ) - SetDecayTimeMsecs ( 118.000000 ) - SetDelayTimeMsecs ( 155 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDecayFinishTrim ( 0.640000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetRoadSkidClipName ( "blank" ) - SetDirtSkidClipName ( "blank" ) -} -create carSoundParameters named frink_v -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "frink" ) - SetEngineIdleClipName ( "frink" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "frink_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.280000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.690000 ) - SetGearPitchRange ( 2 0.900000 1.650000 ) - SetGearPitchRange ( 3 0.960000 1.650000 ) - SetGearPitchRange ( 4 1.260000 1.560000 ) - SetGearPitchRange ( 5 1.460000 1.530000 ) - SetIdleEnginePitch ( 0.300000 ) - SetGearShiftPitchDrop ( 1 0.470000 ) - SetGearShiftPitchDrop ( 2 0.460000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) - SetAttackTimeMsecs ( 59.000000 ) - SetDelayTimeMsecs ( 111 ) - SetDecayTimeMsecs ( 104.000000 ) - SetDecayFinishTrim ( 0.910000 ) - SetDownshiftDamperSize ( 0.100000 ) - SetRoadSkidClipName ( "frink_skid" ) - SetDirtSkidClipName ( "frink_skid" ) -} -create carSoundParameters named comic_v -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "comic_car" ) - SetEngineIdleClipName ( "comic_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "comic_horn" ) - SetIdleEnginePitch ( 0.480000 ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.520000 0.940000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.170000 ) - SetGearPitchRange ( 2 0.830000 1.150000 ) - SetGearPitchRange ( 3 1.000000 1.170000 ) - SetGearPitchRange ( 4 1.020000 1.150000 ) - SetGearPitchRange ( 5 1.070000 1.170000 ) - SetGearShiftPitchDrop ( 1 0.650000 ) - SetGearShiftPitchDrop ( 2 0.560000 ) - SetGearShiftPitchDrop ( 3 0.430000 ) - SetGearShiftPitchDrop ( 4 0.400000 ) - SetGearShiftPitchDrop ( 5 0.330000 ) - SetAttackTimeMsecs ( 104.000000 ) - SetDelayTimeMsecs ( 15 ) - SetDecayTimeMsecs ( 192.000000 ) - SetDecayFinishTrim ( 0.910000 ) - SetDownshiftDamperSize ( 0.050000 ) -} -create carSoundParameters named lisa_v -{ - SetEngineClipName ( "lisa_v_car" ) - SetEngineIdleClipName ( "lisa_v_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "lisa_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.700000 ) - SetIdleEnginePitch ( 0.320000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.510000 ) - SetShiftPoint ( 3 0.980000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.250000 1.220000 ) - SetGearPitchRange ( 2 0.550000 1.260000 ) - SetGearPitchRange ( 3 0.940000 1.370000 ) - SetGearPitchRange ( 4 1.170000 1.220000 ) - SetGearPitchRange ( 5 0.720000 1.020000 ) - SetGearShiftPitchDrop ( 1 0.600000 ) - SetGearShiftPitchDrop ( 2 0.560000 ) - SetGearShiftPitchDrop ( 3 0.460000 ) - SetGearShiftPitchDrop ( 4 0.360000 ) - SetGearShiftPitchDrop ( 5 0.330000 ) - SetDecayTimeMsecs ( 237.000000 ) - SetDelayTimeMsecs ( 30 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.820000 ) - SetDownshiftDamperSize ( 0.050000 ) -} -create carSoundParameters named smith_v -{ - SetEngineClipName ( "smith" ) - SetEngineIdleClipName ( "smith" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "smith_horn" ) - SetIdleEnginePitch ( 0.420000 ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.280000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.650000 ) - SetShiftPoint ( 3 0.930000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.170000 ) - SetGearPitchRange ( 2 0.810000 1.220000 ) - SetGearPitchRange ( 3 1.000000 1.260000 ) - SetGearPitchRange ( 4 1.170000 1.220000 ) - SetGearPitchRange ( 5 1.150000 1.260000 ) - SetGearShiftPitchDrop ( 1 0.010000 ) - SetGearShiftPitchDrop ( 2 0.640000 ) - SetGearShiftPitchDrop ( 3 0.470000 ) - SetGearShiftPitchDrop ( 4 0.500000 ) - SetGearShiftPitchDrop ( 5 0.370000 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDelayTimeMsecs ( 15 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDecayFinishTrim ( 0.800000 ) - SetDownshiftDamperSize ( 0.060000 ) - SetCarDoorOpenClipName ( "famil_open" ) - SetCarDoorCloseClipName ( "famil_close" ) - SetDecayFinishTrim ( 0.830000 ) -} -create carSoundParameters named mrplo_v -{ - SetEngineClipName ( "mrplo" ) - SetEngineIdleClipName ( "mrplo" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "mrplo_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.150000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.500000 ) - SetShiftPoint ( 3 0.960000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.530000 1.280000 ) - SetGearPitchRange ( 2 0.960000 1.430000 ) - SetGearPitchRange ( 3 1.170000 1.260000 ) - SetGearPitchRange ( 4 1.350000 1.500000 ) - SetGearPitchRange ( 5 0.980000 1.240000 ) - SetIdleEnginePitch ( 0.530000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDelayTimeMsecs ( 44 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.850000 ) - SetDownshiftDamperSize ( 0.040000 ) -} -create carSoundParameters named fone_v -{ - SetEngineClipName ( "fone" ) - SetEngineIdleClipName ( "fone" ) - SetIdleEnginePitch ( 0.560000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "fone_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.660000 1.840000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.540000 ) - SetShiftPoint ( 3 0.770000 ) - SetShiftPoint ( 4 0.940000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.670000 ) - SetGearShiftPitchDrop ( 2 0.710000 ) - SetGearShiftPitchDrop ( 3 0.850000 ) - SetGearShiftPitchDrop ( 4 0.640000 ) - SetGearShiftPitchDrop ( 5 0.660000 ) - SetGearPitchRange ( 1 0.830000 1.670000 ) - SetGearPitchRange ( 2 0.890000 1.600000 ) - SetGearPitchRange ( 3 1.240000 1.650000 ) - SetGearPitchRange ( 4 1.370000 1.650000 ) - SetGearPitchRange ( 5 1.370000 1.670000 ) - SetDecayTimeMsecs ( 89.000000 ) - SetDelayTimeMsecs ( 59 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.800000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named cletu_v -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "cletus_car" ) - SetEngineIdleClipName ( "cletus_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cletus_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.800000 1.730000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.420000 ) - SetShiftPoint ( 3 0.660000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.740000 1.520000 ) - SetGearPitchRange ( 2 0.940000 1.710000 ) - SetGearPitchRange ( 3 1.350000 1.650000 ) - SetGearPitchRange ( 4 1.390000 1.690000 ) - SetGearPitchRange ( 5 1.260000 1.600000 ) - SetIdleEnginePitch ( 0.670000 ) - SetGearShiftPitchDrop ( 1 0.560000 ) - SetGearShiftPitchDrop ( 2 0.460000 ) - SetGearShiftPitchDrop ( 3 0.460000 ) - SetGearShiftPitchDrop ( 4 0.430000 ) - SetGearShiftPitchDrop ( 5 0.340000 ) - SetAttackTimeMsecs ( 126.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 355.000000 ) - SetDecayFinishTrim ( 0.710000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named apu_v -{ - SetEngineClipName ( "apu_car" ) - SetEngineIdleClipName ( "apu_car" ) - SetIdleEnginePitch ( 0.520000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "apu_horn" ) - SetReversePitchCapKmh ( 132.220001 ) - SetReversePitchRange ( 0.500000 2.360000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.650000 ) - SetShiftPoint ( 3 0.910000 ) - SetShiftPoint ( 4 0.990000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.880000 ) - SetGearShiftPitchDrop ( 2 0.730000 ) - SetGearShiftPitchDrop ( 3 0.690000 ) - SetGearShiftPitchDrop ( 4 0.640000 ) - SetGearShiftPitchDrop ( 5 0.520000 ) - SetGearPitchRange ( 1 0.830000 2.790000 ) - SetGearPitchRange ( 2 1.280000 2.680000 ) - SetGearPitchRange ( 3 1.750000 2.480000 ) - SetGearPitchRange ( 4 1.840000 2.420000 ) - SetGearPitchRange ( 5 1.930000 2.330000 ) - SetDecayTimeMsecs ( 281.000000 ) - SetDelayTimeMsecs ( 22 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDecayFinishTrim ( 0.720000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named plowk_v -{ - SetEngineClipName ( "plowk" ) - SetEngineIdleClipName ( "plowk" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "plowk_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.430000 ) - SetShiftPoint ( 3 0.680000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.620000 1.540000 ) - SetGearPitchRange ( 2 0.830000 1.500000 ) - SetGearPitchRange ( 3 1.090000 1.520000 ) - SetGearPitchRange ( 4 1.430000 1.500000 ) - SetGearPitchRange ( 5 1.070000 1.450000 ) - SetIdleEnginePitch ( 0.610000 ) - SetGearShiftPitchDrop ( 1 0.490000 ) - SetGearShiftPitchDrop ( 2 0.440000 ) - SetGearShiftPitchDrop ( 3 0.520000 ) - SetGearShiftPitchDrop ( 4 0.460000 ) - SetGearShiftPitchDrop ( 5 0.520000 ) - SetAttackTimeMsecs ( 141.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 370.000000 ) - SetDecayFinishTrim ( 0.690000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named wiggu_v -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "wiggum_car" ) - SetEngineIdleClipName ( "wiggum_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "siren" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.380000 1.070000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.570000 ) - SetShiftPoint ( 3 0.820000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.530000 ) - SetGearShiftPitchDrop ( 2 0.450000 ) - SetGearShiftPitchDrop ( 3 0.580000 ) - SetGearShiftPitchDrop ( 4 0.470000 ) - SetGearShiftPitchDrop ( 5 0.440000 ) - SetGearPitchRange ( 1 0.340000 1.150000 ) - SetGearPitchRange ( 2 0.660000 1.170000 ) - SetGearPitchRange ( 3 0.940000 1.220000 ) - SetGearPitchRange ( 4 1.050000 1.150000 ) - SetGearPitchRange ( 5 1.170000 1.200000 ) - SetIdleEnginePitch ( 0.280000 ) - SetDownshiftDamperSize ( 0.030000 ) - SetDelayTimeMsecs ( 15 ) - SetDecayTimeMsecs ( 252.000000 ) - SetAttackTimeMsecs ( 104.000000 ) - SetDecayFinishTrim ( 0.830000 ) -} -create carSoundParameters named otto_v -{ - SetEngineClipName ( "otto" ) - SetEngineIdleClipName ( "otto" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "otto_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.850000 ) - SetIdleEnginePitch ( 0.450000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.460000 ) - SetShiftPoint ( 3 0.690000 ) - SetShiftPoint ( 4 0.960000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.440000 1.110000 ) - SetGearPitchRange ( 2 0.620000 1.170000 ) - SetGearPitchRange ( 3 0.920000 1.260000 ) - SetGearPitchRange ( 4 1.130000 1.240000 ) - SetGearPitchRange ( 5 1.150000 1.200000 ) - SetGearShiftPitchDrop ( 1 0.360000 ) - SetGearShiftPitchDrop ( 2 0.310000 ) - SetGearShiftPitchDrop ( 3 0.380000 ) - SetGearShiftPitchDrop ( 4 0.310000 ) - SetGearShiftPitchDrop ( 5 0.190000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 15 ) - SetDecayTimeMsecs ( 400.000000 ) - SetDecayFinishTrim ( 0.790000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named moe_v -{ - SetEngineClipName ( "moe" ) - SetEngineIdleClipName ( "moe" ) - SetHornClipName ( "moe_horn" ) - SetDamagedEngineClipName ( "fire" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.410000 1.280000 ) - SetIdleEnginePitch ( 0.450000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.650000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.470000 1.280000 ) - SetGearPitchRange ( 2 0.920000 1.370000 ) - SetGearPitchRange ( 3 1.220000 1.500000 ) - SetGearPitchRange ( 4 1.260000 1.390000 ) - SetGearPitchRange ( 5 1.070000 1.430000 ) - SetGearShiftPitchDrop ( 1 0.490000 ) - SetGearShiftPitchDrop ( 2 0.580000 ) - SetGearShiftPitchDrop ( 3 0.600000 ) - SetGearShiftPitchDrop ( 4 0.550000 ) - SetGearShiftPitchDrop ( 5 0.470000 ) - SetDecayTimeMsecs ( 274.000000 ) - SetDelayTimeMsecs ( 30 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDecayFinishTrim ( 0.870000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetCarDoorOpenClipName ( "famil_open" ) - SetCarDoorCloseClipName ( "famil_close" ) -} -create carSoundParameters named skinn_v -{ - SetEngineClipName ( "skinn" ) - SetEngineIdleClipName ( "skinn" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "skinn_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.810000 ) - SetIdleEnginePitch ( 0.320000 ) - SetGearPitchRange ( 1 0.340000 0.940000 ) - SetGearPitchRange ( 2 0.570000 1.070000 ) - SetGearPitchRange ( 3 0.790000 1.020000 ) - SetGearPitchRange ( 4 0.920000 1.000000 ) - SetGearPitchRange ( 5 0.940000 1.090000 ) - SetGearShiftPitchDrop ( 1 0.330000 ) - SetGearShiftPitchDrop ( 2 0.310000 ) - SetGearShiftPitchDrop ( 3 0.320000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.350000 ) - SetDecayTimeMsecs ( 215.000000 ) - SetDelayTimeMsecs ( 15 ) - SetAttackTimeMsecs ( 59.000000 ) - SetDecayFinishTrim ( 0.820000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetCarDoorOpenClipName ( "famil_open" ) - SetCarDoorCloseClipName ( "famil_close" ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 0.820000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) -} -create carSoundParameters named homer_v -{ - SetEngineClipName ( "homer_car" ) - SetEngineIdleClipName ( "homer_car" ) - SetIdleEnginePitch ( 0.300000 ) - SetHornClipName ( "homer_horn" ) - SetDamagedEngineClipName ( "fire" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.330000 0.890000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.650000 ) - SetShiftPoint ( 3 0.945000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.270000 1.130000 ) - SetGearPitchRange ( 2 0.590000 1.150000 ) - SetGearPitchRange ( 3 0.870000 1.050000 ) - SetGearPitchRange ( 4 0.960000 1.090000 ) - SetGearPitchRange ( 5 1.020000 1.150000 ) - SetGearShiftPitchDrop ( 1 0.560000 ) - SetGearShiftPitchDrop ( 2 0.500000 ) - SetGearShiftPitchDrop ( 3 0.510000 ) - SetGearShiftPitchDrop ( 4 0.380000 ) - SetGearShiftPitchDrop ( 5 0.360000 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDelayTimeMsecs ( 30 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDecayFinishTrim ( 0.790000 ) - SetDownshiftDamperSize ( 0.100000 ) -} -create carSoundParameters named zombi_v -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "zombi" ) - SetEngineIdleClipName ( "zombi" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "zombi_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.240000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.930000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.530000 1.970000 ) - SetGearPitchRange ( 2 0.940000 1.990000 ) - SetGearPitchRange ( 3 1.300000 1.820000 ) - SetGearPitchRange ( 4 1.500000 1.780000 ) - SetGearPitchRange ( 5 1.370000 1.650000 ) - SetIdleEnginePitch ( 0.560000 ) - SetGearShiftPitchDrop ( 1 0.670000 ) - SetGearShiftPitchDrop ( 2 0.760000 ) - SetGearShiftPitchDrop ( 3 0.730000 ) - SetGearShiftPitchDrop ( 4 0.610000 ) - SetGearShiftPitchDrop ( 5 0.620000 ) - SetDecayTimeMsecs ( 266.000000 ) - SetDelayTimeMsecs ( 22 ) - SetAttackTimeMsecs ( 104.000000 ) - SetDecayFinishTrim ( 0.740000 ) - SetDownshiftDamperSize ( 0.090000 ) -} -create carSoundParameters named burns_v -{ - SetEngineClipName ( "burns" ) - SetEngineIdleClipName ( "burns" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "burns_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.380000 1.110000 ) - SetIdleEnginePitch ( 0.440000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.460000 ) - SetShiftPoint ( 3 0.710000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.490000 1.350000 ) - SetGearPitchRange ( 2 0.720000 1.410000 ) - SetGearPitchRange ( 3 1.000000 1.520000 ) - SetGearPitchRange ( 4 1.350000 1.470000 ) - SetGearPitchRange ( 5 0.890000 1.320000 ) - SetGearShiftPitchDrop ( 1 0.410000 ) - SetGearShiftPitchDrop ( 2 0.380000 ) - SetGearShiftPitchDrop ( 3 0.470000 ) - SetGearShiftPitchDrop ( 4 0.390000 ) - SetGearShiftPitchDrop ( 5 0.430000 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 311.000000 ) - SetDecayFinishTrim ( 0.710000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named willi_v -{ - SetEngineClipName ( "willi" ) - SetEngineIdleClipName ( "willi" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "willi_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.980000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.870000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.440000 0.960000 ) - SetGearPitchRange ( 2 0.590000 1.070000 ) - SetGearPitchRange ( 3 0.790000 1.110000 ) - SetGearPitchRange ( 4 1.000000 1.130000 ) - SetGearPitchRange ( 5 1.170000 1.270000 ) - SetIdleEnginePitch ( 0.420000 ) - SetGearShiftPitchDrop ( 1 0.530000 ) - SetGearShiftPitchDrop ( 2 0.500000 ) - SetGearShiftPitchDrop ( 3 0.550000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.440000 ) - SetAttackTimeMsecs ( 104.000000 ) - SetDelayTimeMsecs ( 59 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.790000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named gramp_v -{ - SetEngineClipName ( "gramp" ) - SetEngineIdleClipName ( "gramp" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "gramp_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.300000 1.320000 ) - SetIdleEnginePitch ( 0.630000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.480000 ) - SetShiftPoint ( 3 0.760000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.640000 1.600000 ) - SetGearPitchRange ( 2 0.850000 1.860000 ) - SetGearPitchRange ( 3 1.430000 2.030000 ) - SetGearPitchRange ( 4 1.630000 1.860000 ) - SetGearPitchRange ( 5 0.890000 1.220000 ) - SetGearShiftPitchDrop ( 1 0.500000 ) - SetGearShiftPitchDrop ( 2 0.430000 ) - SetGearShiftPitchDrop ( 3 0.440000 ) - SetGearShiftPitchDrop ( 4 0.500000 ) - SetGearShiftPitchDrop ( 5 0.470000 ) - SetDecayTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 30 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.700000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named gramR_v -{ - SetEngineClipName ( "gramR" ) - SetEngineIdleClipName ( "gramR" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "gramR_horn" ) - SetOverlayClipName ( "rocket" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.300000 1.410000 ) - SetIdleEnginePitch ( 0.630000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.480000 ) - SetShiftPoint ( 3 0.760000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.640000 1.780000 ) - SetGearPitchRange ( 2 1.020000 1.860000 ) - SetGearPitchRange ( 3 1.520000 2.290000 ) - SetGearPitchRange ( 4 1.540000 1.860000 ) - SetGearPitchRange ( 5 0.890000 1.220000 ) - SetGearShiftPitchDrop ( 1 0.500000 ) - SetGearShiftPitchDrop ( 2 0.430000 ) - SetGearShiftPitchDrop ( 3 0.440000 ) - SetGearShiftPitchDrop ( 4 0.500000 ) - SetGearShiftPitchDrop ( 5 0.470000 ) - SetDecayTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 30 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.700000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named atv_v -{ - SetEngineClipName ( "atv_car" ) - SetEngineIdleClipName ( "atv_car" ) - SetIdleEnginePitch ( 0.420000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "atv_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.690000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.880000 ) - SetGearShiftPitchDrop ( 2 0.850000 ) - SetGearShiftPitchDrop ( 3 0.790000 ) - SetGearShiftPitchDrop ( 4 0.810000 ) - SetGearShiftPitchDrop ( 5 0.600000 ) - SetDecayTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 30 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDecayFinishTrim ( 0.870000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetGearPitchRange ( 1 0.960000 2.270000 ) - SetGearPitchRange ( 2 1.580000 2.050000 ) - SetGearPitchRange ( 3 1.750000 2.030000 ) - SetGearPitchRange ( 4 1.220000 1.750000 ) - SetGearPitchRange ( 5 1.450000 2.050000 ) -} -create carSoundParameters named knigh_v -{ - SetEngineClipName ( "knigh_v_car" ) - SetEngineIdleClipName ( "knigh_v_car" ) - SetIdleEnginePitch ( 0.520000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "knigh_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 0.870000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.880000 ) - SetGearShiftPitchDrop ( 2 0.850000 ) - SetGearShiftPitchDrop ( 3 0.790000 ) - SetGearShiftPitchDrop ( 4 0.810000 ) - SetGearShiftPitchDrop ( 5 0.600000 ) - SetGearPitchRange ( 1 0.790000 1.970000 ) - SetGearPitchRange ( 2 1.070000 1.820000 ) - SetGearPitchRange ( 3 1.240000 1.930000 ) - SetGearPitchRange ( 4 1.450000 1.900000 ) - SetGearPitchRange ( 5 1.580000 1.860000 ) - SetDecayTimeMsecs ( 74.000000 ) - SetDelayTimeMsecs ( 15 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.950000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named mono_v -{ - SetEngineClipName ( "mono_v_car" ) - SetEngineIdleClipName ( "mono_v_car" ) - SetIdleEnginePitch ( 0.620000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "mono_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.150000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 0.870000 ) - SetShiftPoint ( 4 0.960000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.880000 ) - SetGearShiftPitchDrop ( 2 0.850000 ) - SetGearShiftPitchDrop ( 3 0.790000 ) - SetGearShiftPitchDrop ( 4 0.810000 ) - SetGearShiftPitchDrop ( 5 0.600000 ) - SetGearPitchRange ( 1 0.700000 1.370000 ) - SetGearPitchRange ( 2 0.530000 1.260000 ) - SetGearPitchRange ( 3 0.850000 1.350000 ) - SetGearPitchRange ( 4 0.920000 1.370000 ) - SetGearPitchRange ( 5 1.020000 1.500000 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDelayTimeMsecs ( 81 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.680000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "generator" ) - SetRoadSkidClipName ( "monorail_skid" ) - SetDirtSkidClipName ( "blank" ) -} -create carSoundParameters named oblit_v -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "oblit_v_car" ) - SetEngineIdleClipName ( "oblit_v_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "oblit_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.370000 ) - SetIdleEnginePitch ( 0.420000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.530000 2.180000 ) - SetGearPitchRange ( 2 0.830000 1.930000 ) - SetGearPitchRange ( 3 1.110000 1.930000 ) - SetGearPitchRange ( 4 1.280000 1.710000 ) - SetGearPitchRange ( 5 1.240000 1.800000 ) - SetGearShiftPitchDrop ( 1 0.440000 ) - SetGearShiftPitchDrop ( 2 0.560000 ) - SetGearShiftPitchDrop ( 3 0.580000 ) - SetGearShiftPitchDrop ( 4 0.500000 ) - SetGearShiftPitchDrop ( 5 0.530000 ) - SetDecayTimeMsecs ( 311.000000 ) - SetDelayTimeMsecs ( 59 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDecayFinishTrim ( 0.790000 ) - SetDownshiftDamperSize ( 0.100000 ) -} -create carSoundParameters named hype_v -{ - SetEngineClipName ( "hype_v_car" ) - SetEngineIdleClipName ( "hype_v_car" ) - SetIdleEnginePitch ( 0.290000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "hype_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.070000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.680000 ) - SetShiftPoint ( 3 0.940000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.440000 ) - SetGearShiftPitchDrop ( 2 0.450000 ) - SetGearShiftPitchDrop ( 3 0.470000 ) - SetGearShiftPitchDrop ( 4 0.390000 ) - SetGearShiftPitchDrop ( 5 0.300000 ) - SetDecayTimeMsecs ( 237.000000 ) - SetDelayTimeMsecs ( 22 ) - SetAttackTimeMsecs ( 59.000000 ) - SetDecayFinishTrim ( 0.740000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetGearPitchRange ( 1 0.290000 1.350000 ) - SetGearPitchRange ( 2 0.680000 1.390000 ) - SetGearPitchRange ( 3 1.090000 1.300000 ) - SetGearPitchRange ( 4 1.200000 1.350000 ) - SetGearPitchRange ( 5 0.980000 1.130000 ) -} -create carSoundParameters named dune_v -{ - SetEngineClipName ( "dune_v_car" ) - SetEngineIdleClipName ( "blank" ) - SetIdleEnginePitch ( 0.010000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "dune_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.800000 2.010000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.760000 ) - SetGearShiftPitchDrop ( 2 0.670000 ) - SetGearShiftPitchDrop ( 3 0.660000 ) - SetGearShiftPitchDrop ( 4 0.640000 ) - SetGearShiftPitchDrop ( 5 0.600000 ) - SetGearPitchRange ( 1 1.260000 2.480000 ) - SetGearPitchRange ( 2 1.280000 2.160000 ) - SetGearPitchRange ( 3 1.540000 2.210000 ) - SetGearPitchRange ( 4 1.670000 2.290000 ) - SetGearPitchRange ( 5 1.630000 2.330000 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDelayTimeMsecs ( 22 ) - SetAttackTimeMsecs ( 148.000000 ) - SetDecayFinishTrim ( 0.680000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named rocke_v -{ - SetEngineClipName ( "rocke_v_car" ) - SetEngineIdleClipName ( "rocke_v_car" ) - SetIdleEnginePitch ( 0.390000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "rocke_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 0.870000 ) - SetShiftPoint ( 4 0.960000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.880000 ) - SetGearShiftPitchDrop ( 2 0.850000 ) - SetGearShiftPitchDrop ( 3 0.790000 ) - SetGearShiftPitchDrop ( 4 0.810000 ) - SetGearShiftPitchDrop ( 5 0.600000 ) - SetGearPitchRange ( 1 0.530000 1.800000 ) - SetGearPitchRange ( 2 1.280000 1.900000 ) - SetGearPitchRange ( 3 1.370000 1.690000 ) - SetGearPitchRange ( 4 1.450000 1.690000 ) - SetGearPitchRange ( 5 1.580000 1.950000 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDelayTimeMsecs ( 81 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.680000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named cArmor -{ - SetEngineClipName ( "cArmor_car" ) - SetEngineIdleClipName ( "cArmor_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cArmor_car_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.320000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.440000 ) - SetShiftPoint ( 3 0.790000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.660000 1.430000 ) - SetGearPitchRange ( 2 0.940000 1.470000 ) - SetGearPitchRange ( 3 1.220000 1.390000 ) - SetGearPitchRange ( 4 1.260000 1.390000 ) - SetGearPitchRange ( 5 1.020000 1.350000 ) - SetIdleEnginePitch ( 0.610000 ) - SetGearShiftPitchDrop ( 1 0.400000 ) - SetGearShiftPitchDrop ( 2 0.460000 ) - SetGearShiftPitchDrop ( 3 0.430000 ) - SetGearShiftPitchDrop ( 4 0.390000 ) - SetGearShiftPitchDrop ( 5 0.490000 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDelayTimeMsecs ( 81 ) - SetAttackTimeMsecs ( 59.000000 ) - SetDecayFinishTrim ( 0.720000 ) -} -create carSoundParameters named cCellA -{ - SetEngineClipName ( "cCellA_v" ) - SetEngineIdleClipName ( "cCellA_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCellA_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.020000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.130000 ) - SetGearPitchRange ( 2 0.680000 1.170000 ) - SetGearPitchRange ( 3 0.980000 1.130000 ) - SetGearPitchRange ( 4 1.090000 1.220000 ) - SetGearPitchRange ( 5 0.980000 1.220000 ) - SetIdleEnginePitch ( 0.480000 ) - SetGearShiftPitchDrop ( 1 0.550000 ) - SetGearShiftPitchDrop ( 2 0.470000 ) - SetGearShiftPitchDrop ( 3 0.560000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 22 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDecayFinishTrim ( 0.940000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "cCellA_overlay" ) -} -create carSoundParameters named cCellB -{ - SetEngineClipName ( "cCellB_v" ) - SetEngineIdleClipName ( "cCellB_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCellB_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.020000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.130000 ) - SetGearPitchRange ( 2 0.680000 1.170000 ) - SetGearPitchRange ( 3 0.980000 1.130000 ) - SetGearPitchRange ( 4 1.090000 1.220000 ) - SetGearPitchRange ( 5 0.980000 1.220000 ) - SetIdleEnginePitch ( 0.480000 ) - SetGearShiftPitchDrop ( 1 0.550000 ) - SetGearShiftPitchDrop ( 2 0.470000 ) - SetGearShiftPitchDrop ( 3 0.560000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 22 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDecayFinishTrim ( 0.940000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "cCellB_overlay" ) -} -create carSoundParameters named cCellC -{ - SetEngineClipName ( "cCellC_v" ) - SetEngineIdleClipName ( "cCellC_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCellC_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.020000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.130000 ) - SetGearPitchRange ( 2 0.680000 1.170000 ) - SetGearPitchRange ( 3 0.980000 1.130000 ) - SetGearPitchRange ( 4 1.090000 1.220000 ) - SetGearPitchRange ( 5 0.980000 1.220000 ) - SetIdleEnginePitch ( 0.480000 ) - SetGearShiftPitchDrop ( 1 0.550000 ) - SetGearShiftPitchDrop ( 2 0.470000 ) - SetGearShiftPitchDrop ( 3 0.560000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 22 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDecayFinishTrim ( 0.940000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "cCellC_overlay" ) -} -create carSoundParameters named cCellD -{ - SetEngineClipName ( "cCellD_v" ) - SetEngineIdleClipName ( "cCellD_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCellD_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.020000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.130000 ) - SetGearPitchRange ( 2 0.680000 1.170000 ) - SetGearPitchRange ( 3 0.980000 1.130000 ) - SetGearPitchRange ( 4 1.090000 1.220000 ) - SetGearPitchRange ( 5 0.980000 1.220000 ) - SetIdleEnginePitch ( 0.480000 ) - SetGearShiftPitchDrop ( 1 0.550000 ) - SetGearShiftPitchDrop ( 2 0.470000 ) - SetGearShiftPitchDrop ( 3 0.560000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 22 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDecayFinishTrim ( 0.940000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "cCellD_overlay" ) -} -create carSoundParameters named cSedan -{ - SetEngineClipName ( "cSedan_car" ) - SetEngineIdleClipName ( "cSedan_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "siren" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.070000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.260000 ) - SetGearPitchRange ( 2 0.810000 1.350000 ) - SetGearPitchRange ( 3 1.050000 1.170000 ) - SetGearPitchRange ( 4 1.130000 1.260000 ) - SetGearPitchRange ( 5 1.200000 1.260000 ) - SetIdleEnginePitch ( 0.380000 ) - SetGearShiftPitchDrop ( 1 0.650000 ) - SetGearShiftPitchDrop ( 2 0.620000 ) - SetGearShiftPitchDrop ( 3 0.510000 ) - SetGearShiftPitchDrop ( 4 0.560000 ) - SetGearShiftPitchDrop ( 5 0.650000 ) - SetAttackTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 22 ) - SetDecayTimeMsecs ( 296.000000 ) - SetDecayFinishTrim ( 0.820000 ) -} -create carSoundParameters named cCola -{ - SetEngineClipName ( "cCola_car" ) - SetEngineIdleClipName ( "cCola_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCola_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.020000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.770000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.620000 1.370000 ) - SetGearPitchRange ( 2 0.870000 1.470000 ) - SetGearPitchRange ( 3 1.110000 1.390000 ) - SetGearPitchRange ( 4 1.220000 1.370000 ) - SetGearPitchRange ( 5 1.050000 1.370000 ) - SetIdleEnginePitch ( 0.560000 ) - SetGearShiftPitchDrop ( 1 0.420000 ) - SetGearShiftPitchDrop ( 2 0.400000 ) - SetGearShiftPitchDrop ( 3 0.370000 ) - SetGearShiftPitchDrop ( 4 0.300000 ) - SetGearShiftPitchDrop ( 5 0.370000 ) - SetAttackTimeMsecs ( 170.000000 ) - SetDelayTimeMsecs ( 67 ) - SetDecayTimeMsecs ( 355.000000 ) - SetDecayFinishTrim ( 0.820000 ) - SetDownshiftDamperSize ( 0.080000 ) -} -create carSoundParameters named cCube -{ - SetEngineClipName ( "cCube_v" ) - SetEngineIdleClipName ( "cCube_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCube_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetIdleEnginePitch ( 0.810000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 0.870000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.830000 1.710000 ) - SetGearPitchRange ( 2 1.130000 1.820000 ) - SetGearPitchRange ( 3 1.300000 1.840000 ) - SetGearPitchRange ( 4 1.520000 1.800000 ) - SetGearPitchRange ( 5 1.280000 1.670000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 67 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.080000 ) -} -create carSoundParameters named cCurator -{ - SetEngineClipName ( "cCurator_car" ) - SetEngineIdleClipName ( "cCurator_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCurator_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.320000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.650000 ) - SetShiftPoint ( 3 0.960000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.490000 1.220000 ) - SetGearPitchRange ( 2 0.680000 1.300000 ) - SetGearPitchRange ( 3 0.960000 1.220000 ) - SetGearPitchRange ( 4 1.130000 1.260000 ) - SetGearPitchRange ( 5 1.110000 1.220000 ) - SetIdleEnginePitch ( 0.420000 ) - SetGearShiftPitchDrop ( 1 0.580000 ) - SetGearShiftPitchDrop ( 2 0.500000 ) - SetGearShiftPitchDrop ( 3 0.490000 ) - SetGearShiftPitchDrop ( 4 0.400000 ) - SetGearShiftPitchDrop ( 5 0.560000 ) - SetAttackTimeMsecs ( 126.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.810000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named cDonut -{ - SetEngineClipName ( "cDonut_car" ) - SetEngineIdleClipName ( "cDonut_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cDonut_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.580000 1.100000 ) - SetIdleEnginePitch ( 0.560000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.650000 ) - SetShiftPoint ( 3 0.980000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.620000 1.450000 ) - SetGearPitchRange ( 2 0.920000 1.580000 ) - SetGearPitchRange ( 3 1.350000 1.520000 ) - SetGearPitchRange ( 4 1.350000 1.430000 ) - SetGearPitchRange ( 5 1.170000 1.320000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 67 ) - SetDecayTimeMsecs ( 281.000000 ) - SetDecayFinishTrim ( 0.770000 ) - SetDownshiftDamperSize ( 0.070000 ) -} -create carSoundParameters named cDuff -{ - SetEngineClipName ( "cDuff_car" ) - SetEngineIdleClipName ( "cDuff_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cDuff_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.240000 ) - SetIdleEnginePitch ( 0.620000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.500000 ) - SetShiftPoint ( 3 0.760000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.620000 1.880000 ) - SetGearPitchRange ( 2 1.220000 1.800000 ) - SetGearPitchRange ( 3 1.410000 1.750000 ) - SetGearPitchRange ( 4 1.470000 1.800000 ) - SetGearPitchRange ( 5 1.240000 1.450000 ) - SetGearShiftPitchDrop ( 1 0.410000 ) - SetGearShiftPitchDrop ( 2 0.360000 ) - SetGearShiftPitchDrop ( 3 0.490000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.430000 ) - SetAttackTimeMsecs ( 111.000000 ) - SetDelayTimeMsecs ( 81 ) - SetDecayTimeMsecs ( 296.000000 ) - SetDecayFinishTrim ( 0.810000 ) - SetDownshiftDamperSize ( 0.050000 ) -} -create carSoundParameters named cBlbart -{ - SetClipRPM ( 0.000000 ) - SetEngineClipName ( "bart_car" ) - SetEngineIdleClipName ( "bart_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "bart_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.800000 1.350000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.510000 ) - SetShiftPoint ( 3 0.850000 ) - SetShiftPoint ( 4 0.970000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.560000 ) - SetGearShiftPitchDrop ( 2 0.540000 ) - SetGearShiftPitchDrop ( 3 0.590000 ) - SetGearShiftPitchDrop ( 4 0.730000 ) - SetGearShiftPitchDrop ( 5 0.560000 ) - SetAttackTimeMsecs ( 96.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 303.000000 ) - SetDecayFinishTrim ( 0.770000 ) - SetGearPitchRange ( 1 0.550000 1.900000 ) - SetGearPitchRange ( 2 0.940000 1.930000 ) - SetGearPitchRange ( 3 1.200000 1.780000 ) - SetGearPitchRange ( 4 1.350000 1.730000 ) - SetGearPitchRange ( 5 1.450000 1.710000 ) - SetIdleEnginePitch ( 0.530000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named cHears -{ - SetEngineClipName ( "cHears_car" ) - SetEngineIdleClipName ( "cHears_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "siren" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.200000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.940000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.300000 ) - SetGearPitchRange ( 2 0.810000 1.430000 ) - SetGearPitchRange ( 3 1.090000 1.390000 ) - SetGearPitchRange ( 4 1.220000 1.390000 ) - SetGearPitchRange ( 5 1.280000 1.390000 ) - SetIdleEnginePitch ( 0.410000 ) - SetGearShiftPitchDrop ( 1 0.510000 ) - SetGearShiftPitchDrop ( 2 0.610000 ) - SetGearShiftPitchDrop ( 3 0.500000 ) - SetGearShiftPitchDrop ( 4 0.490000 ) - SetGearShiftPitchDrop ( 5 0.590000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 281.000000 ) - SetDecayFinishTrim ( 0.770000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named cKlimo -{ - SetEngineClipName ( "cKlimo_car" ) - SetEngineIdleClipName ( "cKlimo_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cKlimo_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.330000 0.920000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.960000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.310000 0.960000 ) - SetGearPitchRange ( 2 0.550000 1.110000 ) - SetGearPitchRange ( 3 0.830000 1.090000 ) - SetGearPitchRange ( 4 1.000000 1.090000 ) - SetGearPitchRange ( 5 0.810000 1.050000 ) - SetIdleEnginePitch ( 0.180000 ) - SetGearShiftPitchDrop ( 1 0.390000 ) - SetGearShiftPitchDrop ( 2 0.470000 ) - SetGearShiftPitchDrop ( 3 0.310000 ) - SetGearShiftPitchDrop ( 4 0.310000 ) - SetGearShiftPitchDrop ( 5 0.390000 ) - SetAttackTimeMsecs ( 148.000000 ) - SetDelayTimeMsecs ( 59 ) - SetDecayTimeMsecs ( 237.000000 ) - SetDecayFinishTrim ( 0.820000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named cLimo -{ - SetEngineClipName ( "cLimo_car" ) - SetEngineIdleClipName ( "cLimo_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cLimo_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.940000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.965000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.440000 1.170000 ) - SetGearPitchRange ( 2 0.740000 1.220000 ) - SetGearPitchRange ( 3 1.020000 1.130000 ) - SetGearPitchRange ( 4 0.960000 1.090000 ) - SetGearPitchRange ( 5 1.020000 1.130000 ) - SetIdleEnginePitch ( 0.390000 ) - SetGearShiftPitchDrop ( 1 0.370000 ) - SetGearShiftPitchDrop ( 2 0.410000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.370000 ) - SetDownshiftDamperSize ( 0.060000 ) - SetDelayTimeMsecs ( 15 ) - SetDecayTimeMsecs ( 148.000000 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDecayFinishTrim ( 0.820000 ) -} -create carSoundParameters named cMilk -{ - SetEngineClipName ( "cMilk_v" ) - SetEngineIdleClipName ( "cMilk_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cMilk_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.980000 ) - SetIdleEnginePitch ( 0.380000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.520000 ) - SetShiftPoint ( 3 0.780000 ) - SetShiftPoint ( 4 0.970000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.200000 ) - SetGearPitchRange ( 2 0.740000 1.220000 ) - SetGearPitchRange ( 3 0.980000 1.350000 ) - SetGearPitchRange ( 4 1.090000 1.320000 ) - SetGearPitchRange ( 5 1.020000 1.370000 ) - SetGearShiftPitchDrop ( 1 0.530000 ) - SetGearShiftPitchDrop ( 2 0.510000 ) - SetGearShiftPitchDrop ( 3 0.490000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.430000 ) - SetAttackTimeMsecs ( 170.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 266.000000 ) - SetDecayFinishTrim ( 0.790000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named cNerd -{ - SetEngineClipName ( "cNerd_car" ) - SetEngineIdleClipName ( "cNerd_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cNerd_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.630000 ) - SetShiftPoint ( 3 0.920000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.640000 2.030000 ) - SetGearPitchRange ( 2 1.200000 2.210000 ) - SetGearPitchRange ( 3 1.560000 2.160000 ) - SetGearPitchRange ( 4 1.260000 2.160000 ) - SetGearPitchRange ( 5 1.460000 2.080000 ) - SetIdleEnginePitch ( 0.670000 ) - SetGearShiftPitchDrop ( 1 0.640000 ) - SetGearShiftPitchDrop ( 2 0.570000 ) - SetGearShiftPitchDrop ( 3 0.430000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) - SetAttackTimeMsecs ( 155.000000 ) - SetDelayTimeMsecs ( 22 ) - SetDecayTimeMsecs ( 237.000000 ) - SetDecayFinishTrim ( 0.840000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named cNonup -{ - SetEngineClipName ( "cNonupV" ) - SetEngineIdleClipName ( "cNonupV" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cNonupV_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.770000 ) - SetShiftPoint ( 4 0.940000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.000000 ) - SetGearPitchRange ( 2 0.550000 1.130000 ) - SetGearPitchRange ( 3 0.740000 1.170000 ) - SetGearPitchRange ( 4 0.920000 1.050000 ) - SetGearPitchRange ( 5 1.240000 1.270000 ) - SetIdleEnginePitch ( 0.380000 ) - SetGearShiftPitchDrop ( 1 0.610000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.560000 ) - SetGearShiftPitchDrop ( 4 0.460000 ) - SetGearShiftPitchDrop ( 5 0.390000 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDelayTimeMsecs ( 67 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.830000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named cPolice -{ - SetEngineClipName ( "cPolice_car" ) - SetEngineIdleClipName ( "cPolice_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "siren" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.380000 1.070000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.570000 ) - SetShiftPoint ( 3 0.820000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.530000 ) - SetGearShiftPitchDrop ( 2 0.450000 ) - SetGearShiftPitchDrop ( 3 0.580000 ) - SetGearShiftPitchDrop ( 4 0.470000 ) - SetGearShiftPitchDrop ( 5 0.440000 ) - SetGearPitchRange ( 1 0.340000 1.150000 ) - SetGearPitchRange ( 2 0.660000 1.170000 ) - SetGearPitchRange ( 3 0.940000 1.220000 ) - SetGearPitchRange ( 4 1.050000 1.150000 ) - SetGearPitchRange ( 5 1.170000 1.200000 ) - SetIdleEnginePitch ( 0.280000 ) - SetDownshiftDamperSize ( 0.030000 ) - SetDelayTimeMsecs ( 15 ) - SetDecayTimeMsecs ( 252.000000 ) - SetAttackTimeMsecs ( 104.000000 ) - SetDecayFinishTrim ( 0.830000 ) -} -create carSoundParameters named cVan -{ - SetClipRPM ( 3000.000000 ) - SetEngineClipName ( "cVan_car" ) - SetEngineIdleClipName ( "cVan_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cVan_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.945000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.300000 ) - SetGearPitchRange ( 2 0.850000 1.390000 ) - SetGearPitchRange ( 3 1.090000 1.300000 ) - SetGearPitchRange ( 4 1.220000 1.390000 ) - SetGearPitchRange ( 5 1.240000 1.350000 ) - SetIdleEnginePitch ( 0.360000 ) - SetGearShiftPitchDrop ( 1 0.800000 ) - SetGearShiftPitchDrop ( 2 0.800000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) - SetDownshiftDamperSize ( 0.030000 ) - SetDelayTimeMsecs ( 15 ) - SetDecayTimeMsecs ( 192.000000 ) - SetAttackTimeMsecs ( 118.000000 ) - SetDecayFinishTrim ( 0.690000 ) - SetOverlayClipName ( "cVan_overlay" ) -} -create carSoundParameters named huskA -{ - SetEngineClipName ( "huskaV" ) - SetEngineIdleClipName ( "blank" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "huskaV_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.940000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.640000 1.070000 ) - SetGearPitchRange ( 2 0.530000 0.960000 ) - SetGearPitchRange ( 3 0.700000 1.090000 ) - SetGearPitchRange ( 4 0.740000 1.070000 ) - SetGearPitchRange ( 5 0.850000 1.070000 ) - SetIdleEnginePitch ( 0.140000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 81 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetRoadSkidClipName ( "huskaV_skid" ) - SetDirtSkidClipName ( "huskaV_skid" ) -} -create carSoundParameters named compactA -{ - SetEngineClipName ( "compactA_car" ) - SetEngineIdleClipName ( "compactA_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "compactA_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.910000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.660000 1.220000 ) - SetGearPitchRange ( 2 0.770000 1.170000 ) - SetGearPitchRange ( 3 0.920000 1.220000 ) - SetGearPitchRange ( 4 1.090000 1.220000 ) - SetGearPitchRange ( 5 1.070000 1.170000 ) - SetIdleEnginePitch ( 0.590000 ) - SetGearShiftPitchDrop ( 1 0.560000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.500000 ) - SetGearShiftPitchDrop ( 4 0.520000 ) - SetGearShiftPitchDrop ( 5 0.470000 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDelayTimeMsecs ( 67 ) - SetDecayTimeMsecs ( 237.000000 ) - SetDecayFinishTrim ( 0.900000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named minivanA -{ - SetEngineClipName ( "minivanA_v" ) - SetEngineIdleClipName ( "minivanA_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "minivanA_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.300000 ) - SetGearPitchRange ( 2 0.770000 1.350000 ) - SetGearPitchRange ( 3 1.050000 1.260000 ) - SetGearPitchRange ( 4 1.090000 1.300000 ) - SetGearPitchRange ( 5 1.200000 1.350000 ) - SetIdleEnginePitch ( 0.300000 ) - SetGearShiftPitchDrop ( 1 0.590000 ) - SetGearShiftPitchDrop ( 2 0.530000 ) - SetGearShiftPitchDrop ( 3 0.550000 ) - SetGearShiftPitchDrop ( 4 0.610000 ) - SetGearShiftPitchDrop ( 5 0.500000 ) - SetAttackTimeMsecs ( 178.000000 ) - SetDelayTimeMsecs ( 44 ) - SetDecayTimeMsecs ( 266.000000 ) - SetDecayFinishTrim ( 0.800000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named pickupA -{ - SetEngineClipName ( "pickupA_car" ) - SetEngineIdleClipName ( "pickupA_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "pickupA_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 0.890000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.600000 ) - SetGearPitchRange ( 2 0.980000 1.690000 ) - SetGearPitchRange ( 3 1.390000 1.600000 ) - SetGearPitchRange ( 4 1.430000 1.600000 ) - SetGearPitchRange ( 5 1.460000 1.650000 ) - SetIdleEnginePitch ( 0.440000 ) - SetGearShiftPitchDrop ( 1 0.700000 ) - SetGearShiftPitchDrop ( 2 0.580000 ) - SetGearShiftPitchDrop ( 3 0.560000 ) - SetGearShiftPitchDrop ( 4 0.550000 ) - SetGearShiftPitchDrop ( 5 0.590000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.800000 ) -} -create carSoundParameters named sedanA -{ - SetEngineClipName ( "sedanA_v" ) - SetEngineIdleClipName ( "sedanA_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "sedanA_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.880000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.260000 ) - SetGearPitchRange ( 2 0.770000 1.350000 ) - SetGearPitchRange ( 3 1.000000 1.300000 ) - SetGearPitchRange ( 4 1.130000 1.350000 ) - SetGearPitchRange ( 5 1.200000 1.300000 ) - SetIdleEnginePitch ( 0.350000 ) - SetGearShiftPitchDrop ( 1 0.800000 ) - SetGearShiftPitchDrop ( 2 0.800000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.860000 ) - SetDownshiftDamperSize ( 0.070000 ) -} -create carSoundParameters named sedanB -{ - SetEngineClipName ( "sedanB_v" ) - SetEngineIdleClipName ( "sedanB_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "sedanB_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 0.880000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.490000 1.430000 ) - SetGearPitchRange ( 2 0.980000 1.520000 ) - SetGearPitchRange ( 3 1.220000 1.470000 ) - SetGearPitchRange ( 4 1.260000 1.390000 ) - SetGearPitchRange ( 5 1.240000 1.470000 ) - SetIdleEnginePitch ( 0.490000 ) - SetGearShiftPitchDrop ( 1 0.800000 ) - SetGearShiftPitchDrop ( 2 0.800000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) - SetAttackTimeMsecs ( 170.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.800000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named sportsA -{ - SetEngineClipName ( "sportsA_car" ) - SetEngineIdleClipName ( "sportsA_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "sportsA_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.380000 1.020000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 0.970000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.130000 ) - SetGearPitchRange ( 2 0.510000 1.130000 ) - SetGearPitchRange ( 3 0.920000 1.170000 ) - SetGearPitchRange ( 4 0.960000 1.130000 ) - SetGearPitchRange ( 5 0.890000 1.150000 ) - SetIdleEnginePitch ( 0.410000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.460000 ) - SetGearShiftPitchDrop ( 3 0.410000 ) - SetGearShiftPitchDrop ( 4 0.490000 ) - SetGearShiftPitchDrop ( 5 0.490000 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 267.000000 ) - SetDecayFinishTrim ( 0.800000 ) -} -create carSoundParameters named sportsB -{ - SetEngineClipName ( "sportsB_car" ) - SetEngineIdleClipName ( "sportsB_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "sportsB_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.380000 1.110000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.590000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.490000 1.560000 ) - SetGearPitchRange ( 2 0.810000 1.470000 ) - SetGearPitchRange ( 3 1.000000 1.520000 ) - SetGearPitchRange ( 4 1.090000 1.260000 ) - SetGearPitchRange ( 5 0.980000 1.240000 ) - SetIdleEnginePitch ( 0.470000 ) - SetGearShiftPitchDrop ( 1 0.680000 ) - SetGearShiftPitchDrop ( 2 0.650000 ) - SetGearShiftPitchDrop ( 3 0.520000 ) - SetGearShiftPitchDrop ( 4 0.490000 ) - SetGearShiftPitchDrop ( 5 0.490000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.800000 ) -} -create carSoundParameters named wagonA -{ - SetEngineClipName ( "SUVB_car" ) - SetEngineIdleClipName ( "SUVB_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "SUVB_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.200000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.530000 ) - SetShiftPoint ( 3 0.880000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.530000 1.470000 ) - SetGearPitchRange ( 2 0.980000 1.430000 ) - SetGearPitchRange ( 3 1.170000 1.390000 ) - SetGearPitchRange ( 4 1.130000 1.430000 ) - SetGearPitchRange ( 5 1.240000 1.390000 ) - SetIdleEnginePitch ( 0.500000 ) - SetGearShiftPitchDrop ( 1 0.550000 ) - SetGearShiftPitchDrop ( 2 0.530000 ) - SetGearShiftPitchDrop ( 3 0.470000 ) - SetGearShiftPitchDrop ( 4 0.470000 ) - SetGearShiftPitchDrop ( 5 0.550000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 7 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.820000 ) -} -create carSoundParameters named SUVA -{ - SetEngineClipName ( "SUVA_car" ) - SetEngineIdleClipName ( "SUVA_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.410000 ) - SetShiftPoint ( 3 0.710000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.600000 ) - SetGearPitchRange ( 2 0.770000 1.600000 ) - SetGearPitchRange ( 3 1.220000 1.520000 ) - SetGearPitchRange ( 4 1.090000 1.560000 ) - SetGearPitchRange ( 5 1.020000 1.470000 ) - SetIdleEnginePitch ( 0.560000 ) - SetGearShiftPitchDrop ( 1 0.800000 ) - SetGearShiftPitchDrop ( 2 0.800000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) - SetAttackTimeMsecs ( 104.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.830000 ) -} -create carSoundParameters named taxiA -{ - SetEngineClipName ( "taxiA_car" ) - SetEngineIdleClipName ( "taxiA_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.240000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.870000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.000000 ) - SetGearPitchRange ( 2 0.550000 1.020000 ) - SetGearPitchRange ( 3 0.790000 1.020000 ) - SetGearPitchRange ( 4 1.000000 1.090000 ) - SetGearPitchRange ( 5 0.940000 1.000000 ) - SetIdleEnginePitch ( 0.420000 ) - SetGearShiftPitchDrop ( 1 0.390000 ) - SetGearShiftPitchDrop ( 2 0.500000 ) - SetGearShiftPitchDrop ( 3 0.390000 ) - SetGearShiftPitchDrop ( 4 0.390000 ) - SetGearShiftPitchDrop ( 5 0.430000 ) -} -create carSoundParameters named coffin -{ - SetEngineClipName ( "coffin_v" ) - SetEngineIdleClipName ( "coffin_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cCurator_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.490000 1.990000 ) - SetGearPitchRange ( 2 0.850000 1.710000 ) - SetGearPitchRange ( 3 1.260000 1.900000 ) - SetGearPitchRange ( 4 1.350000 1.600000 ) - SetGearPitchRange ( 5 1.410000 1.520000 ) - SetIdleEnginePitch ( 0.500000 ) - SetGearShiftPitchDrop ( 1 0.580000 ) - SetGearShiftPitchDrop ( 2 0.500000 ) - SetGearShiftPitchDrop ( 3 0.490000 ) - SetGearShiftPitchDrop ( 4 0.400000 ) - SetGearShiftPitchDrop ( 5 0.560000 ) - SetAttackTimeMsecs ( 126.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 222.000000 ) - SetDecayFinishTrim ( 0.810000 ) - SetDownshiftDamperSize ( 0.060000 ) -} -create carSoundParameters named ship -{ - SetEngineClipName ( "ship_v" ) - SetEngineIdleClipName ( "ship_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "ship_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 1.000000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 1.000000 1.000000 ) - SetGearPitchRange ( 2 1.000000 1.000000 ) - SetGearPitchRange ( 3 1.000000 1.000000 ) - SetGearPitchRange ( 4 1.000000 1.000000 ) - SetGearPitchRange ( 5 1.000000 1.000000 ) - SetIdleEnginePitch ( 0.500000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 81 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetRoadSkidClipName ( "ship_skid" ) - SetDirtSkidClipName ( "ship_skid" ) - SetOverlayClipName ( "ship_overlay" ) -} -create carSoundParameters named hallo -{ - SetEngineClipName ( "hallo_v" ) - SetEngineIdleClipName ( "hallo_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "hallo_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.620000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.300000 ) - SetGearPitchRange ( 2 0.570000 1.390000 ) - SetGearPitchRange ( 3 1.000000 1.350000 ) - SetGearPitchRange ( 4 1.050000 1.350000 ) - SetGearPitchRange ( 5 1.150000 1.350000 ) - SetIdleEnginePitch ( 0.300000 ) - SetGearShiftPitchDrop ( 1 0.800000 ) - SetGearShiftPitchDrop ( 2 0.800000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) -} -create carSoundParameters named witchcar -{ - SetEngineClipName ( "witchcar_v" ) - SetEngineIdleClipName ( "witchcar_v" ) - SetIdleEnginePitch ( 0.010000 ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "witchcar_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 1.000000 ) - SetShiftPoint ( 3 0.870000 ) - SetShiftPoint ( 4 0.960000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.880000 ) - SetGearShiftPitchDrop ( 2 0.850000 ) - SetGearShiftPitchDrop ( 3 0.790000 ) - SetGearShiftPitchDrop ( 4 0.810000 ) - SetGearShiftPitchDrop ( 5 0.600000 ) - SetGearPitchRange ( 1 0.790000 1.200000 ) - SetGearPitchRange ( 2 0.890000 1.170000 ) - SetGearPitchRange ( 3 0.720000 1.130000 ) - SetGearPitchRange ( 4 0.640000 1.050000 ) - SetGearPitchRange ( 5 0.850000 1.050000 ) - SetDecayTimeMsecs ( 178.000000 ) - SetDelayTimeMsecs ( 81 ) - SetAttackTimeMsecs ( 89.000000 ) - SetDecayFinishTrim ( 0.680000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetRoadSkidClipName ( "witchcar_v_skid" ) - SetDirtSkidClipName ( "witchcar_v_skid" ) -} -create carSoundParameters named ambul -{ - SetEngineClipName ( "ambul_car" ) - SetEngineIdleClipName ( "ambul_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "ambul_car_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.850000 ) - SetShiftPoint ( 4 0.980000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.240000 ) - SetGearPitchRange ( 2 0.740000 1.300000 ) - SetGearPitchRange ( 3 0.870000 1.390000 ) - SetGearPitchRange ( 4 1.090000 1.240000 ) - SetGearPitchRange ( 5 0.850000 1.320000 ) - SetIdleEnginePitch ( 0.350000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 81 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named burnsarm -{ - SetEngineClipName ( "burnsarm_car" ) - SetEngineIdleClipName ( "burnsarm_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "burnsarm_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.320000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.500000 ) - SetShiftPoint ( 3 0.730000 ) - SetShiftPoint ( 4 0.970000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.660000 1.350000 ) - SetGearPitchRange ( 2 0.810000 1.430000 ) - SetGearPitchRange ( 3 1.000000 1.350000 ) - SetGearPitchRange ( 4 1.130000 1.300000 ) - SetGearPitchRange ( 5 1.020000 1.350000 ) - SetIdleEnginePitch ( 0.550000 ) - SetGearShiftPitchDrop ( 1 0.400000 ) - SetGearShiftPitchDrop ( 2 0.460000 ) - SetGearShiftPitchDrop ( 3 0.430000 ) - SetGearShiftPitchDrop ( 4 0.390000 ) - SetGearShiftPitchDrop ( 5 0.490000 ) - SetDecayTimeMsecs ( 237.000000 ) - SetDelayTimeMsecs ( 96 ) - SetAttackTimeMsecs ( 59.000000 ) - SetDecayFinishTrim ( 0.720000 ) -} -create carSoundParameters named fishtruc -{ - SetEngineClipName ( "fishtruck" ) - SetEngineIdleClipName ( "fishtruck" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "fishtruck_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.050000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.770000 ) - SetShiftPoint ( 4 0.950000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.150000 ) - SetGearPitchRange ( 2 0.640000 1.200000 ) - SetGearPitchRange ( 3 0.830000 1.260000 ) - SetGearPitchRange ( 4 1.050000 1.220000 ) - SetGearPitchRange ( 5 1.070000 1.260000 ) - SetIdleEnginePitch ( 0.330000 ) - SetGearShiftPitchDrop ( 1 0.560000 ) - SetGearShiftPitchDrop ( 2 0.580000 ) - SetGearShiftPitchDrop ( 3 0.460000 ) - SetGearShiftPitchDrop ( 4 0.360000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 281.000000 ) - SetDecayFinishTrim ( 0.760000 ) -} -create carSoundParameters named garbage -{ - SetEngineClipName ( "garbage_car" ) - SetEngineIdleClipName ( "garbage_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "garbage_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.020000 ) - SetIdleEnginePitch ( 0.410000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.490000 ) - SetShiftPoint ( 3 0.840000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.150000 ) - SetGearPitchRange ( 2 0.620000 1.170000 ) - SetGearPitchRange ( 3 0.920000 1.220000 ) - SetGearPitchRange ( 4 0.740000 1.200000 ) - SetGearPitchRange ( 5 0.850000 1.200000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 311.000000 ) - SetDecayFinishTrim ( 0.800000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named icecream -{ - SetEngineClipName ( "icecream_car" ) - SetEngineIdleClipName ( "icecream_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "icecream_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.600000 ) - SetShiftPoint ( 3 0.850000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.200000 ) - SetGearPitchRange ( 2 0.790000 1.220000 ) - SetGearPitchRange ( 3 1.000000 1.260000 ) - SetGearPitchRange ( 4 0.740000 1.200000 ) - SetGearPitchRange ( 5 0.850000 1.200000 ) - SetIdleEnginePitch ( 0.420000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 281.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "ice_cream_truck" ) -} -create carSoundParameters named IStruck -{ - SetEngineClipName ( "istruck_v" ) - SetEngineIdleClipName ( "istruck_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.500000 ) - SetShiftPoint ( 3 0.800000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.790000 1.840000 ) - SetGearPitchRange ( 2 1.220000 1.930000 ) - SetGearPitchRange ( 3 1.470000 1.780000 ) - SetGearPitchRange ( 4 1.600000 1.840000 ) - SetGearPitchRange ( 5 1.070000 1.350000 ) - SetIdleEnginePitch ( 0.730000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 207.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 311.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "i_and_s_truck" ) -} -create carSoundParameters named nuctruck -{ - SetEngineClipName ( "nuctruck_v" ) - SetEngineIdleClipName ( "nuctruck_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "nuctruck_v_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.560000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.630000 ) - SetGearPitchRange ( 2 1.050000 1.690000 ) - SetGearPitchRange ( 3 1.390000 1.690000 ) - SetGearPitchRange ( 4 1.350000 1.710000 ) - SetGearPitchRange ( 5 1.370000 1.670000 ) - SetIdleEnginePitch ( 0.350000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "nuctruck_glow" ) -} -create carSoundParameters named pizza -{ - SetEngineClipName ( "pizza_car" ) - SetEngineIdleClipName ( "pizza_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.610000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.570000 1.860000 ) - SetGearPitchRange ( 2 0.980000 1.860000 ) - SetGearPitchRange ( 3 1.350000 1.820000 ) - SetGearPitchRange ( 4 1.430000 1.780000 ) - SetGearPitchRange ( 5 1.460000 1.730000 ) - SetIdleEnginePitch ( 0.500000 ) - SetGearShiftPitchDrop ( 1 0.670000 ) - SetGearShiftPitchDrop ( 2 0.560000 ) - SetGearShiftPitchDrop ( 3 0.490000 ) - SetGearShiftPitchDrop ( 4 0.490000 ) - SetGearShiftPitchDrop ( 5 0.580000 ) - SetAttackTimeMsecs ( 163.000000 ) - SetDelayTimeMsecs ( 37 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.800000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "pizza_car_overlay" ) -} -create carSoundParameters named schoolbu -{ - SetEngineClipName ( "schoolbus" ) - SetEngineIdleClipName ( "schoolbus" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "schoolbus_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 0.980000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.620000 ) - SetShiftPoint ( 3 0.930000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.200000 ) - SetGearPitchRange ( 2 0.830000 1.280000 ) - SetGearPitchRange ( 3 1.090000 1.220000 ) - SetGearPitchRange ( 4 0.740000 1.200000 ) - SetGearPitchRange ( 5 0.850000 1.240000 ) - SetIdleEnginePitch ( 0.410000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 81 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named votetruc -{ - SetEngineClipName ( "votetruck_v" ) - SetEngineIdleClipName ( "votetruck_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "votetruc_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.620000 ) - SetShiftPoint ( 3 0.850000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.580000 ) - SetGearPitchRange ( 2 1.000000 1.520000 ) - SetGearPitchRange ( 3 1.260000 1.520000 ) - SetGearPitchRange ( 4 0.740000 1.200000 ) - SetGearPitchRange ( 5 0.850000 1.320000 ) - SetIdleEnginePitch ( 0.350000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 81 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetOverlayClipName ( "vote_quimby" ) -} -create carSoundParameters named tt -{ - SetEngineClipName ( "snake_car" ) - SetEngineIdleClipName ( "snake_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.500000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.650000 ) - SetShiftPoint ( 3 0.800000 ) - SetShiftPoint ( 4 0.900000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.360000 1.900000 ) - SetGearPitchRange ( 2 0.900000 1.900000 ) - SetGearPitchRange ( 3 0.960000 1.900000 ) - SetGearPitchRange ( 4 1.260000 1.900000 ) - SetGearPitchRange ( 5 1.460000 1.900000 ) - SetIdleEnginePitch ( 0.300000 ) - SetGearShiftPitchDrop ( 1 0.800000 ) - SetGearShiftPitchDrop ( 2 0.800000 ) - SetGearShiftPitchDrop ( 3 0.800000 ) - SetGearShiftPitchDrop ( 4 0.800000 ) - SetGearShiftPitchDrop ( 5 0.800000 ) -} -create carSoundParameters named glastruc -{ - SetEngineClipName ( "glastruc_v" ) - SetEngineIdleClipName ( "glastruc_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.550000 ) - SetShiftPoint ( 3 0.900000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.400000 1.200000 ) - SetGearPitchRange ( 2 0.700000 1.220000 ) - SetGearPitchRange ( 3 1.000000 1.170000 ) - SetGearPitchRange ( 4 0.740000 1.200000 ) - SetGearPitchRange ( 5 0.850000 1.200000 ) - SetIdleEnginePitch ( 0.350000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 52 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.110000 ) -} -create carSoundParameters named cFire_v -{ - SetEngineClipName ( "cfirecar_v" ) - SetEngineIdleClipName ( "cfirecar_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "cfirecar_overlay" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.380000 ) - SetShiftPoint ( 3 0.660000 ) - SetShiftPoint ( 4 0.930000 ) - SetShiftPoint ( 5 1.000000 ) - SetIdleEnginePitch ( 0.700000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 192.000000 ) - SetDelayTimeMsecs ( 67 ) - SetDecayTimeMsecs ( 326.000000 ) - SetDecayFinishTrim ( 0.770000 ) - SetDownshiftDamperSize ( 0.110000 ) - SetGearPitchRange ( 1 0.870000 1.730000 ) - SetGearPitchRange ( 2 1.280000 1.800000 ) - SetGearPitchRange ( 3 1.430000 1.950000 ) - SetGearPitchRange ( 4 1.350000 1.650000 ) - SetGearPitchRange ( 5 1.320000 1.690000 ) -} -create carSoundParameters named cBone -{ - SetEngineClipName ( "cBone_v" ) - SetEngineIdleClipName ( "cBone_v" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.500000 1.100000 ) - SetIdleEnginePitch ( 0.840000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.480000 ) - SetShiftPoint ( 3 0.820000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearPitchRange ( 1 0.870000 1.710000 ) - SetGearPitchRange ( 2 1.220000 1.730000 ) - SetGearPitchRange ( 3 1.300000 1.820000 ) - SetGearPitchRange ( 4 1.520000 1.710000 ) - SetGearPitchRange ( 5 1.280000 1.710000 ) - SetGearShiftPitchDrop ( 1 0.460000 ) - SetGearShiftPitchDrop ( 2 0.490000 ) - SetGearShiftPitchDrop ( 3 0.400000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.400000 ) - SetAttackTimeMsecs ( 222.000000 ) - SetDelayTimeMsecs ( 81 ) - SetDecayTimeMsecs ( 252.000000 ) - SetDecayFinishTrim ( 0.760000 ) - SetDownshiftDamperSize ( 0.080000 ) -} -create carSoundParameters named redbrick -{ - SetEngineClipName ( "brick_car" ) - SetEngineIdleClipName ( "brick_car" ) - SetDamagedEngineClipName ( "fire" ) - SetHornClipName ( "brick_car_horn" ) - SetReversePitchCapKmh ( 50.000000 ) - SetReversePitchRange ( 0.600000 1.200000 ) - SetIdleEnginePitch ( 0.320000 ) - SetShiftPoint ( 1 0.010000 ) - SetShiftPoint ( 2 0.620000 ) - SetShiftPoint ( 3 0.930000 ) - SetShiftPoint ( 4 1.000000 ) - SetShiftPoint ( 5 1.000000 ) - SetGearShiftPitchDrop ( 1 0.530000 ) - SetGearShiftPitchDrop ( 2 0.610000 ) - SetGearShiftPitchDrop ( 3 0.570000 ) - SetGearShiftPitchDrop ( 4 0.410000 ) - SetGearShiftPitchDrop ( 5 0.390000 ) - SetAttackTimeMsecs ( 133.000000 ) - SetDelayTimeMsecs ( 30 ) - SetDecayTimeMsecs ( 267.000000 ) - SetGearPitchRange ( 1 0.340000 1.710000 ) - SetGearPitchRange ( 2 0.700000 1.650000 ) - SetGearPitchRange ( 3 1.020000 1.600000 ) - SetGearPitchRange ( 4 1.220000 1.500000 ) - SetGearPitchRange ( 5 1.170000 1.320000 ) - SetDecayFinishTrim ( 0.660000 ) - SetDownshiftDamperSize ( 0.110000 ) -} \ No newline at end of file diff --git a/Forced Car/HandleMission.lua b/Forced Car/HandleMission.lua deleted file mode 100644 index d56678a..0000000 --- a/Forced Car/HandleMission.lua +++ /dev/null @@ -1,58 +0,0 @@ --- Load the file -local Path = "/GameData/" .. GetPath(); -local File = ReadFile(Path); - --- Determine if the file is for a mission (bonus, main or races) -local Midx = string.match(Path, "b?m%di.mfk") or string.match(Path, "[gs]r%di.mfk") -local Lidx = string.match(Path, "b?m%dl.mfk") or string.match(Path, "[gs]r%dl.mfk") --- Determine if the file is for a level -local LevelLoad = string.match(Path, "level.mfk") -local LevelInit = string.match(Path, "leveli.mfk") --- Determine if the file is for "sunday drive" (pre-mission) -local SDLoad = string.match(Path, "m%dsdl.mfk") -local SDInit = string.match(Path, "m%dsdi.mfk") - --- Remove comments because there's A LOT of commented out stuff that can confuse the simple regexes below -local NewFile = string.gsub(File, "//.-\n", "") - -if Midx ~= nil then - -- Try to find a forced vehicle spawn - local Match = string.match(NewFile, "InitLevelPlayerVehicle%(%s*\".-\"%s*,%s*\".-\"%s*,%s*\"OTHER\"%s*%)") - if Match ~= nil then - -- Replace it with the random vehicle - NewFile = string.gsub(NewFile, "InitLevelPlayerVehicle%(%s*\".-\"%s*,%s*\"(.-)\"%s*,%s*\"OTHER\"%s*%)", "InitLevelPlayerVehicle(\"" .. CarName .. "\",\"%1\",\"OTHER\")", 1) - end - if GetSetting("SkipFMVs") then - NewFile = string.gsub(NewFile, "AddObjective%(\"fmv\"%);.-CloseObjective%(%);", "AddObjective(\"timer\");\nSetDurationTime(1);\nCloseObjective();", 1) - end - Output(NewFile) -elseif Lidx ~= nil then - -- Try to find a forced vehicle spawn - local Match = string.match(NewFile, "LoadDisposableCar%(%s*\".-\"%s*,%s*\".-\"%s*,%s*\"OTHER\"%s*%)") - if Match ~= nil then - ForcedMission = true - NewFile = string.gsub(NewFile, "(.*)LoadDisposableCar%(%s*\".-\"%s*,%s*\".-\"%s*,%s*\"OTHER\"%s*%);", "%1LoadDisposableCar(\"art\\cars\\" .. CarName .. ".p3d\",\"" .. CarName .. "\",\"OTHER\");", 1) - end - Output(NewFile) -elseif LevelLoad ~= nil then - NewFile = string.gsub(NewFile, "(.*)LoadDisposableCar%(%s*\".-\"%s*,%s*\".-\"%s*,%s*\"DEFAULT\"%s*%);", "%1LoadDisposableCar(\"art\\cars\\" .. CarName .. ".p3d\",\"" .. CarName .. "\",\"DEFAULT\");", 1) - Output(NewFile) -elseif LevelInit ~= nil then - NewFile = string.gsub(NewFile, "InitLevelPlayerVehicle%(%s*\".-\"%s*,%s*\"(.-)\"%s*,%s*\"DEFAULT\"%s*%)", "InitLevelPlayerVehicle(\"" .. CarName .. "\",\"%1\",\"DEFAULT\")", 1) - Output(NewFile) -elseif SDInit ~= nil then - if GetSetting("SkipLocks") then - if string.match(NewFile, "locked") then - NewFile = string.gsub(NewFile, "AddStage%(\"locked\".-%);(.-)CloseStage%(%);%s*AddStage%(.-%);.-CloseStage%(%);", "AddStage();%1CloseStage();", 1); - end - end - if GetSetting("SkipFMVs") then - NewFile = string.gsub(NewFile, "AddObjective%(\"fmv\"%);.-CloseObjective%(%);", "AddObjective(\"timer\");\nSetDurationTime(1);\nCloseObjective();", 1) - end - Output(NewFile) -else - LastLevel = nil - -- Don't modify other scripts - --print("Script " .. Path) - Output(NewFile); -end diff --git a/ForcedCar/CustomFiles.ini b/ForcedCar/CustomFiles.ini new file mode 100644 index 0000000..c5868a4 --- /dev/null +++ b/ForcedCar/CustomFiles.ini @@ -0,0 +1,12 @@ +[PathHandlers] +scripts\\missions\\level0?\\level.mfk=Resources/HandleLevelLoad.lua +scripts\\missions\\level0?\\leveli.mfk=Resources/HandleLevelInit.lua +scripts\\missions\\level0?\\m?sdi.mfk=Resources/HandleSundayDriveInit.lua +scripts\\missions\\level0?\\m?l.mfk=Resources/HandleMissionLoad.lua +scripts\\missions\\level0?\\m?i.mfk=Resources/HandleMissionInit.lua +scripts\\missions\\level0?\\bm?l.mfk=Resources/HandleMissionLoad.lua +scripts\\missions\\level0?\\bm?i.mfk=Resources/HandleMissionInit.lua +scripts\\missions\\level0?\\sr?l.mfk=Resources/HandleMissionLoad.lua +scripts\\missions\\level0?\\sr?i.mfk=Resources/HandleMissionInit.lua +scripts\\missions\\level0?\\gr?l.mfk=Resources/HandleMissionLoad.lua +scripts\\missions\\level0?\\gr?i.mfk=Resources/HandleMissionInit.lua \ No newline at end of file diff --git a/ForcedCar/CustomFiles.lua b/ForcedCar/CustomFiles.lua new file mode 100644 index 0000000..545bb76 --- /dev/null +++ b/ForcedCar/CustomFiles.lua @@ -0,0 +1,154 @@ +dofile(GetModPath() .. "/Resources/lib/MFKLexer.lua") +function GetGamePath(Path) + Path = FixSlashes(Path,false,true) + if Path:sub(1,1) ~= "/" then + return "/GameData/" .. Path + end + return Path +end + +-- CAR LIST +local CarPool = { + "ambul", + "apu_v", + "atv_v", + "bart_v", + "bbman_v", + "bookb_v", + "burns_v", + "burnsarm", + "carhom_v", + "cArmor", + "cBlbart", + "cBone", + "cCellA", + "cCellB", + "cCellC", + "cCellD", + "cCola", + "cCube", + "cCurator", + "cDonut", + "cDuff", + "cFire_v", + "cHears", + "cKlimo", + "cletu_v", + "cLimo", + "cMilk", + "cNerd", + "cNonup", + "coffin", + "comic_v", + "compactA", + "cPolice", + "cSedan", + "cVan", + "dune_v", + "elect_v", + "famil_v", + "fishtruc", + "fone_v", + "frink_v", + "garbage", + "glastruc", + "gramp_v", + "gramR_v", + "hallo", + "hbike_v", + "homer_v", + "honor_v", + "hype_v", + "icecream", + "IStruck", + "knigh_v", + "krust_v", + "lisa_v", + "marge_v", + "minivanA", + "moe_v", + "mono_v", + "mrplo_v", + "nuctruck", + "oblit_v", + "otto_v", + "pickupA", + "pizza", + "plowk_v", + "redbrick", + "rocke_v", + "schoolbu", + "scorp_v", + "sedanA", + "sedanB", + "ship", + "skinn_v", + "smith_v", + "snake_v", + "sportsA", + "sportsB", + "SUVA", + "taxiA", + "tt", + "votetruc", + "wagonA", + "wiggu_v", + "willi_v", + "witchcar", + "zombi_v", +} + +Settings = GetSettings() +CarName = CarPool[Settings.Vehicle] +CarPath = "art\\cars\\" .. CarName .. ".p3d" +ConPath = "scripts\\cars\\" .. CarName .. ".con" + +if not Exists(GetGamePath(CarPath), true, false) then + Alert("Could not find car at path: " .. CarPath) + os.exit() + return +end + +if not Exists(GetGamePath(ConPath), true, false) then + Alert("Could not find car config at path: " .. ConPath) + os.exit() + return +end + +print("Forced Car chosen is: " .. CarName) + +function RemoveLocks(MFK, type) + local toRemove = {} + local toRemoveN = 0 + + local previousLocked = false + local remove = false + for Function, Index in MFK:GetFunctions() do + local name = Function.Name:lower() + + if name == "addstage" then + if previousLocked then + remove = true + previousLocked = false + elseif Function.Arguments[1] == "locked" and Function.Arguments[2] == type then + Function.Arguments = {} + previousLocked = true + end + end + + if remove then + toRemoveN = toRemoveN + 1 + toRemove[toRemoveN] = Index + + if name == "closestage" then + remove = false + end + end + end + + for i=toRemoveN,1,-1 do + MFK:RemoveFunction(toRemove[i]) + end + + return toRemoveN > 0 +end \ No newline at end of file diff --git a/Forced Car/Meta.ini b/ForcedCar/Meta.ini similarity index 80% rename from Forced Car/Meta.ini rename to ForcedCar/Meta.ini index 0ea138c..d41edce 100644 --- a/Forced Car/Meta.ini +++ b/ForcedCar/Meta.ini @@ -1,11 +1,33 @@ [Miscellaneous] +InternalName=ForcedCar Title=Forced Car Challenge Description=Play every mission and level in game with the chosen car! Also allows you to skip having to buy cars/costumes, and skip watching FMVs. RequiredHack=CustomFiles -Version=1.0 +Version=2.0 [Author] -Name=En Appelsin +Name=Proddy +Notes=v2 changes + +[Author] +Name=EnAppelsin +Notes=Original release + +[Author] +Name=Proddy +Notes=Lua optimisations and class system +Group=MFKLexer +Credits=1 + +[Author] +Name=Lucas Cardellini +Website=https://lucasstuff.com/ +Notes=Figuring out the token system +Group=MFKLexer +Credits=1 + +[Compile] +Decompilable=1 [Setting] Name=Vehicle @@ -100,22 +122,26 @@ Option=Willie's Tractor Option=Witchcar (Halloween Level) Option=Zombie Speed Buggy - [Setting] -Name=SkipLocks -Title=Remove car/costume requirements +Name=RemoveCarLocks +Title=Remove Car Requirements Type=TickBox -Default=0 -Tooltip=Remove specific car/costume requirements from certain missions +Default=1 +Tooltip=Remove specific car requirements from certain missions. Group=Gameplay Changes [Setting] -Name=SkipFMVs -Title=Skip cutscenes (except intro cutscene) +Name=RemoveCostumeLocks +Title=Remove Costume Requirements Type=TickBox Default=0 -Tooltip=Remove all in-game cutscenes, including the ones at the end of levels. The intro cutscene can be skipped by enabling "No Introduction Movies" +Tooltip=Remove specific costume requirements from certain missions. Group=Gameplay Changes -[Compile] -Decompilable=1 +[Setting] +Name=RemoveFMVs +Title=Skip cutscenes +Type=TickBox +Default=0 +Tooltip=Remove all in-game cutscenes, including the ones at the end of levels. The intro cutscene can be skipped by enabling "No Introduction Movies". +Group=Gameplay Changes \ No newline at end of file diff --git a/ForcedCar/Resources/HandleLevelInit.lua b/ForcedCar/Resources/HandleLevelInit.lua new file mode 100644 index 0000000..9549eb6 --- /dev/null +++ b/ForcedCar/Resources/HandleLevelInit.lua @@ -0,0 +1,4 @@ +if LevelInit ~= nil then + LevelInit:Output(true) + LevelInit = nil +end \ No newline at end of file diff --git a/ForcedCar/Resources/HandleLevelLoad.lua b/ForcedCar/Resources/HandleLevelLoad.lua new file mode 100644 index 0000000..0ad5657 --- /dev/null +++ b/ForcedCar/Resources/HandleLevelLoad.lua @@ -0,0 +1,32 @@ +local Path = GetPath() +local Level = tonumber(Path:match("level0(%d)")) + +local LevelLoad = MFKLexer.Lexer:Parse(ReadFile("/GameData/scripts/missions/level0" .. Level .. "/level.mfk")) +LevelInit = MFKLexer.Lexer:Parse(ReadFile("/GameData/scripts/missions/level0" .. Level .. "/leveli.mfk")) + +local needsAdd = true +for Function in LevelLoad:GetFunctions("LoadDisposableCar", true) do + if Function.Arguments[3] == "DEFAULT" then + Function.Arguments[1] = CarPath + Function.Arguments[2] = CarName + needsAdd = false + break + end +end +if needsAdd then + LevelLoad:AddFunction("LoadDisposableCar", {CarPath, CarName, "DEFAULT"}) +end + +local needsAdd = true +for Function in LevelInit:GetFunctions("InitLevelPlayerVehicle", true) do + if Function.Arguments[3] == "DEFAULT" then + Function.Arguments[1] = CarName + needsAdd = false + break + end +end +if needsAdd then + LevelInit:AddFunction("LoadDisposableCar", {CarPath, CarName, "DEFAULT"}) +end + +LevelLoad:Output(true) \ No newline at end of file diff --git a/ForcedCar/Resources/HandleMissionInit.lua b/ForcedCar/Resources/HandleMissionInit.lua new file mode 100644 index 0000000..9134c98 --- /dev/null +++ b/ForcedCar/Resources/HandleMissionInit.lua @@ -0,0 +1,4 @@ +if MissionInit ~= nil then + MissionInit:Output(true) + MissionInit = nil +end \ No newline at end of file diff --git a/ForcedCar/Resources/HandleMissionLoad.lua b/ForcedCar/Resources/HandleMissionLoad.lua new file mode 100644 index 0000000..0087b8a --- /dev/null +++ b/ForcedCar/Resources/HandleMissionLoad.lua @@ -0,0 +1,142 @@ +local Path = GetPath() +local GamePath = GetGamePath(Path) + +local MissionLoad = MFKLexer.Lexer:Parse(ReadFile(GamePath)) +MissionInit = MFKLexer.Lexer:Parse(ReadFile(GamePath:sub(1, -6) .. "i.mfk")) + +local isForced = false +for Function in MissionLoad:GetFunctions("LoadDisposableCar", true) do + if Function.Arguments[3] == "OTHER" then + Function.Arguments[1] = CarPath + Function.Arguments[2] = CarName + isForced = true + break + end +end +if not isForced then + MissionLoad:AddFunction("LoadDisposableCar", {CarPath, CarName, "OTHER"}) +end + +if isForced then + MissionInit:SetAll("InitLevelPlayerVehicle", 1, CarName) +else + local CarLocator + local LastStageIndex + local ResetToHereIndex + + for Function, Index in MissionInit:GetFunctions() do + local name = Function.Name:lower() + + if name == "setmissionresetplayeroutcar" then + CarLocator = Function.Arguments[2] + elseif name == "setmissionresetplayerincar" then + CarLocator = Function.Arguments[1] + elseif name == "addstage" then + LastStageIndex = Index + elseif name == "reset_to_here" then + ResetToHereIndex = LastStageIndex + end + + if CarLocator and ResetToHereIndex then + break + end + end + if not CarLocator then + -- TODO: Is this even possible? + Alert("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") + end + MissionInit:InsertFunction(2, "SetForcedCar") + MissionInit:InsertFunction(2, "InitLevelPlayerVehicle", {CarName, CarLocator, "OTHER"}) + + local stageVehicles = {} + local stageVehiclesN = 0 + + if ResetToHereIndex then + local remove = false + local functions = MissionInit.Functions + for i=ResetToHereIndex+1,1,-1 do -- We want the function before AddStage. We've inserted 2. Add 1. + local func = functions[i] + local name = func.Name:lower() + + if name == "addstagevehicle" then + stageVehiclesN = stageVehiclesN + 1 + stageVehicles[stageVehiclesN] = func.Arguments + end + + if name == "closestage" then + remove = true + end + + if remove then + table.remove(functions, i) + end + + if name == "addstage" then + remove = false + end + end + end + + if stageVehiclesN > 0 then + local Function, Index = MissionInit:GetFunction("AddStage") + MissionInit:InsertFunction(Index, "AddStage") + Index = Index + 1 + for i=1,stageVehiclesN do + MissionInit:InsertFunction(Index, "AddStageVehicle", stageVehicles[i]) + Index = Index + 1 + end + MissionInit:InsertFunction(Index, "AddObjective", "timer") + Index = Index + 1 + MissionInit:InsertFunction(Index, "SetDurationTime", 0) + Index = Index + 1 + MissionInit:InsertFunction(Index, "CloseObjective") + Index = Index + 1 + MissionInit:InsertFunction(Index, "CloseStage") + Index = Index + 1 + end + + local Function, Index = MissionInit:GetFunction("CloseStage", true) + MissionInit:InsertFunction(Index, "SetFadeOut", 0.1) + MissionInit:InsertFunction(Index, "SwapInDefaultCar") + + if Settings.RemoveOutOfVehicle then + local toRemove = {} + local toRemoveN = 0 + local addCondition + local remove = false + for Function, Index in MissionInit:GetFunctions() do + local name = Function.Name:lower() + + if name == "addcondition" then + if Function.Arguments[1] == "damage" then + addCondition = Index + end + end + + if addCondition then + if name == "setcondtargetvehicle" then + if Function.Arguments[1] == CarName then -- TODO: Check if "current" is valid + remove = true + end + end + + if name == "closecondition" then + if remove then + for j=addCondition,Index do + toRemoveN = toRemoveN + 1 + toRemove[toRemoveN] = j + end + end + remove = false + addCondition = nil + end + end + end + + for i=toRemoveN,1,-1 do + MissionInit:RemoveFunction(toRemove[i]) + end + end +end + +MissionLoad:Output(true) \ No newline at end of file diff --git a/ForcedCar/Resources/HandleSundayDriveInit.lua b/ForcedCar/Resources/HandleSundayDriveInit.lua new file mode 100644 index 0000000..1d10a64 --- /dev/null +++ b/ForcedCar/Resources/HandleSundayDriveInit.lua @@ -0,0 +1,31 @@ +if not Settings.RemoveCarLocks and not Settings.RemoveCostumeLocks and not Settings.RemoveFMVs then + return +end + +local Path = GetPath() +local GamePath = GetGamePath(Path) +local MFK = MFKLexer.Lexer:Parse(ReadFile(GamePath)) + +local changed = false + +if Settings.RemoveFMVs then + changed = MFK:SetAll("addobjective", 1, "timer", "fmv") or changed + if changed then + for Function in MFK:GetFunctions("SetFMVInfo") do + Function.Name = "SetDurationTime" + Function.Arguments[1] = 0 + end + end +end + +if Settings.RemoveCarLocks then + changed = RemoveLocks(MFK, "car") or changed +end + +if Settings.RemoveCostumeLocks then + changed = RemoveLocks(MFK, "skin") or changed +end + +if changed then + MFK:Output(true) +end \ No newline at end of file diff --git a/ForcedCar/Resources/lib/MFKLexer.lua b/ForcedCar/Resources/lib/MFKLexer.lua new file mode 100644 index 0000000..0b7a1f4 --- /dev/null +++ b/ForcedCar/Resources/lib/MFKLexer.lua @@ -0,0 +1,809 @@ +--[[ +Credits: + Lucas: Figuring out the token system + Proddy: Lua optimisations and class system +]] +MFKLexer = { + ErrorOnUnknown = true +} + +local KnownFunctions = { + ["ActivateTrigger"] = { MinArgs = 1, MaxArgs = 1 }, + ["ActivateVehicle"] = { MinArgs = 3, MaxArgs = 4 }, + ["AddAmbientCharacter"] = { MinArgs = 2, MaxArgs = 3 }, + ["AddAmbientNPCWaypoint"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddAmbientNpcAnimation"] = { MinArgs = 1, MaxArgs = 2 }, + ["AddAmbientPcAnimation"] = { MinArgs = 1, MaxArgs = 2 }, + ["AddBehaviour"] = { MinArgs = 2, MaxArgs = 7 }, + ["AddBonusMission"] = { MinArgs = 1, MaxArgs = 1 }, + ["AddBonusMissionNPCWaypoint"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddBonusObjective"] = { MinArgs = 1, MaxArgs = 2 }, + ["AddCharacter"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddCollectible"] = { MinArgs = 1, MaxArgs = 4 }, + ["AddCollectibleStateProp"] = { MinArgs = 3, MaxArgs = 3 }, + ["AddCondition"] = { MinArgs = 1, MaxArgs = 2 }, + ["AddDriver"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddFlyingActor"] = { MinArgs = 5, MaxArgs = 5 }, + ["AddFlyingActorByLocator"] = { MinArgs = 3, MaxArgs = 4 }, + ["AddGagBinding"] = { MinArgs = 5, MaxArgs = 5 }, + ["AddGlobalProp"] = { MinArgs = 1, MaxArgs = 1 }, + ["AddMission"] = { MinArgs = 1, MaxArgs = 1 }, + ["AddNPC"] = { MinArgs = 2, MaxArgs = 3 }, + ["AddNPCCharacterBonusMission"] = { MinArgs = 7, MaxArgs = 8 }, + ["AddObjective"] = { MinArgs = 1, MaxArgs = 3 }, + ["AddObjectiveNPCWaypoint"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddPed"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddPurchaseCarNPCWaypoint"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddPurchaseCarReward"] = { MinArgs = 5, MaxArgs = 6 }, + ["AddSafeZone"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddShield"] = { MinArgs = 2, MaxArgs = 2 }, + ["AddSpawnPoint"] = { MinArgs = 8, MaxArgs = 8 }, + ["AddSpawnPointByLocatorScript"] = { MinArgs = 6, MaxArgs = 6 }, + ["AddStage"] = { MinArgs = 0, MaxArgs = 7 }, + ["AddStageCharacter"] = { MinArgs = 3, MaxArgs = 5 }, + ["AddStageMusicChange"] = { MinArgs = 0, MaxArgs = 0 }, + ["AddStageTime"] = { MinArgs = 1, MaxArgs = 1 }, + ["AddStageVehicle"] = { MinArgs = 3, MaxArgs = 5 }, + ["AddStageWaypoint"] = { MinArgs = 1, MaxArgs = 1 }, + ["AddTeleportDest"] = { MinArgs = 3, MaxArgs = 5 }, + ["AddToCountdownSequence"] = { MinArgs = 1, MaxArgs = 2 }, + ["AddTrafficModel"] = { MinArgs = 2, MaxArgs = 3 }, + ["AddVehicleSelectInfo"] = { MinArgs = 3, MaxArgs = 3 }, + ["AllowMissionAbort"] = { MinArgs = 1, MaxArgs = 1 }, + ["AllowRockOut"] = { MinArgs = 0, MaxArgs = 0 }, + ["AllowUserDump"] = { MinArgs = 0, MaxArgs = 0 }, + ["AmbientAnimationRandomize"] = { MinArgs = 2, MaxArgs = 2 }, + ["AttachStatePropCollectible"] = { MinArgs = 2, MaxArgs = 2 }, + ["BindCollectibleTo"] = { MinArgs = 2, MaxArgs = 2 }, + ["BindReward"] = { MinArgs = 5, MaxArgs = 7 }, + ["CharacterIsChild"] = { MinArgs = 1, MaxArgs = 1 }, + ["ClearAmbientAnimations"] = { MinArgs = 1, MaxArgs = 1 }, + ["ClearGagBindings"] = { MinArgs = 0, MaxArgs = 0 }, + ["ClearTrafficForStage"] = { MinArgs = 0, MaxArgs = 0 }, + ["ClearVehicleSelectInfo"] = { MinArgs = 0, MaxArgs = 0 }, + ["CloseCondition"] = { MinArgs = 0, MaxArgs = 0 }, + ["CloseMission"] = { MinArgs = 0, MaxArgs = 0 }, + ["CloseObjective"] = { MinArgs = 0, MaxArgs = 0 }, + ["ClosePedGroup"] = { MinArgs = 0, MaxArgs = 0 }, + ["CloseStage"] = { MinArgs = 0, MaxArgs = 0 }, + ["CloseTrafficGroup"] = { MinArgs = 0, MaxArgs = 0 }, + ["CreateActionEventTrigger"] = { MinArgs = 5, MaxArgs = 5 }, + ["CreateAnimPhysObject"] = { MinArgs = 2, MaxArgs = 2 }, + ["CreateChaseManager"] = { MinArgs = 3, MaxArgs = 3 }, + ["CreatePedGroup"] = { MinArgs = 1, MaxArgs = 1 }, + ["CreateTrafficGroup"] = { MinArgs = 1, MaxArgs = 1 }, + ["DeactivateTrigger"] = { MinArgs = 1, MaxArgs = 1 }, + ["DisableHitAndRun"] = { MinArgs = 0, MaxArgs = 0 }, + ["EnableHitAndRun"] = { MinArgs = 0, MaxArgs = 0 }, + ["EnableTutorialMode"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagBegin"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagCheckCollCards"] = { MinArgs = 5, MaxArgs = 5 }, + ["GagCheckMovie"] = { MinArgs = 4, MaxArgs = 4 }, + ["GagEnd"] = { MinArgs = 0, MaxArgs = 0 }, + ["GagPlayFMV"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetAnimCollision"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetCameraShake"] = { MinArgs = 2, MaxArgs = 3 }, + ["GagSetCoins"] = { MinArgs = 1, MaxArgs = 2 }, + ["GagSetCycle"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetInterior"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetIntro"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetLoadDistances"] = { MinArgs = 2, MaxArgs = 2 }, + ["GagSetOutro"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetPersist"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetPosition"] = { MinArgs = 1, MaxArgs = 3 }, + ["GagSetRandom"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetSound"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetSoundLoadDistances"] = { MinArgs = 2, MaxArgs = 2 }, + ["GagSetSparkle"] = { MinArgs = 1, MaxArgs = 1 }, + ["GagSetTrigger"] = { MinArgs = 3, MaxArgs = 5 }, + ["GagSetWeight"] = { MinArgs = 1, MaxArgs = 1 }, + ["GoToPsScreenWhenDone"] = { MinArgs = 0, MaxArgs = 0 }, + ["InitLevelPlayerVehicle"] = { MinArgs = 3, MaxArgs = 4 }, + ["KillAllChaseAI"] = { MinArgs = 1, MaxArgs = 1 }, + ["LinkActionToObject"] = { MinArgs = 5, MaxArgs = 5 }, + ["LinkActionToObjectJoint"] = { MinArgs = 5, MaxArgs = 5 }, + ["LoadDisposableCar"] = { MinArgs = 3, MaxArgs = 3 }, + ["LoadP3DFile"] = { MinArgs = 1, MaxArgs = 3 }, + ["MoveStageVehicle"] = { MinArgs = 3, MaxArgs = 3 }, + ["MustActionTrigger"] = { MinArgs = 0, MaxArgs = 0 }, + ["NoTrafficForStage"] = { MinArgs = 0, MaxArgs = 0 }, + ["PlacePlayerAtLocatorName"] = { MinArgs = 1, MaxArgs = 1 }, + ["PlacePlayerCar"] = { MinArgs = 2, MaxArgs = 2 }, + ["PreallocateActors"] = { MinArgs = 2, MaxArgs = 2 }, + ["PutMFPlayerInCar"] = { MinArgs = 0, MaxArgs = 0 }, + ["RESET_TO_HERE"] = { MinArgs = 0, MaxArgs = 0 }, + ["RemoveDriver"] = { MinArgs = 1, MaxArgs = 1 }, + ["RemoveNPC"] = { MinArgs = 1, MaxArgs = 1 }, + ["ResetCharacter"] = { MinArgs = 2, MaxArgs = 2 }, + ["ResetHitAndRun"] = { MinArgs = 0, MaxArgs = 0 }, + ["SelectMission"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetActorRotationSpeed"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetAllowSeatSlide"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetAnimCamMulticontName"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetAnimatedCameraName"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetBonusMissionDialoguePos"] = { MinArgs = 3, MaxArgs = 4 }, + ["SetBonusMissionStart"] = { MinArgs = 0, MaxArgs = 0 }, + ["SetBrakeScale"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetBurnoutRange"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCMOffsetX"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCMOffsetY"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCMOffsetZ"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCamBestSide"] = { MinArgs = 1, MaxArgs = 2 }, + ["SetCarAttributes"] = { MinArgs = 5, MaxArgs = 5 }, + ["SetCarStartCamera"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCharacterPosition"] = { MinArgs = 3, MaxArgs = 3 }, + ["SetCharacterScale"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCharacterToHide"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCharactersVisible"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetChaseSpawnRate"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetCoinDrawable"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCoinFee"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCollectibleEffect"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCollisionAttributes"] = { MinArgs = 4, MaxArgs = 4 }, + ["SetCompletionDialog"] = { MinArgs = 1, MaxArgs = 2 }, + ["SetCondMinHealth"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCondTargetVehicle"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetCondTime"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetConditionPosition"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetConversationCam"] = { MinArgs = 2, MaxArgs = 3 }, + ["SetConversationCamDistance"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetConversationCamName"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetConversationCamNpcName"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetConversationCamPcName"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetDamperC"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetDemoLoopTime"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetDestination"] = { MinArgs = 1, MaxArgs = 3 }, + ["SetDialogueInfo"] = { MinArgs = 4, MaxArgs = 4 }, + ["SetDialoguePositions"] = { MinArgs = 2, MaxArgs = 4 }, + ["SetDonutTorque"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetDriver"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetDurationTime"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetDynaLoadData"] = { MinArgs = 1, MaxArgs = 2 }, + ["SetEBrakeEffect"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetFMVInfo"] = { MinArgs = 1, MaxArgs = 2 }, + ["SetFadeOut"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetFollowDistances"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetForcedCar"] = { MinArgs = 0, MaxArgs = 0 }, + ["SetGamblingOdds"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetGameOver"] = { MinArgs = 0, MaxArgs = 0 }, + ["SetGasScale"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetGasScaleSpeedThreshold"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHUDIcon"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHasDoors"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHighRoof"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHighSpeedGasScale"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHighSpeedSteeringDrop"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHitAndRunDecay"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHitAndRunDecayInterior"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHitAndRunMeter"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetHitNRun"] = { MinArgs = 0, MaxArgs = 0 }, + ["SetHitPoints"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetInitialWalk"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetIrisTransition"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetIrisWipe"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetLevelOver"] = { MinArgs = 0, MaxArgs = 0 }, + ["SetMass"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMaxSpeedBurstTime"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMaxTraffic"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMaxWheelTurnAngle"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMissionNameIndex"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMissionResetPlayerInCar"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMissionResetPlayerOutCar"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetMissionStartCameraName"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMissionStartMulticontName"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetMusicState"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetNormalSteering"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetNumChaseCars"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetNumValidFailureHints"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetObjDistance"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetObjTargetBoss"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetObjTargetVehicle"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetParTime"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetParticleTexture"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetPickupTarget"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetPlayerCarName"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetPostLevelFMV"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetPresentationBitmap"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetProjectileStats"] = { MinArgs = 3, MaxArgs = 3 }, + ["SetRaceEnteryFee"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetRaceLaps"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetRespawnRate"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetShadowAdjustments"] = { MinArgs = 8, MaxArgs = 8 }, + ["SetShininess"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSlipEffectNoEBrake"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSlipGasScale"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSlipSteering"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSlipSteeringNoEBrake"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSpringK"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetStageAIEvadeCatchupParams"] = { MinArgs = 3, MaxArgs = 3 }, + ["SetStageAIRaceCatchupParams"] = { MinArgs = 5, MaxArgs = 5 }, + ["SetStageAITargetCatchupParams"] = { MinArgs = 3, MaxArgs = 3 }, + ["SetStageCamera"] = { MinArgs = 3, MaxArgs = 3 }, + ["SetStageMessageIndex"] = { MinArgs = 1, MaxArgs = 2 }, + ["SetStageMusicAlwaysOn"] = { MinArgs = 0, MaxArgs = 0 }, + ["SetStageTime"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetStatepropShadow"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetSuspensionLimit"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSuspensionYOffset"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSwapDefaultCarLocator"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSwapForcedCarLocator"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetSwapPlayerLocator"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetTalkToTarget"] = { MinArgs = 1, MaxArgs = 4 }, + ["SetTireGrip"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetTopSpeedKmh"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetTotalGags"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetTotalWasps"] = { MinArgs = 2, MaxArgs = 2 }, + ["SetVehicleAIParams"] = { MinArgs = 3, MaxArgs = 3 }, + ["SetVehicleToLoad"] = { MinArgs = 3, MaxArgs = 3 }, + ["SetWeebleOffset"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetWheelieOffsetY"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetWheelieOffsetZ"] = { MinArgs = 1, MaxArgs = 1 }, + ["SetWheelieRange"] = { MinArgs = 1, MaxArgs = 1 }, + ["ShowHUD"] = { MinArgs = 1, MaxArgs = 1 }, + ["ShowStageComplete"] = { MinArgs = 0, MaxArgs = 0 }, + ["StageStartMusicEvent"] = { MinArgs = 1, MaxArgs = 1 }, + ["StartCountdown"] = { MinArgs = 1, MaxArgs = 2 }, + ["StayInBlack"] = { MinArgs = 0, MaxArgs = 0 }, + ["StreetRacePropsLoad"] = { MinArgs = 1, MaxArgs = 1 }, + ["StreetRacePropsUnload"] = { MinArgs = 1, MaxArgs = 1 }, + ["SuppressDriver"] = { MinArgs = 1, MaxArgs = 1 }, + ["SwapInDefaultCar"] = { MinArgs = 0, MaxArgs = 0 }, + ["TurnGotoDialogOff"] = { MinArgs = 0, MaxArgs = 0 }, + ["UseElapsedTime"] = { MinArgs = 0, MaxArgs = 0 }, + ["UsePedGroup"] = { MinArgs = 1, MaxArgs = 1 }, + ["msPlacePlayerCarAtLocatorName"] = { MinArgs = 1, MaxArgs = 1 }, + -- Additional Script Functionality + ["AddCondTargetModel"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["AddObjTargetModel"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["AddParkedCar"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["AddStageVehicleCharacter"] = { MinArgs = 2, MaxArgs = 4, Hack = "AdditionalScriptFunctionality" }, + ["AddVehicleCharacter"] = { MinArgs = 1, MaxArgs = 3, Hack = "AdditionalScriptFunctionality" }, + ["AddVehicleCharacterSuppressionCharacter"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["CHECKPOINT_HERE"] = { MinArgs = 0, MaxArgs = 0, Hack = "AdditionalScriptFunctionality" }, + ["DisableTrigger"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["IfCurrentCheckpoint"] = { MinArgs = 0, MaxArgs = 0, Hack = "AdditionalScriptFunctionality", Conditional = true }, + ["RemoveStageVehicleCharacter"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["ResetStageHitAndRun"] = { MinArgs = 0, MaxArgs = 0, Hack = "AdditionalScriptFunctionality" }, + ["ResetStageVehicleAbductable"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCarChangeHitAndRunChange"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCheckpointDynaLoadData"] = { MinArgs = 1, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetCheckpointPedGroup"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCheckpointResetPlayerInCar"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCheckpointResetPlayerOutCar"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetCheckpointTrafficGroup"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCollectibleSoundEffect"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCondDecay"] = { MinArgs = 1, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetCondDelay"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCondDisplay"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCondMessageIndex"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCondSound"] = { MinArgs = 1, MaxArgs = 4, Hack = "AdditionalScriptFunctionality" }, + ["SetCondSpeedRangeKMH"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetCondThreshold"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCondTotal"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetCondTrigger"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetConditionalParameter"] = { MinArgs = 3, MaxArgs = 5, Hack = "AdditionalScriptFunctionality" }, + ["SetHUDMapDrawable"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetHitAndRunDecayHitAndRun"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetHitAndRunFine"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetNoHitAndRunMusicForStage"] = { MinArgs = 0, MaxArgs = 0, Hack = "AdditionalScriptFunctionality" }, + ["SetObjCameraName"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjCanSkip"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjDecay"] = { MinArgs = 1, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetObjExplosion"] = { MinArgs = 2, MaxArgs = 3, Hack = "AdditionalScriptFunctionality" }, + ["SetObjMessageIndex"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjMulticontName"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjNoLetterbox"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjSound"] = { MinArgs = 1, MaxArgs = 4, Hack = "AdditionalScriptFunctionality" }, + ["SetObjSpeedKMH"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjThreshold"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjTotal"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjTrigger"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetObjUseCameraPosition"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetParkedCarsEnabled"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetPedsEnabled"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageAllowMissionCancel"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageCarChangeHitAndRunChange"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageCharacterModel"] = { MinArgs = 1, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetStageHitAndRun"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageHitAndRunDecay"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageHitAndRunDecayHitAndRun"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageHitAndRunDecayInterior"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageHitAndRunFine"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageNumChaseCars"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStagePayout"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleAbductable"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleAllowSeatSlide"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleCharacterAnimation"] = { MinArgs = 3, MaxArgs = 4, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleCharacterJumpOut"] = { MinArgs = 2, MaxArgs = 3, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleCharacterScale"] = { MinArgs = 3, MaxArgs = 3, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleCharacterVisible"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleNoDestroyedJumpOut"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetStageVehicleReset"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetVehicleCharacterAnimation"] = { MinArgs = 2, MaxArgs = 3, Hack = "AdditionalScriptFunctionality" }, + ["SetVehicleCharacterJumpOut"] = { MinArgs = 1, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetVehicleCharacterScale"] = { MinArgs = 2, MaxArgs = 2, Hack = "AdditionalScriptFunctionality" }, + ["SetVehicleCharacterVisible"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["SetWheelieOffsetX"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + ["UseTrafficGroup"] = { MinArgs = 1, MaxArgs = 1, Hack = "AdditionalScriptFunctionality" }, + -- Debug Test + ["DebugBreak"] = { MinArgs = 0, MaxArgs = 0, Hack = "DebugTest" }, + ["LucasTest"] = { MinArgs = 0, MaxArgs = 16, Hack = "DebugTest" }, + ["Sleep"] = { MinArgs = 1, MaxArgs = 1, Hack = "DebugTest" }, + ["TaskMessage"] = { MinArgs = 3, MaxArgs = 4, Hack = "DebugTest" }, +} +local LoadedHacks = {} +for i=1,#KnownFunctions do + local KnownFunction = KnownFunctions[i] + if KnownFunction and KnownFunction.Hack and LoadedHacks[KnownFunction.Hack] == nil then + LoadedHacks[KnownFunction.Hack] = IsHackLoaded(KnownFunction.Hack) + end +end + +local Char_Tab = 9 +local Char_LF = 10 +local Char_CR = 13 +local Char_Space = 32 +local Char_Quote = 34 +local Char_Asterisk = 42 +local Char_FWSlash = 47 +local Char_Backslash = 92 +local WhiteSpaceCharacters = { + [9] = true, -- Tab + [10] = true, -- \n + [13] = true, -- \r + [32] = true, -- Space +} + +local TokenEndCharacters = { + [9] = true, -- Tab + [10] = true, -- \n + [13] = true, -- \r + [32] = true, -- Space + [33] = true, -- ! + [34] = true, -- " + [35] = true, -- # + [36] = true, -- $ + [37] = true, -- % + [38] = true, -- & + [39] = true, -- ' + [40] = true, -- ( + [41] = true, -- ) + [42] = true, -- * + [43] = true, -- + + [44] = true, -- , + [47] = true, -- / + [58] = true, -- : + [59] = true, -- ; + [60] = true, -- < + [62] = true, -- > + [63] = true, -- ? + [64] = true, -- @ + [91] = true, -- [ + [92] = true, -- \ + [93] = true, -- ] + [94] = true, -- ^ + [96] = true, -- ` + [123] = true, -- { + [125] = true, -- } + [126] = true, -- ~ +} + +local string_byte = string.byte +local string_format = string.format +local string_lower = string.lower +local string_sub = string.sub +local table_concat = table.concat +local table_remove = table.remove + +local assert = assert +local tonumber = tonumber +local tostring = tostring +local type = type + +MFKLexer.MFKFunction = {} +function MFKLexer.MFKFunction:New(Name, Arguments, Conditional, Not) + Arguments = Arguments or {} + if type(Arguments) ~= "table" then Arguments = {Arguments} end + local cmd = {} + cmd.Name, cmd.Arguments, cmd.Conditional, cmd.Not, cmd.Children = Name, Arguments, Conditional, Not, {} + self.__index = self + return setmetatable(cmd, self) +end + +function MFKLexer.MFKFunction:AddChildFunction(Func) + assert(self.Conditional, "Cannot add a child function to a not-conditional function.") + self.Children[#self.Children + 1] = Func +end + +function MFKLexer.MFKFunction:SetArg(Index, Value, Condition) + if Condition == nil or tostring(Condition) == tostring(self.Arguments[Index]) then + self.Arguments[Index] = Value + return true + end + return false +end + +function MFKLexer.MFKFunction:__tostring() + local FunctionName = self.Name + local Arguments = self.Arguments + local ArgumentsN = #Arguments + + local KnownFunction = KnownFunctions[FunctionName] + if KnownFunction then + assert(KnownFunction.Hack == nil or LoadedHacks[KnownFunction.Hack], string_format("Function %s requires non-loaded hack: %s", FunctionName, KnownFunction.Hack)) + assert(ArgumentsN >= KnownFunction.MinArgs and ArgumentsN <= KnownFunction.MaxArgs, string_format("Function %s requires between %i and %i arguments.", FunctionName, KnownFunction.MinArgs, KnownFunction.MaxArgs)) + assert(not self.Conditional or KnownFunction.Conditional, string_format("Function %s %s a conditional.", FunctionName, KnownFunction.Conditional and "is" or "is not")) + else + assert(not MFKLexer.ErrorOnUnknown, string_format("Unknown function: ", FunctionName)) + end + + local output = {} + if self.Not then output[1] = "!" end + output[#output + 1] = "\"" .. FunctionName .. "\"(" + for i=1,ArgumentsN do + if i > 1 then output[#output + 1] = "," end + output[#output + 1] = "\"" .. Arguments[i] .. "\"" + end + output[#output + 1] = ")" + if self.Conditional then + output[#output + 1] = "{" + for i=1,#self.Children do + output[#output + 1] = tostring(self.Children[i]) + end + output[#output + 1] = "}" + else + output[#output + 1] = ";" + end + return table_concat(output) +end +function MFKLexer.MFKFunction:Output(Clean) + local FunctionName = self.Name + local Arguments = self.Arguments + local ArgumentsN = #Arguments + + local KnownFunction = KnownFunctions[FunctionName] + if KnownFunction then + assert(KnownFunction.Hack == nil or LoadedHacks[KnownFunction.Hack], string_format("Function %s requires non-loaded hack: %s", FunctionName, KnownFunction.Hack)) + assert(ArgumentsN >= KnownFunction.MinArgs and ArgumentsN <= KnownFunction.MaxArgs, string_format("Function %s requires between %i and %i arguments.", FunctionName, KnownFunction.MinArgs, KnownFunction.MaxArgs)) + assert(not self.Conditional or KnownFunction.Conditional, string_format("Function %s %s a conditional.", FunctionName, KnownFunction.Conditional and "is" or "is not")) + else + assert(not MFKLexer.ErrorOnUnknown, string_format("Unknown function: ", FunctionName)) + end + + Output("\"" .. FunctionName .. "\"(") + for i=1,ArgumentsN do + if i > 1 then Output(",") end + Output("\"" .. Arguments[i] .. "\"") + end + Output(")") + if self.Conditional then + Output("{") + if Clean then Output("\r\n") end + for i=1,#self.Children do + self.Children[i]:Output() + end + if Clean then Output("\r\n") end + Output("}") + else + Output(";") + end + if Clean then + Output("\r\n") + end +end + + +MFKLexer.Lexer = {} +function MFKLexer.Lexer:New() + local RetVal = {} + RetVal.Functions = {} + + self.__index = self + return setmetatable(RetVal, self) +end + +function MFKLexer.Lexer:Parse(Text) + local RetVal = {} + local TextBytes = {string_byte(Text, 1, #Text)} + local TextOffset = 0 + local Line = 1 + local Character + + local function Advance() + TextOffset = TextOffset + 1 + if TextOffset <= #TextBytes then + Character = TextBytes[TextOffset] + else + Character = 0 + end + + if Character == Char_LF then Line = Line + 1 end + end + + Advance() + + local function SkipWhiteSpace() + while Character ~= 0 and WhiteSpaceCharacters[Character] do + Advance() + end + end + + local function SkipComment() + if Character == Char_FWSlash then + Advance() + + if Character == Char_FWSlash then + while Character ~= Char_LF and Character ~= Char_CR and Character ~= 0 do + Advance() + end + + return true + elseif Character == Char_Asterisk then + while true do + Advance() + + if Character == Char_Asterisk then + Advance() + + if Character == Char_FWSlash then + Advance() + + break + end + elseif Character == 0 then + break + end + end + + return true + end + end + + return false + end + + local function SkipWhiteSpaceAndComments() + repeat + SkipWhiteSpace() + until not SkipComment() + end + + local function ReadToTokenEndOrCharacter() + local StartOffset = TextOffset + + while Character ~= 0 and not TokenEndCharacters[Character] do + Advance() + end + + if TextOffset == StartOffset then + Advance() + end + + return string_sub(Text, StartOffset, TextOffset - 1) + end + + local function ReadToQuoteEnd() + local StartOffset = TextOffset + local EndOffset = StartOffset + + while Character ~= 0 do + if Character == Char_Backslash then + Advance() + + EndOffset = TextOffset + + if Character == Char_Quote then + Advance() + + EndOffset = TextOffset + + goto Continue + end + + goto Continue + end + + if Character == Char_Quote then + Advance() + + break + end + + Advance() + + EndOffset = TextOffset + + ::Continue:: + end + + return string_sub(Text, StartOffset, EndOffset - 1) + end + + local function ReadToken() + SkipWhiteSpaceAndComments() + + if Character == 0 then return nil end + + if Character == Char_Quote then + Advance() + + return ReadToQuoteEnd() + end + + return ReadToTokenEndOrCharacter() + end + + local function ReadTokenNotEndOfFile() + local Result = ReadToken() + assert(Result, "Result == nil") + return Result + end + + local function ExpectToken(Token) + local Token2 = ReadToken() + assert(Token == Token2, string_format("Expected token: %s\nGot token: %s", Token, Token2)) + end + + local ConditionalLevel = 0 + local ConditionalParents = {} + RetVal.Functions = {} + + while true do + local FunctionName = ReadToken() + if FunctionName == nil then break end + + if FunctionName == "}" then + ConditionalLevel = ConditionalLevel - 1 + ConditionalParents[#ConditionalParents] = nil + else + local Not = FunctionName == "!" + if Not then + FunctionName = ReadTokenNotEndOfFile() + end + + ExpectToken("(") + + local Arguments = {} + local ArgumentsN = 0 + while true do + local Token = ReadTokenNotEndOfFile() + if Token == ")" then break end + + if ArgumentsN > 0 then + assert(Token == ",", string_format("Expected token: ,\nGot token: %s", Token)) + Token = ReadTokenNotEndOfFile() + end + + ArgumentsN = ArgumentsN + 1 + Arguments[ArgumentsN] = tonumber(Token) or Token + end + + local Conditional = false + local Token2 = ReadToken() + if Token2 == "{" then + Conditional = true + ConditionalLevel = ConditionalLevel + 1 + else + assert(Token2 == ";", string_format("Expected token: ;\nGot token: ", Token2)) + end + + if not Conditional then + assert(not Not, "! but not conditional") + end + + local KnownFunction = KnownFunctions[FunctionName] + if KnownFunction then + assert(KnownFunction.Hack == nil or LoadedHacks[KnownFunction.Hack], string_format("Function %s requires non-loaded hack: %s", FunctionName, KnownFunction.Hack)) + assert(ArgumentsN >= KnownFunction.MinArgs and ArgumentsN <= KnownFunction.MaxArgs, string_format("Function %s requires between %i and %i arguments.", FunctionName, KnownFunction.MinArgs, KnownFunction.MaxArgs)) + assert(not self.Conditional or KnownFunction.Conditional, string_format("Function %s %s a conditional.", FunctionName, KnownFunction.Conditional and "is" or "is not")) + else + assert(not MFKLexer.ErrorOnUnknown, string_format("Unknown function: ", FunctionName)) + end + + local Func = MFKLexer.MFKFunction:New(FunctionName, Arguments, Conditional, Not) + if #ConditionalParents > 0 then + ConditionalParents[#ConditionalParents]:AddChildFunction(Func) + else + RetVal.Functions[#RetVal.Functions + 1] = Func + end + if Conditional then + ConditionalParents[#ConditionalParents + 1] = Func + end + end + end + + self.__index = self + return setmetatable(RetVal, self) +end + +function MFKLexer.Lexer:AddFunction(FunctionName, Arguments, Conditional, Not) + local Func = MFKLexer.MFKFunction:New(FunctionName, Arguments, Conditional, Not) + self.Functions[#self.Functions + 1] = Func + return Func +end + +function MFKLexer.Lexer:InsertFunction(Index, FunctionName, Arguments, Conditional, Not) + local Func = MFKLexer.MFKFunction:New(FunctionName, Arguments, Conditional, Not) + table.insert(self.Functions, Index, Func) + return Func +end + +function MFKLexer.Lexer:GetFunctions(Name, Backwards) + if Name then + assert(type(Name) == "string", "Arg #1 (Name) must be a string.") + Name = string_lower(Name) + end + + local functions = self.Functions + local functionsN = #functions + + local index, finish, step + if Backwards then + index = functionsN + finish = 0 + step = -1 + else + index = 1 + finish = functionsN + 1 + step = 1 + end + + return function() + while index ~= finish do + assert(Backwards or functionsN == #functions, string_format("Function count changed from %d to %d. To add or remove functions whilst iterating, you must iterate backwards", functionsN, #functions)) + local Function = functions[index] + index = index + step + if (Name == nil or string_lower(Function.Name) == Name) then + return Function, index - step + end + end + return nil + end +end + +function MFKLexer.Lexer:GetFunction(Name, Backwards) + return self:GetFunctions(Name, Backwards)() +end + +function MFKLexer.Lexer:RemoveFunction(Index) + assert(type(Index) == "number", "Arg #1 (Index) must be a number.") + assert(Index > 0 and Index <= #self.Functions, "Arg #1 (Index) out of bounds.") + table_remove(self.Functions, Index) +end + +local function SetFunctionArgument(FunctionName, Function, Index, Value, Condition) + local changed = false + if string_lower(Function.Name) == FunctionName then + changed = Function:SetArg(Index, Value, Condition) + end + if Function.Conditional then + for i=1,#Function.Children do + changed = SetFunctionArgument(FunctionName, Function.Children[i], Index, Value, Condition) or changed + end + end + return changed +end +function MFKLexer.Lexer:SetAll(FunctionName, Index, Value, Condition) + local changed = false + FunctionName = string_lower(FunctionName) + for Function in self:GetFunctions() do + changed = SetFunctionArgument(FunctionName, Function, Index, Value, Condition) or changed + end + return changed +end + +function MFKLexer.Lexer:__tostring() + local output = {} + for i=1,#self.Functions do + output[i] = tostring(self.Functions[i]) + end + return table_concat(output) +end +function MFKLexer.Lexer:Output(Clean) + for i=1,#self.Functions do + self.Functions[i]:Output(Clean) + end +end + + +return MFKLexer \ No newline at end of file From a0a747d1feb270cdb96be929fdc75542fb4d1f3b Mon Sep 17 00:00:00 2001 From: Proddy Date: Sat, 27 Jul 2024 12:18:01 +0100 Subject: [PATCH 2/5] Added Audi TT fixes - Added `LuaP3DLib`. - Added `RCFParser`. - Added `SPTParser`. - Added handling to `ReadFile` to support reading files from RCF archives when `FileSystemRCFs` isn't present. - Fixed `tt` config to remove doors, add iris transition and fix shadow. - Fixed `car_tune.spt` setting engine sound for `tt` to a file that doesn't exist. - Fixed `tt` model not having `dl` and `pl` joints for driver and passenger seats. --- ForcedCar/CustomFiles.ini | 7 +- ForcedCar/CustomFiles.lua | 39 +- ForcedCar/Meta.ini | 42 +- ForcedCar/Resources/HandleCarConfig.lua | 14 + ForcedCar/Resources/HandleCarTune.lua | 22 + ForcedCar/Resources/HandleTTModel.lua | 14 + ForcedCar/Resources/lib/P3D2.lua | 1169 +++++++++++++++++ .../lib/P3DChunks/SkeletonJointP3DChunk.lua | 74 ++ .../lib/P3DChunks/SkeletonP3DChunk.lua | 71 + ForcedCar/Resources/lib/RCF.lua | 122 ++ ForcedCar/Resources/lib/SPTParser.lua | 444 +++++++ 11 files changed, 2015 insertions(+), 3 deletions(-) create mode 100644 ForcedCar/Resources/HandleCarConfig.lua create mode 100644 ForcedCar/Resources/HandleCarTune.lua create mode 100644 ForcedCar/Resources/HandleTTModel.lua create mode 100644 ForcedCar/Resources/lib/P3D2.lua create mode 100644 ForcedCar/Resources/lib/P3DChunks/SkeletonJointP3DChunk.lua create mode 100644 ForcedCar/Resources/lib/P3DChunks/SkeletonP3DChunk.lua create mode 100644 ForcedCar/Resources/lib/RCF.lua create mode 100644 ForcedCar/Resources/lib/SPTParser.lua diff --git a/ForcedCar/CustomFiles.ini b/ForcedCar/CustomFiles.ini index c5868a4..ee30d2f 100644 --- a/ForcedCar/CustomFiles.ini +++ b/ForcedCar/CustomFiles.ini @@ -9,4 +9,9 @@ scripts\\missions\\level0?\\bm?i.mfk=Resources/HandleMissionInit.lua scripts\\missions\\level0?\\sr?l.mfk=Resources/HandleMissionLoad.lua scripts\\missions\\level0?\\sr?i.mfk=Resources/HandleMissionInit.lua scripts\\missions\\level0?\\gr?l.mfk=Resources/HandleMissionLoad.lua -scripts\\missions\\level0?\\gr?i.mfk=Resources/HandleMissionInit.lua \ No newline at end of file +scripts\\missions\\level0?\\gr?i.mfk=Resources/HandleMissionInit.lua + +; TT fixes +scripts\\cars\\*.con=Resources/HandleCarConfig.lua +art\\cars\\tt.p3d=Resources/HandleTTModel.lua +sound\\scripts\\car_tune.spt=Resources/HandleCarTune.lua \ No newline at end of file diff --git a/ForcedCar/CustomFiles.lua b/ForcedCar/CustomFiles.lua index 545bb76..1430b90 100644 --- a/ForcedCar/CustomFiles.lua +++ b/ForcedCar/CustomFiles.lua @@ -1,4 +1,8 @@ -dofile(GetModPath() .. "/Resources/lib/MFKLexer.lua") +local LibDir = GetModPath() .. "/Resources/lib/" +dofile(LibDir .. "MFKLexer.lua") +dofile(LibDir .. "SPTParser.lua") +dofile(LibDir .. "P3D2.lua") +P3D.LoadChunks(LibDir .. "P3DChunks") function GetGamePath(Path) Path = FixSlashes(Path,false,true) if Path:sub(1,1) ~= "/" then @@ -7,6 +11,39 @@ function GetGamePath(Path) return Path end +if not IsHackLoaded("FileSystemRCFs") then + print("Adding RCF support to ReadFile...") + dofile(LibDir .. "RCF.lua") + local RCFFiles = {} + DirectoryGetEntries("/GameData/", function(Path, IsDir) + if IsDir then + return true + end + + if GetFileExtension(Path):lower() ~= ".rcf" then + return true + end + + local GamePath = GetGamePath(Path) + local RCFFile = RCF.RCFFile(GamePath) + for i=1,#RCFFile.Files do + local file = RCFFile.Files[i] + + RCFFiles[GetGamePath(file.Name)] = {GamePath, file.Position, file.Size} + end + + return true + end) + local _ReadFile = ReadFile + function ReadFile(Path) + local RCFFile = RCFFiles[Path] + if not Exists(Path, true, false) and RCFFile then + return ReadFileOffset(RCFFile[1], RCFFile[2], RCFFile[3]) + end + return _ReadFile(Path) + end +end + -- CAR LIST local CarPool = { "ambul", diff --git a/ForcedCar/Meta.ini b/ForcedCar/Meta.ini index d41edce..663b35d 100644 --- a/ForcedCar/Meta.ini +++ b/ForcedCar/Meta.ini @@ -3,7 +3,8 @@ InternalName=ForcedCar Title=Forced Car Challenge Description=Play every mission and level in game with the chosen car! Also allows you to skip having to buy cars/costumes, and skip watching FMVs. RequiredHack=CustomFiles -Version=2.0 +OptionalHack=FileSystemRCFs +Version=2.1 [Author] Name=Proddy @@ -26,6 +27,45 @@ Notes=Figuring out the token system Group=MFKLexer Credits=1 +[Author] +Name=Proddy +Website=https://github.com/Hampo/LuaP3DLib +Notes=P3D Class System +Group=LuaP3DLib +Credits=1 + +[Author] +Name=EnAppelsin +Website=https://github.com/EnAppelsin +Notes=Original P3D Lua idea +Group=LuaP3DLib +Credits=1 + +[Author] +Name=Lucas Cardellini +Website=https://lucasstuff.com/ +Notes=P3D Chunk Structures +Group=LuaP3DLib +Credits=1 + +[Author] +Name=Proddy +Group=RCFParser +Credits=1 + +[Author] +Name=Proddy +Notes=SPT parser and class system +Group=SPTParser +Credits=1 + +[Author] +Name=EnAppelsin +Website=https://github.com/EnAppelsin +Notes=Type Info format +Group=SPTParser +Credits=1 + [Compile] Decompilable=1 diff --git a/ForcedCar/Resources/HandleCarConfig.lua b/ForcedCar/Resources/HandleCarConfig.lua new file mode 100644 index 0000000..dce9a3e --- /dev/null +++ b/ForcedCar/Resources/HandleCarConfig.lua @@ -0,0 +1,14 @@ +local Path = GetPath() +if not WildcardMatch(Path, "scripts/cars/tt.con", true, true) then + return +end +local GamePath = GetGamePath(Path) +local CON = MFKLexer.Lexer:Parse(ReadFile(GamePath)) + +CON:AddFunction("SetCharactersVisible", 1) +CON:AddFunction("SetDriver", "none") +CON:AddFunction("SetHasDoors", 0) +CON:AddFunction("SetIrisTransition", 1) +CON:AddFunction("SetShadowAdjustments", {-0.65, -0.45, -0.6, 0.5, -0.6, 0.15, -0.6, 0.7}) + +CON:Output(true) \ No newline at end of file diff --git a/ForcedCar/Resources/HandleCarTune.lua b/ForcedCar/Resources/HandleCarTune.lua new file mode 100644 index 0000000..a3d9915 --- /dev/null +++ b/ForcedCar/Resources/HandleCarTune.lua @@ -0,0 +1,22 @@ +local Path = GetPath() +local GamePath = GetGamePath(Path) + +local SPT = SPTParser.SPTFile(GamePath) + +local changed = false + +for carSoundParameters in SPT:GetClasses("carSoundParameters") do + for method, index in carSoundParameters:GetMethods(true) do + local name = method.Name + if name == "SetEngineClipName" or name == "SetEngineIdleClipName" then + if method.Parameters[1] == "tt" then + method.Parameters[1] = "apu_car" + changed = true + end + end + end +end + +if changed then + Output(tostring(SPT)) +end \ No newline at end of file diff --git a/ForcedCar/Resources/HandleTTModel.lua b/ForcedCar/Resources/HandleTTModel.lua new file mode 100644 index 0000000..bdb5adb --- /dev/null +++ b/ForcedCar/Resources/HandleTTModel.lua @@ -0,0 +1,14 @@ +local Path = GetPath() +local GamePath = GetGamePath(Path) + +local P3DFile = P3D.P3DFile(GamePath) + +local Skeleton = P3DFile:GetChunk(P3D.Identifiers.Skeleton) +if not Skeleton then + return +end + +Skeleton:AddChunk(P3D.SkeletonJointP3DChunk("dl", 0, -1, -1, -1, -1, -1, P3D.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.18, -0.0539, 0.0639, 1))) +Skeleton:AddChunk(P3D.SkeletonJointP3DChunk("pl", 0, -1, -1, -1, -1, -1, P3D.Matrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0.55, -0.0539, 0.0639, 1))) + +P3DFile:Output() \ No newline at end of file diff --git a/ForcedCar/Resources/lib/P3D2.lua b/ForcedCar/Resources/lib/P3D2.lua new file mode 100644 index 0000000..d64f743 --- /dev/null +++ b/ForcedCar/Resources/lib/P3D2.lua @@ -0,0 +1,1169 @@ +--[[ +CREDITS: + Proddy#7272 - P3D Class System + EnAppelsin#9506 - Original P3D Lua Idea + luca$ Cardellini#5473 - P3D Chunk Structures +]] + +P3D = {} +P3D.Version = "2.3" +P3D.Identifiers = { + Anim = 0x3F0000C, + Animated_Object = 0x20001, + Animated_Object_Animation = 0x20002, + Animated_Object_Factory = 0x20000, + Animation = 0x121000, + Animation_Channel_Count = 0x121007, + Animation_Group = 0x121001, + Animation_Group_List = 0x121002, + Animation_Header = 0x121006, + Animation_Size = 0x121004, + Anim_Coll = 0x3F00008, + Anim_Dyna_Phys = 0x3F0000E, + Anim_Dyna_Phys_Wrapper = 0x3F0000F, + Anim_Obj_Wrapper = 0x3F00010, + ATC = 0x3000602, + Boolean_Channel = 0x121108, + Bounding_Box = 0x10003, + Bounding_Sphere = 0x10004, + Breakable_Object = 0x3001000, + Camera = 0x2200, + Channel_Interpolation_Mode = 0x121110, + Collision_Axis_Aligned_Bounding_Box = 0x7010006, + Collision_Cylinder = 0x7010003, + Collision_Effect = 0x3000600, + Collision_Object = 0x7010000, + Collision_Object_Attribute = 0x7010023, + Collision_Oriented_Bounding_Box = 0x7010004, + Collision_Sphere = 0x7010002, + Collision_Vector = 0x7010007, + Collision_Volume = 0x7010001, + Collision_Volume_Owner = 0x7010021, + Collision_Volume_Owner_Name = 0x7010022, + Collision_Wall = 0x7010005, + Colour_Channel = 0x121109, + Colour_List = 0x10008, + Composite_Drawable = 0x4512, + Composite_Drawable_Effect = 0x4518, + Composite_Drawable_Effect_List = 0x4517, + Composite_Drawable_Prop = 0x4516, + Composite_Drawable_Prop_List = 0x4514, + Composite_Drawable_Skin = 0x4515, + Composite_Drawable_Skin_List = 0x4513, + Composite_Drawable_Sort_Order = 0x4519, + Compressed_Quaternion_Channel = 0x121111, + Compressed_Quaternion_Channel_2 = 0x121112, + Dyna_Phys = 0x3F00002, + Entity_Channel = 0x121107, + Export_Info = 0x7030, + Export_Info_Named_Integer = 0x7032, + Export_Info_Named_String = 0x7031, + Expression = 0x21000, + Expression_Group = 0x21001, + Expression_Mixer = 0x21002, + Fence = 0x3F00007, + Fence_2 = 0x3000000, + Float_1_Channel = 0x121100, + Float_2_Channel = 0x121101, + Follow_Camera_Data = 0x3000100, + Frame_Controller = 0x121201, + Frontend_Group = 0x18004, + Frontend_Image_Resource = 0x18100, + Frontend_Language = 0x1800E, + Frontend_Layer = 0x18003, + Frontend_Multi_Sprite = 0x18006, + Frontend_Multi_Text = 0x18007, + Frontend_Page = 0x18002, + Frontend_Polygon = 0x18009, + Frontend_Project = 0x18000, + Frontend_Pure3D_Object = 0x18008, + Frontend_Pure3D_Resource = 0x18101, + Frontend_Screen = 0x18001, + Frontend_String_Hard_Coded = 0x1800C, + Frontend_String_Text_Bible = 0x1800B, + Frontend_Text_Bible = 0x1800D, + Frontend_Text_Bible_Resource = 0x18105, + Frontend_Text_Style_Resource = 0x18104, + Game_Attr = 0x12000, + Game_Attribute_Integer_Parameter = 0x12001, + Game_Attribute_Float_Parameter = 0x12002, + Game_Attribute_Colour_Parameter = 0x12003, + Game_Attribute_Vector_Parameter = 0x12004, + Game_Attribute_Matrix_Parameter = 0x12005, + History = 0x7000, + Image = 0x19001, + Image_Data = 0x19002, + Index_List = 0x1000A, + Instance_List = 0x3000008, + Inst_Particle_System = 0x3001001, + Inst_Stat_Entity = 0x3F00009, + Inst_Stat_Phys = 0x3F0000A, + Integer_Channel = 0x12110E, + Intersect = 0x3F00003, + Intersection = 0x3000004, + Intersect_Mesh = 0x1008, + Intersect_Mesh_2 = 0x1009, + Lens_Flare = 0x3F0000D, + Light = 0x13000, + Light_Direction = 0x13001, + Light_Group = 0x2380, + Light_Illumination_Type = 0x13008, + Light_Position = 0x13002, + Light_Shadow = 0x13004, + Locator = 0x3000005, + Locator_3 = 0x14000, + Locator_Matrix = 0x300000C, + Matrix_List = 0x1000B, + Matrix_Palette = 0x1000D, + Mesh = 0x10000, + Multi_Controller = 0x48A0, + Multi_Controller_2 = 0x121202, + Multi_Controller_Track = 0x121203, + Multi_Controller_Tracks = 0x48A1, + Normal_List = 0x10006, + Old_Base_Emitter = 0x15805, + Old_Billboard_Display_Info = 0x17003, + Old_Billboard_Perspective_Info = 0x17004, + Old_Billboard_Quad = 0x17001, + Old_Billboard_Quad_Group = 0x17002, + Old_Colour_Offset_List = 0x121300, + Old_Emitter_Animation = 0x15809, + Old_Expression_Offsets = 0x10018, + Old_Frame_Controller = 0x121200, + Old_Generator_Animation = 0x1580A, + Old_Index_Offset_List = 0x121303, + Old_Offset_List = 0x1000E, + Old_Particle_Animation = 0x15808, + Old_Particle_Instancing_Info = 0x1580B, + Old_Primitive_Group = 0x10002, + Old_Scenegraph_Branch = 0x120102, + Old_Scenegraph_Drawable = 0x120107, + Old_Scenegraph_Light_Group = 0x120109, + Old_Scenegraph_Root = 0x120101, + Old_Scenegraph_Sort_Order = 0x12010A, + Old_Scenegraph_Transform = 0x120103, + Old_Scenegraph_Visibility = 0x120104, + Old_Sprite_Emitter = 0x15806, + Old_Vector_Offset_List = 0x121301, + Old_Vector2_Offset_List = 0x121302, + Old_Vertex_Anim_Key_Frame = 0x121304, + Packed_Normal_List = 0x10010, + Particle_System_2 = 0x15801, + Particle_System_Factory = 0x15800, + Path = 0x300000B, + Physics_Inertia_Matrix = 0x7011001, + Physics_Joint = 0x7011020, + Physics_Object = 0x7011000, + Physics_Vector = 0x7011002, + Position_List = 0x10005, + Quaternion_Channel = 0x121105, + Rail_Cam = 0x300000A, + Render_Status = 0x10017, + Road = 0x3000003, + Road_Data_Segment = 0x3000009, + Road_Segment = 0x3000002, + Scenegraph = 0x120100, + Set = 0x3000110, + Shader = 0x11000, + Shader_Colour_Parameter = 0x11005, + Shader_Float_Parameter = 0x11004, + Shader_Integer_Parameter = 0x11003, + Shader_Texture_Parameter = 0x11002, + Skeleton = 0x4500, + Skeleton_Joint = 0x4501, + Skeleton_Joint_Bone_Preserve = 0x4504, + Skeleton_Joint_Mirror_Map = 0x4503, + Skin = 0x10001, + Spline = 0x3000007, + Sprite = 0x19005, + State_Prop_Callback_Data = 0x8020005, + State_Prop_Data_V1 = 0x8020000, + State_Prop_Event_Data = 0x8020004, + State_Prop_Frame_Controller_Data = 0x8020003, + State_Prop_State_Data_V1 = 0x8020001, + State_Prop_Visibilities_Data = 0x8020002, + Static_Entity = 0x3F00000, + Static_Phys = 0x3F00001, + Surface_Type_List = 0x300000E, + Texture = 0x19000, + Texture_Animation = 0x3520, + Texture_Font = 0x22000, + Texture_Glyph_List = 0x22001, + Tree = 0x3F00004, + Tree_Node = 0x3F00005, + Tree_Node_2 = 0x3F00006, + Trigger_Volume = 0x3000006, + UV_List = 0x10007, + Vector_1D_OF_Channel = 0x121102, + Vector_2D_OF_Channel = 0x121103, + Vector_3D_OF_Channel = 0x121104, + Vertex_Shader = 0x10011, + Volume_Image = 0x19004, + Walker_Camera_Data = 0x3000101, + Weight_List = 0x1000C, + World_Sphere = 0x3F0000B, +} +P3D.IdentifiersLookup = {} +P3D.IdentifierIds = {} +local IdentifierIdsN = 0 +for k,v in pairs(P3D.Identifiers) do + IdentifierIdsN = IdentifierIdsN + 1 + P3D.IdentifierIds[IdentifierIdsN] = v + P3D.IdentifiersLookup[v] = k +end + +P3D.ChunkClasses = {} + +local math_atan = math.atan +local math_cos = math.cos +local math_deg = math.deg +local math_floor = math.floor +local math_max = math.max +local math_min = math.min +local math_rad = math.rad +local math_sin = math.sin +local math_sqrt = math.sqrt + +local string_find = string.find +local string_format = string.format +local string_match = string.match +local string_pack = string.pack +local string_rep = string.rep +local string_sub = string.sub +local string_unpack = string.unpack + +local table_concat = table.concat +local table_insert = table.insert +local table_move = table.move +local table_remove = table.remove +local table_unpack = table.unpack + +local assert = assert +local getmetatable = getmetatable +local setmetatable = setmetatable +local tostring = tostring +local type = type + +function P3D.MakeP3DString(str) + if str == nil then return nil end + local diff = #str & 3 + if diff ~= 0 then + return str .. string_rep("\0", 4 - diff) + end + return str +end + +function P3D.CleanP3DString(str) + if str == nil then return nil end + local strLen = #str + if strLen == 0 then return str end + local null = string_find(str, "\0", 1, true) + if null == nil then return str end + return string_sub(str, 1, null-1) +end + +local function DegToRad(self) + for k,v in pairs(self) do + if type(v) == "number" then + self[k] = math_rad(v) + end + end +end + +local function RadToDeg(self) + for k,v in pairs(self) do + if type(v) == "number" then + self[k] = math_deg(v) + end + end +end + +local Vector2 = setmetatable({DegToRad = DegToRad, RadToDeg = RadToDeg}, {__call = function(self, X, Y) + assert(type(X) == "number", "Arg #1 (X) must be a number") + assert(type(Y) == "number", "Arg #2 (Y) must be a number") + + local Data = { + X = X, + Y = Y + } + + self.__index = self + return setmetatable(Data, self) +end}) +P3D.Vector2 = Vector2 + +local function IsVector2(obj) + return getmetatable(obj) == Vector2 +end +P3D.IsVector2 = IsVector2 + +function Vector2:__unm() + return Vector2(-self.X, -self.Y) +end +function Vector2:__add(vector) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(IsVector2(vector), "Arg #1 (vector) must be a Vector2") + + return Vector2(self.X + vector.X, self.Y + vector.Y) +end +function Vector2:__sub(vector) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(IsVector2(vector), "Arg #1 (vector) must be a Vector2") + + return Vector2(self.X - vector.X, self.Y - vector.Y) +end +function Vector2:__mul(value) + if type(self) == "number" then + assert(IsVector2(value), "Arg #1 (value) must be a Vector2 when multiplying with a number") + + return Vector2(value.X * self, value.Y * self) + elseif type(value) == "number" then + assert(IsVector2(self), "Arg #0 (self) must be a Vector2 when multiplying with a number") + + return Vector2(self.X * value, self.Y * value) + else + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(IsVector2(value), "Arg #1 (value) must be a Vector2") + + return Vector2(self.X * value.X, self.Y * value.Y) + end +end +function Vector2:__div(value) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(type(value) == "number", "Arg #1 (value) must be a number") + + return Vector2(self.X / value, self.Y / value) +end +function Vector2:__eq(vector) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + + -- Not sure if should assert or return false + --assert(IsVector2(vector), "Arg #1 (vector) must be a Vector2") + if not IsVector2(vector) then + return false + end + + return self.X == vector.X and self.Y == vector.Y +end +function Vector2:__tostring() + return string_format("{ X = %.3f, Y = %.3f }", self.X, self.Y) +end +function Vector2:Set(X, Y) + if IsVector2(X) then + self.X = X.X + self.Y = X.Y + else + assert(X == nil or type(X) == "number", "Arg #1 (X or Vector2) must be either a number or a Vector2") + assert(Y == nil or type(Y) == "number", "Arg #2 (Y) must be a number") + self.X = X or self.X + self.Y = Y or self.Y + end +end +function Vector2:Clone() + return Vector2(self.X, self.Y) +end +function Vector2:GetMag() + return math_sqrt(self.X^2 + self.Y^2) +end +function Vector2:GetMagSq() + return self.X^2 + self.Y^2 +end +function Vector2:SetMag(mag) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(type(mag) == "number", "Arg #1 (mag) must be a number") + assert(self:GetMag() ~= 0, "Cannot set magnitude when direction is ambiguous") + + self:Norm() + local v = self * mag + self:Set(v) + return self +end +function Vector2:Dist(vector) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(IsVector2(vector), "Arg #1 (vector) must be a Vector2") + + return math_sqrt((self.X - vector.X)^2 + (self.Y - vector.Y)^2) +end +function Vector2:Dot(vector) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(IsVector2(vector), "Arg #1 (vector) must be a Vector2") + + return self.X * vector.X + self.Y * vector.Y +end +function Vector2:Norm() + local mag = self:GetMag() + if mag ~= 0 then + self:Set(self / mag) + end + return self +end +function Vector2:Heading() + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + + return -math_atan(self.Y, self.X) +end +function Vector2:Rotate(theta) + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + assert(type(theta) == "number", "Arg #1 (theta) must be a number") + + local s = math_sin(theta) + local c = math_cos(theta) + local v = Vector2(c * self.X + s * self.Y, -(s * self.X) + c * self.Y) + self:Set(v) + return self +end +function Vector2:Array() + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + + return {self.X, self.Y} +end +function Vector2:Unpack() + assert(IsVector2(self), "Arg #0 (self) must be a Vector2") + + return self.X, self.Y +end + +local Vector3 = setmetatable({DegToRad = DegToRad, RadToDeg = RadToDeg}, {__call = function(self, X, Y, Z) + assert(type(X) == "number", "Arg #1 (X) must be a number") + assert(type(Y) == "number", "Arg #2 (Y) must be a number") + assert(type(Z) == "number", "Arg #3 (Z) must be a number") + + local Data = { + X = X, + Y = Y, + Z = Z + } + + self.__index = self + return setmetatable(Data, self) +end}) +P3D.Vector3 = Vector3 + +local function IsVector3(obj) + return getmetatable(obj) == Vector3 +end +P3D.IsVector3 = IsVector3 + +function Vector3:__tostring() + return string_format("{ X = %.3f, Y = %.3f, Z = %.3f }", self.X, self.Y, self.Z) +end +function Vector3:Set(X, Y, Z) + if IsVector3(X) then + self.X = X.X + self.Y = X.Y + self.Z = X.Z + else + assert(X == nil or type(X) == "number", "Arg #1 (X or Vector3) must be either a number or a Vector3") + assert(Y == nil or type(Y) == "number", "Arg #2 (Y) must be a number") + assert(Z == nil or type(Z) == "number", "Arg #3 (Z) must be a number") + self.X = X or self.X + self.Y = Y or self.Y + self.Z = Z or self.Z + end +end +function Vector3:Clone() + return Vector3(self.X, self.Y, self.Z) +end + +P3D.SymmetricMatrix3x3 = setmetatable({DegToRad = DegToRad, RadToDeg = RadToDeg}, {__call = function(self, XX, XY, XZ, YY, YZ, ZZ) + assert(type(XX) == "number", "Arg #1 (XX) must be a number") + assert(type(XY) == "number", "Arg #2 (XY) must be a number") + assert(type(XZ) == "number", "Arg #3 (XZ) must be a number") + assert(type(YY) == "number", "Arg #4 (YY) must be a number") + assert(type(YZ) == "number", "Arg #5 (YZ) must be a number") + assert(type(ZZ) == "number", "Arg #6 (ZZ) must be a number") + + local Data = { + XX = XX, + XY = XY, + XZ = XZ, + YY = YY, + YZ = YZ, + ZZ = ZZ + } + + self.__index = self + return setmetatable(Data, self) +end}) +function P3D.SymmetricMatrix3x3:__tostring() + return string_format("{ XX = %.3f, XY = %.3f, XZ = %.3f, YY = %.3f, YZ = %.3f, ZZ = %.3f }", self.XX, self.XY, self.XZ, self.YY, self.YZ, self.ZZ) +end + +P3D.Quaternion = setmetatable({DegToRad = DegToRad, RadToDeg = RadToDeg}, {__call = function(self, W, X, Y, Z) + assert(type(W) == "number", "Arg #1 (W) must be a number") + assert(type(X) == "number", "Arg #2 (X) must be a number") + assert(type(Y) == "number", "Arg #3 (Y) must be a number") + assert(type(Z) == "number", "Arg #4 (Z) must be a number") + + local Data = { + W = W, + X = X, + Y = Y, + Z = Z + } + + self.__index = self + return setmetatable(Data, self) +end}) +function P3D.Quaternion:__tostring() + return string_format("{ W = %.3f, X = %.3f, Y = %.3f, Z = %.3f }", self.W, self.X, self.Y, self.Z) +end + +local Matrix = setmetatable({DegToRad = DegToRad, RadToDeg = RadToDeg}, {__call = function(self, M11, M12, M13, M14, M21, M22, M23, M24, M31, M32, M33, M34, M41, M42, M43, M44) + assert(type(M11) == "number", "Arg #1 (M11) must be a number") + assert(type(M12) == "number", "Arg #2 (M12) must be a number") + assert(type(M13) == "number", "Arg #3 (M13) must be a number") + assert(type(M14) == "number", "Arg #4 (M14) must be a number") + assert(type(M21) == "number", "Arg #5 (M21) must be a number") + assert(type(M22) == "number", "Arg #6 (M22) must be a number") + assert(type(M23) == "number", "Arg #7 (M23) must be a number") + assert(type(M24) == "number", "Arg #8 (M24) must be a number") + assert(type(M31) == "number", "Arg #9 (M31) must be a number") + assert(type(M32) == "number", "Arg #10 (M32) must be a number") + assert(type(M33) == "number", "Arg #11 (M33) must be a number") + assert(type(M34) == "number", "Arg #12 (M34) must be a number") + assert(type(M41) == "number", "Arg #13 (M41) must be a number") + assert(type(M42) == "number", "Arg #14 (M42) must be a number") + assert(type(M43) == "number", "Arg #15 (M43) must be a number") + assert(type(M44) == "number", "Arg #16 (M44) must be a number") + + local Data = { + M11 = M11, + M12 = M12, + M13 = M13, + M14 = M14, + M21 = M21, + M22 = M22, + M23 = M23, + M24 = M24, + M31 = M31, + M32 = M32, + M33 = M33, + M34 = M34, + M41 = M41, + M42 = M42, + M43 = M43, + M44 = M44 + } + + self.__index = self + return setmetatable(Data, self) +end}) +P3D.Matrix = Matrix + +local function IsMatrix(obj) + return getmetatable(obj) == Matrix +end +P3D.IsMatrix = Matrix + +function Matrix:__tostring() + return string_format("{ { %.3f, %.3f, %.3f, %.3f }, { %.3f, %.3f, %.3f, %.3f }, { %.3f, %.3f, %.3f, %.3f }, { %.3f, %.3f, %.3f, %.3f } }", self.M11, self.M12, self.M13, self.M14, self.M21, self.M22, self.M23, self.M24, self.M31, self.M32, self.M33, self.M34, self.M41, self.M42, self.M43, self.M44) +end + +P3D.Colour = setmetatable({}, {__call = function(self, R, G, B, A) + assert(type(R) == "number", "Arg #1 (R) must be a number") + assert(type(G) == "number", "Arg #2 (G) must be a number") + assert(type(B) == "number", "Arg #3 (B) must be a number") + assert(A == nil or type(A) == "number", "Arg #4 (A) must be a number") + A = A or 255 + + local Data = { + R = R & 0xFF, + G = G & 0xFF, + B = B & 0xFF, + A = A & 0xFF + } + + self.__index = self + return setmetatable(Data, self) +end}) +function P3D.Colour:__tostring() + return string_format("R = %d, G = %d, B = %d, A = %d", self.R, self.G, self.B, self.A) +end +function P3D.Colour:ToArgb() + return (self.A << 24) | (self.R << 16) | (self.G << 8) | self.B +end +function P3D.Colour:FromArgb(ARGB) + assert(type(ARGB) == "number", "Arg #1 (ARGB) must be a number") + + local Data = { + R = (ARGB >> 16) & 0xFF, + G = (ARGB >> 8) & 0xFF, + B = ARGB & 0xFF, + A = (ARGB >> 24) & 0xFF + } + + self.__index = self + return setmetatable(Data, self) +end +function P3D.Colour:ToHSL() + local R, G, B = self.R / 255, self.G / 255, self.B / 255 + local max, min = math_max(R, G, B), math_min(R, G, B) + local H, S, L = 0, 0, (max + min) / 2 + + if max ~= min then + local delta = max - min + S = L > 0.5 and delta / (2 - max - min) or delta / (max + min) + + if max == R then + H = (G - B) / delta + (G < B and 6 or 0) + elseif max == G then + H = (B - R) / delta + 2 + elseif max == B then + H = (R - G) / delta + 4 + end + + H = H / 6 + end + + return H * 360, S * 100, L * 100 +end +function P3D.Colour:FromHSL(H, S, L, A) + assert(type(H) == "number", "Arg #1 (H) must be a number") + assert(type(S) == "number", "Arg #2 (S) must be a number") + assert(type(L) == "number", "Arg #3 (L) must be a number") + assert(A == nil or type(A) == "number", "Arg #4 (A) must be a number") + + H, S, L = H / 360, S / 100, L / 100 + local R, G, B + + if S == 0 then + R, G, B = L, L, L + else + local function hue2rgb(p, q, t) + if t < 0 then t = t + 1 end + if t > 1 then t = t - 1 end + if t < 1/6 then return p + (q - p) * 6 * t end + if t < 1/2 then return q end + if t < 2/3 then return p + (q - p) * (2/3 - t) * 6 end + return p + end + + local q = L < 0.5 and L * (1 + S) or L + S - L * S + local p = 2 * L - q + R = hue2rgb(p, q, H + 1/3) + G = hue2rgb(p, q, H) + B = hue2rgb(p, q, H - 1/3) + end + A = A or 255 + + local Data = { + R = math_floor(R * 255) & 0xFF, + G = math_floor(G * 255) & 0xFF, + B = math_floor(B * 255) & 0xFF, + A = A & 0xFF + } + + self.__index = self + return setmetatable(Data, self) +end +P3D.Color = P3D.Colour + +-- LZR (Lempel - Ziv - Radical) Decompression +local function DecompressBlock(Input, OutputSize, InputPos) + local Output = {} + local OutputPos = 1 + + while OutputPos <= OutputSize do + local code + code, InputPos = string_unpack(" 15 then + local matchLength = code & 15 + local tmp + + if matchLength == 0 then + matchLength = 15 + tmp, InputPos = string_unpack("> 4) | tmp << 4 + local matchPos = OutputPos - offset + + local len = matchLength >> 2 + matchLength = matchLength - (len << 2) + + repeat + Output[OutputPos] = Output[matchPos] + Output[OutputPos + 1] = Output[matchPos + 1] + Output[OutputPos + 2] = Output[matchPos + 2] + Output[OutputPos + 3] = Output[matchPos + 3] + matchPos = matchPos + 4 + OutputPos = OutputPos + 4 + len = len - 1 + until len == 0 + + while matchLength ~= 0 do + Output[OutputPos] = Output[matchPos] + matchPos = matchPos + 1 + OutputPos = OutputPos + 1 + matchLength = matchLength - 1 + end + else + local runLength = code + + if runLength == 0 then + code, InputPos = string_unpack("= 12, "Contents too short") + + local Data = { + Endian = "<" + } + + local Identifier, HeaderLength, Length, Pos = string_unpack("III", contents) + Data.Endian = ">" + end + assert(Identifier == FileSignature, "Contents is not a valid P3D file") + + ProcessSubChunks(Data, contents, Pos, Length) + + self.__index = self + return setmetatable(Data, self) +end + +local function LoadP3DFile(self, Path, NewOnDoesntExist) + if Path == nil then + self.__index = self + return setmetatable({ Endian = "<", Chunks = {} }, self) + else + if not Exists(Path, true, false) then + assert(NewOnDoesntExist, "Could not find the path specified in Arg #1: " .. Path) + + self.__index = self + return setmetatable({ Endian = "<", Chunks = {} }, self) + end + local success, contents = pcall(ReadFile, Path) + assert(success, string_format("Failed to read file at '%s': %s", Path, contents)) + + return LoadP3DFileFromData(self, contents) + end +end + +local function AddChunk(self, Chunk, Index) + assert(type(Chunk) == "table" and Chunk.Identifier, "Arg #1 (Chunk) must be a valid chunk") + assert(Index == nil or (type(Index) == "number" and Index <= #self.Chunks + 1), "Arg #2 (Index) must be a number smaller than the chunk count") + + if Index then + table_insert(self.Chunks, Index, Chunk) + else + self.Chunks[#self.Chunks + 1] = Chunk + end +end + +local function SetChunk(self, Chunk, Index) + assert(type(Chunk) == "table" and Chunk.Identifier, "Arg #1 (Chunk) must be a valid chunk") + assert(type(Index) == "number" and Index <= #self.Chunks, "Arg #2 (Index) must be a number smaller than the chunk count") + + self.Chunks[Index] = Chunk +end + +local function RemoveChunk(self, ChunkOrIndex) + local t = type(ChunkOrIndex) + if t == "number" then + assert(ChunkOrIndex > 0 and ChunkOrIndex <= #self.Chunks, "Arg #1 (Index) must be above 0 and below chunk count") + table_remove(self.Chunks, ChunkOrIndex) + elseif t == "table" then + assert(ChunkOrIndex.Identifier, "Arg #1 (Chunk) must be a valid chunk") + for i=1,#self.Chunks do + if self.Chunks[i] == ChunkOrIndex then + table_remove(self.Chunks, i) + return + end + end + else + error("Arg #1 (ChunkOrIndex) must be a number or a valid chunk") + end +end + +local function GetChunks(self, Identifier, Backwards, Name) + assert(Identifier == nil or type(Identifier) == "number", "Arg #1 (Identifier) must be a number") + assert(Name == nil or type(Name) == "string", "Arg #3 (Name) must be a string") + + local chunks = self.Chunks + local chunkN = #chunks + + local index, finish, step + if Backwards then + index = chunkN + finish = 0 + step = -1 + else + index = 1 + finish = chunkN + 1 + step = 1 + end + + return function() + while index ~= finish do + assert(Backwards or chunkN == #chunks, string_format("Chunk count changed from %d to %d. To add or remove chunks whilst iterating, you must iterate backwards", chunkN, #chunks)) + local Chunk = chunks[index] + index = index + step + if (Identifier == nil or Chunk.Identifier == Identifier) and (Name == nil or Chunk.Name == Name) then + return Chunk + end + end + return nil + end +end + +local function GetChunk(self, Identifier, Backwards, Name) + return GetChunks(self, Identifier, Backwards, Name)() +end + +local function GetChunksIndexed(self, Identifier, Backwards, Name) + assert(Identifier == nil or type(Identifier) == "number", "Arg #1 (Identifier) must be a number") + assert(Name == nil or type(Name) == "string", "Arg #3 (Name) must be a string") + + local chunks = self.Chunks + local chunkN = #chunks + + local index, finish, step + if Backwards then + index = chunkN + finish = 0 + step = -1 + else + index = 1 + finish = chunkN + 1 + step = 1 + end + + return function() + while index ~= finish do + assert(Backwards or chunkN == #chunks, string_format("Chunk count changed from %d to %d. To add or remove chunks whilst iterating, you must iterate backwards", chunkN, #chunks)) + local Chunk = chunks[index] + index = index + step + if (Identifier == nil or Chunk.Identifier == Identifier) and (Name == nil or Chunk.Name == Name) then + return index - step, Chunk + end + end + return nil + end +end + +local function GetChunkIndexed(self, Identifier, Backwards, Name) + return GetChunksIndexed(self, Identifier, Backwards, Name)() +end + +local function Match(self, Filters) + for key, needle in pairs(Filters) do + local value = self[key] + + local valueType = type(value) + local needleType = type(needle) + + if valueType ~= needleType then + return false + end + + if needleType == "string" then + if not string_match(value, needle) and value ~= needle then + return false + end + elseif value ~= needle then + return false + end + end + return true +end + +local function Find(self, Filters, Backwards) + assert(type(Filters) == "table", "Arg #1 (Filters) must be a key/value table.") + + local chunks = self.Chunks + local chunkN = #chunks + + local index, finish, step + if Backwards then + index = chunkN + finish = 0 + step = -1 + else + index = 1 + finish = chunkN + 1 + step = 1 + end + + return function() + while index ~= finish do + assert(Backwards or chunkN == #chunks, string_format("Chunk count changed from %d to %d. To add or remove chunks whilst iterating, you must iterate backwards", chunkN, #chunks)) + local Chunk = chunks[index] + index = index + step + if Match(Chunk, Filters) then + return index - step, Chunk + end + end + return nil + end +end + +local function FindFirst(self, Filters, Backwards) + return Find(self, Filters, Backwards)() +end + +local skip = { + ["Chunks"] = true, + ["Identifier"] = true, + ["ValueStr"] = true, +} +local function P3DChunk_stateless_iter(self, k) + if not self.parentClass then + if k == nil then + return "ValueStr", self.ValueStr + else + return nil + end + end + local v + repeat + k, v = next(self, k) + until k == nil or not skip[k] + return k, v +end +local function P3DChunk_pairs(self) + return P3DChunk_stateless_iter, self, nil +end + +local function Clone(self, seen) + if type(self) ~= 'table' then + return self + end + + if seen and seen[self] then + return seen[self] + end + + local s = seen or {} + local res = {} + s[self] = res + + for k in pairs(skip) do + res[k] = Clone(self[k], s) + end + + for k, v in pairs(self) do + res[Clone(k, s)] = Clone(v, s) + end + + return setmetatable(res, getmetatable(self)) +end + +local function SetLittleEndian(self) + self.Endian = "<" + for i=1,#self.Chunks do + self.Chunks[i]:SetLittleEndian() + end +end + +local function SetBigEndian(self) + self.Endian = ">" + for i=1,#self.Chunks do + self.Chunks[i]:SetBigEndian() + end +end + +P3D.P3DFile = setmetatable({load = LoadP3DFile, new = LoadP3DFile, LoadFromData = LoadP3DFileFromData, AddChunk = AddChunk, SetChunk = SetChunk, RemoveChunk = RemoveChunk, GetChunks = GetChunks, GetChunk = GetChunk, GetChunksIndexed = GetChunksIndexed, GetChunkIndexed = GetChunkIndexed, Match = Match, Find = Find, FindFirst = FindFirst, Clone = Clone, SetLittleEndian = SetLittleEndian, SetBigEndian = SetBigEndian}, {__call = LoadP3DFile}) + +function P3D.P3DFile:__tostring() + local chunks = {} + for i=1,#self.Chunks do + chunks[i] = tostring(self.Chunks[i]) + end + local chunkData = table_concat(chunks) + return string_pack(self.Endian .. "III", FileSignature, 12, 12 + #chunkData) .. chunkData +end + +function P3D.P3DFile:Output() + Output(tostring(self)) +end + +local function P3DChunk_new(self, ...) + if self.Identifier and self.new then + return self:new(...) + else + local args = {...} + local Identifier = args[1] + local ValueStr = args[2] + assert(type(Identifier) == "number", "Arg #1 (Identifier) must be a number") + assert(type(ValueStr) == "string", "Arg #2 (ValueStr) must be a string") + + local Data = { + Chunks = {}, + Identifier = Identifier, + ValueStr = ValueStr, + } + + self.__index = self + return setmetatable(Data, self) + end +end + +local function P3DChunk_Replace(self, NewChunk) + assert(type(NewChunk) == "table", "Arg #1 (NewChunk) must be a chunk table") + + for k in pairs(self) do + self[k] = nil + end + + for k,v in pairs(NewChunk) do + self[k] = v + end + + for key in pairs(skip) do + self[key] = NewChunk[key] + end + + self.__index = NewChunk.__index + setmetatable(self, getmetatable(NewChunk)) +end + +P3D.P3DChunk = setmetatable({new = P3DChunk_new, __pairs = P3DChunk_pairs, AddChunk = AddChunk, SetChunk = SetChunk, RemoveChunk = RemoveChunk, GetChunks = GetChunks, GetChunk = GetChunk, GetChunksIndexed = GetChunksIndexed, GetChunkIndexed = GetChunkIndexed, Match = Match, Find = Find, FindFirst = FindFirst, Clone = Clone, SetLittleEndian = SetLittleEndian, SetBigEndian = SetBigEndian, Replace = P3DChunk_Replace}, {__call = P3DChunk_new}) +function P3D.P3DChunk:parse(Endian, Contents, Pos, DataLength, Identifier) + local Data = {} + + Data.Endian = Endian + Data.Identifier = Identifier + if DataLength > 0 then + Data.ValueStr = string_sub(Contents, Pos, Pos + DataLength - 1) + else + Data.ValueStr = "" + end + + self.__index = self + return setmetatable(Data, self) +end + +function P3D.P3DChunk:__tostring() + local chunks = {} + for i=1,#self.Chunks do + chunks[i] = tostring(self.Chunks[i]) + end + local chunkData = table_concat(chunks) + local headerLen = 12 + #self.ValueStr + return string_pack(self.Endian .. "III", self.Identifier, headerLen, headerLen + #chunkData) .. self.ValueStr .. chunkData +end + +function P3D.P3DChunk:newChildClass(Identifier) + assert(type(Identifier) == "number", "Identifier must be a number") + local class = setmetatable({__pairs = P3DChunk_pairs, Identifier = Identifier, parentClass = self, AddChunk = AddChunk, SetChunk = SetChunk, RemoveChunk = RemoveChunk, GetChunks = GetChunks, GetChunk = GetChunk, GetChunksIndexed = GetChunksIndexed, GetChunkIndexed = GetChunkIndexed, Match = Match, Find = Find, FindFirst = FindFirst, Clone = Clone, SetLittleEndian = SetLittleEndian, SetBigEndian = SetBigEndian, Replace = P3DChunk_Replace}, getmetatable(self)) + P3D.ChunkClasses[Identifier] = class + return class +end + +function P3D.GetIdentifiersWithClasses() + local identifiers = {} + local n = 0 + for k in pairs(P3D.ChunkClasses) do + n = n + 1 + identifiers[n] = k + end + return identifiers, n +end + +function P3D.LoadChunks(Path) + assert(type(Path) == "string", "Path must be a string") + assert(Exists(Path, false, true), 'Could not find directory with path "' .. Path .. '"') + + local files = 0 + DirectoryGetEntries(Path, function(File, IsDirectory) + if IsDirectory then + return true + end + + if GetFileExtension(File):lower() == ".lua" then + dofile(string_format("%s/%s", Path, File)) + files = files + 1 + end + + return true + end) + + local classes, classesN = P3D.GetIdentifiersWithClasses() + print("P3D2.lua", string_format("Loaded %d file%s. Chunk classes: %d/%d.", files, files == 1 and "" or "s", classesN, IdentifierIdsN)) + return files, classes +end + +print("P3D2.lua", string_format("Lua P3D Lib v%s loaded", P3D.Version)) +return P3D \ No newline at end of file diff --git a/ForcedCar/Resources/lib/P3DChunks/SkeletonJointP3DChunk.lua b/ForcedCar/Resources/lib/P3DChunks/SkeletonJointP3DChunk.lua new file mode 100644 index 0000000..b489073 --- /dev/null +++ b/ForcedCar/Resources/lib/P3DChunks/SkeletonJointP3DChunk.lua @@ -0,0 +1,74 @@ +--[[ +CREDITS: + Proddy#7272 - Converting to Lua + luca$ Cardellini#5473 - P3D Chunk Structure +]] + +local P3D = P3D +assert(P3D and P3D.ChunkClasses, "This file must be called after P3D2.lua") +assert(P3D.SkeletonJointP3DChunk == nil, "Chunk type already loaded.") + +local string_format = string.format +local string_pack = string.pack +local string_rep = string.rep +local string_reverse = string.reverse +local string_unpack = string.unpack + +local table_concat = table.concat +local table_unpack = table.unpack + +local assert = assert +local tostring = tostring +local type = type + +local function new(self, Name, Parent, DOF, FreeAxis, PrimaryAxis, SecondaryAxis, TwistAxis, RestPose) + assert(type(Name) == "string", "Arg #1 (Name) must be a string.") + assert(type(Parent) == "number", "Arg #2 (Parent) must be a number.") + assert(type(DOF) == "number", "Arg #3 (DOF) must be a number.") + assert(type(FreeAxis) == "number", "Arg #4 (FreeAxis) must be a number.") + assert(type(PrimaryAxis) == "number", "Arg #5 (PrimaryAxis) must be a number.") + assert(type(SecondaryAxis) == "number", "Arg #6 (SecondaryAxis) must be a number.") + assert(type(TwistAxis) == "number", "Arg #7 (TwistAxis) must be a number.") + assert(type(RestPose) == "table", "Arg #8 (RestPose) must be a table.") + + local Data = { + Endian = "<", + Chunks = {}, + Name = Name, + Parent = Parent, + DOF = DOF, + FreeAxis = FreeAxis, + PrimaryAxis = PrimaryAxis, + SecondaryAxis = SecondaryAxis, + TwistAxis = TwistAxis, + RestPose = RestPose, + } + + self.__index = self + return setmetatable(Data, self) +end + +P3D.SkeletonJointP3DChunk = P3D.P3DChunk:newChildClass(P3D.Identifiers.Skeleton_Joint) +P3D.SkeletonJointP3DChunk.new = new +function P3D.SkeletonJointP3DChunk:parse(Endian, Contents, Pos, DataLength) + local chunk = self.parentClass.parse(self, Endian, Contents, Pos, DataLength, self.Identifier) + + chunk.RestPose = {} + chunk.Name, chunk.Parent, chunk.DOF, chunk.FreeAxis, chunk.PrimaryAxis, chunk.SecondaryAxis, chunk.TwistAxis, chunk.RestPose.M11, chunk.RestPose.M12, chunk.RestPose.M13, chunk.RestPose.M14, chunk.RestPose.M21, chunk.RestPose.M22, chunk.RestPose.M23, chunk.RestPose.M24, chunk.RestPose.M31, chunk.RestPose.M32, chunk.RestPose.M33, chunk.RestPose.M34, chunk.RestPose.M41, chunk.RestPose.M42, chunk.RestPose.M43, chunk.RestPose.M44 = string_unpack(Endian .. "s1Iiiiiiffffffffffffffff", chunk.ValueStr) + chunk.Name = P3D.CleanP3DString(chunk.Name) + + return chunk +end + +function P3D.SkeletonJointP3DChunk:__tostring() + local chunks = {} + for i=1,#self.Chunks do + chunks[i] = tostring(self.Chunks[i]) + end + local chunkData = table_concat(chunks) + + local Name = P3D.MakeP3DString(self.Name) + + local headerLen = 12 + #Name + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 64 + return string_pack(self.Endian .. "IIIs1Iiiiiiffffffffffffffff", self.Identifier, headerLen, headerLen + #chunkData, Name, self.Parent, self.DOF, self.FreeAxis, self.PrimaryAxis, self.SecondaryAxis, self.TwistAxis, self.RestPose.M11, self.RestPose.M12, self.RestPose.M13, self.RestPose.M14, self.RestPose.M21, self.RestPose.M22, self.RestPose.M23, self.RestPose.M24, self.RestPose.M31, self.RestPose.M32, self.RestPose.M33, self.RestPose.M34, self.RestPose.M41, self.RestPose.M42, self.RestPose.M43, self.RestPose.M44) .. chunkData +end \ No newline at end of file diff --git a/ForcedCar/Resources/lib/P3DChunks/SkeletonP3DChunk.lua b/ForcedCar/Resources/lib/P3DChunks/SkeletonP3DChunk.lua new file mode 100644 index 0000000..60ca2d0 --- /dev/null +++ b/ForcedCar/Resources/lib/P3DChunks/SkeletonP3DChunk.lua @@ -0,0 +1,71 @@ +--[[ +CREDITS: + Proddy#7272 - Converting to Lua + luca$ Cardellini#5473 - P3D Chunk Structure +]] + +local P3D = P3D +assert(P3D and P3D.ChunkClasses, "This file must be called after P3D2.lua") +assert(P3D.SkeletonP3DChunk == nil, "Chunk type already loaded.") + +local string_format = string.format +local string_pack = string.pack +local string_rep = string.rep +local string_reverse = string.reverse +local string_unpack = string.unpack + +local table_concat = table.concat +local table_unpack = table.unpack + +local assert = assert +local tostring = tostring +local type = type + +local function new(self, Name, Version) + assert(type(Name) == "string", "Arg #1 (Name) must be a string.") + assert(type(Version) == "number", "Arg #2 (Version) must be a number.") + + local Data = { + Endian = "<", + Chunks = {}, + Name = Name, + Version = Version, + } + + self.__index = self + return setmetatable(Data, self) +end + +P3D.SkeletonP3DChunk = P3D.P3DChunk:newChildClass(P3D.Identifiers.Skeleton) +P3D.SkeletonP3DChunk.new = new +function P3D.SkeletonP3DChunk:parse(Endian, Contents, Pos, DataLength) + local chunk = self.parentClass.parse(self, Endian, Contents, Pos, DataLength, self.Identifier) + + chunk.Name, chunk.Version = string_unpack(Endian .. "s1I", chunk.ValueStr) + chunk.Name = P3D.CleanP3DString(chunk.Name) + + return chunk +end + +function P3D.SkeletonP3DChunk:GetNumJoints() + local n = 0 + for i=1,#self.Chunks do + if self.Chunks[i].Identifier == P3D.Identifiers.Skeleton_Joint then + n = n + 1 + end + end + return n +end + +function P3D.SkeletonP3DChunk:__tostring() + local chunks = {} + for i=1,#self.Chunks do + chunks[i] = tostring(self.Chunks[i]) + end + local chunkData = table_concat(chunks) + + local Name = P3D.MakeP3DString(self.Name) + + local headerLen = 12 + #Name + 1 + 4 + 4 + return string_pack(self.Endian .. "IIIs1II", self.Identifier, headerLen, headerLen + #chunkData, Name, self.Version, self:GetNumJoints()) .. chunkData +end \ No newline at end of file diff --git a/ForcedCar/Resources/lib/RCF.lua b/ForcedCar/Resources/lib/RCF.lua new file mode 100644 index 0000000..d1ab90a --- /dev/null +++ b/ForcedCar/Resources/lib/RCF.lua @@ -0,0 +1,122 @@ +local assert = assert +local type = type + +local string_byte = string.byte +local string_find = string.find +local string_pack = string.pack +local string_rep = string.rep +local string_sub = string.sub +local string_unpack = string.unpack + +RCF = {} +local RadCoreSignature = "RADCORE CEMENT LIBRARY" .. string.rep("\0", 10) +local ATGCoreSignature = "ATG CORE CEMENT LIBRARY" .. string.rep("\0", 9) -- Unused by SHAR, unsupported + +local SupportedMajorVersion = 1 +local SupportedMinorVersion = 2 + +local function radMakeCaseInsensitiveKey32(pToken, keyValue) + keyValue = keyValue or 0 + + local chars = {string_byte(pToken, 1, #pToken)} + local c + for i=1,#pToken do + local c = chars[i] + if c < 97 then + c = c + 32 + end + keyValue = ((keyValue << 5) - keyValue + c) & 0xFFFFFFFF + end + + return keyValue +end + +local function NullTerminate(str) + if str == nil then return nil end + local strLen = #str + if strLen == 0 then return str end + local null = string_find(str, "\0", 1, true) + if null == nil then return str end + return string_sub(str, 1, null-1) +end + +RCF.RCFFile = setmetatable({}, { + __call = function(self, Path) + if Path == nil then + local Data = { + BigEndian = 0, + Alignment = 2048, + PadNetSize = 0, + HashedFileEntriesPointer = 0, + HashedFileEntriesPointer = 0, + Files = {} + } + + self.__index = self + return setmetatable(Data, self) + end + assert(type(Path) == "string", "Arg #1 (Path) must be a string.") + assert(Exists(Path, true, false), "Arg #1 (Path) must be a valid filepath.") + + local contents = ReadFile(Path) + + local Data = {} + + local signature, pos = string_unpack("" or "<" + + local headerStartPos + Data.Alignment, Data.PadNetSize, headerStartPos, pos = string_unpack(endian .. "III", contents, pos) + + local numFiles, detailedFileInfoStartPos, firstFileStartPos, hashedFileEntriesPointer, pos = string_unpack(endian .. "III 0 and Index <= #self.Classes, "Arg #1 (Index) out of bounds.") + table_remove(self.Classes, Index) +end + +function SPTParser.SPTFile:__tostring() + local Classes = self.Classes + + local Output = {} + for i=1,#Classes do + Output[i] = tostring(Classes[i]) + end + + return table_concat(Output) +end + +SPTParser.Class = setmetatable({}, { + __call = function(self, classType, className, classData) + assert(type(classType) == "string", "ClassType (Arg #1) must be a string.") + assert(type(className) == "string", "ClassName (Arg #2) must be a string.") + assert(classData == nil or type(classData) == "string", "ClassData (Arg #3) must be a string.") + + local knownClass = KnownClasses[classType] + assert(knownClass, "Unknown class type: " .. classType) + + local Class = { + Type = classType, + Name = className, + } + + local Methods = {} + local MethodsN = 0 + Class.Methods = Methods + + if classData then + for line in string_gmatch(classData, "[^\r\n]+") do + if not CurlyBraces[line] then + local methodName, methodParameters, methodOption = string_match(line, "%s+(.-)%s+%(%s+(.-)%s+%)%s+option%s+(.+)") + if methodName == nil then + methodName, methodParameters = string_match(line, "%s+(.-)%s+%(%s+(.-)%s+%)") + end + + if methodName ~= nil then + local knownMethod = knownClass[methodName] + assert(knownMethod, string_format("Unknown method: %s->%s", classType, methodName)) + local numParameters = #knownMethod + + local method = { + Name = methodName, + Option = methodOption, + } + MethodsN = MethodsN + 1 + Methods[MethodsN] = method + + if numParameters == 0 then + -- No arguments + assert(#methodParameters == 0, string_format("Method \"%s->%s\" should have no parameters, but some where specified.", classType, methodName)) + method.Parameters = {} + else + local parameterPattern = {} + for i=1,numParameters do + local param = knownMethod[i] + local paramType = param[2] + + local pattern = TypePatternMap[paramType] + assert(pattern, string_format("Unknown param type: %s", paramType)) + + parameterPattern[i] = pattern + end + parameterPattern = table_concat(parameterPattern, "%s+") + + local parameters = {string_match(methodParameters, "^" .. parameterPattern .. "$")} + assert(#parameters == numParameters, string_format("Method \"%s->%s\" should have %i parameters.", classType, methodName, numParameters)) + + for i=1,numParameters do + local param = knownMethod[i] + local paramType = param[2] + + local luaType = TypeMap[paramType] + if luaType == "string" then + -- Already a string + elseif luaType == "number" then + parameters[i] = tonumber(parameters[i]) + elseif luaType == "boolean" then + local bool = BoolMap[parameters[i]] + assert(bool ~= nil, "Invalid bool parameter value") + parameters[i] = bool + end + end + + method.Parameters = parameters + end + end + end + end + end + + self.__index = self + return setmetatable(Class, self) + end, +}) + +function SPTParser.Class:GetMethods(Backwards, Name) + assert(Name == nil or type(Name) == "string", "Arg #2 (Name) must be a string.") + + local methods = self.Methods + local methodsN = #methods + + local index, finish, step + if Backwards then + index = methodsN + finish = 0 + step = -1 + else + index = 1 + finish = methodsN + 1 + step = 1 + end + + return function() + while index ~= finish do + assert(Backwards or methodsN == #methods, string_format("Method count changed from %d to %d. To add or remove methods whilst iterating, you must iterate backwards", methodsN, #methods)) + local Method = methods[index] + index = index + step + if Name == nil or Method.Name == Name then + return Method, index - step + end + end + return nil + end +end + +function SPTParser.Class:GetMethod(Backwards, Name) + return self:GetMethods(Backwards, Name)() +end + +function SPTParser.Class:AddMethod(Name, Parameters, Option) + assert(type(Name) == "string", "Name (Arg #1) must be a string.") + assert(type(Parameters) == "table", "Parameters (Arg #2) must be a table.") + assert(Option == nil or type(Option) == "string", "Option (Arg #3) must be a string.") + + local knownClass = KnownClasses[self.Type] + assert(knownClass, string_format("Unknown class type: %s", self.Type)) + local knownMethod = knownClass[Name] + assert(knownMethod, string_format("Unknown method: %s->%s", self.Type, Name)) + local numParameters = #knownMethod + assert(numParameters == #Parameters, string_format("Method \"%s->%s\" expects %i parameters. Got %i.", self.Type, Name, numParameters, #Parameters)) + + for i=1,numParameters do + local paramType = knownMethod[i][2] + local parameter = Parameters[i] + assert(type(parameter) == TypeMap[paramType], string_format("Method \"%s->%s\" expects parameter %i (%s) to be: %s. Got %s", self.Type, Name, i, knownMethod[i][1], TypeMap[paramType], type(parameter))) + end + + local method = { + Name = Name, + Option = Option, + Parameters = Parameters + } + local methodIndex = #self.Methods + 1 + self.Methods[methodIndex] = method + return method, methodIndex +end + +function SPTParser.Class:RemoveMethod(Index) + assert(type(Index) == "number", "Arg #1 (Index) must be a number.") + assert(Index > 0 and Index <= #self.Methods, "Arg #1 (Index) out of bounds.") + table_remove(self.Methods, Index) +end + +function SPTParser.Class:__tostring() + assert(type(self.Type) == "string", "Class.Type must be a string.") + assert(type(self.Name) == "string", "Class.Name must be a string.") + local knownClass = KnownClasses[self.Type] + assert(knownClass, string_format("Unknown class type: %s", self.Type)) + + local data = {} + local methods = self.Methods + for i=1,#methods do + local method = methods[i] + assert(type(method.Name) == "string", "Method.Name must be a string.") + assert(method.Option == nil or type(method.Option) == "string", "Method.Option must be a string.") + assert(type(method.Parameters) == "table", "Method.Parameters must be a table.") + + local knownMethod = knownClass[method.Name] + assert(knownMethod, string_format("Unknown method: %s->%s", self.Type, method.Name)) + local numParameters = #knownMethod + assert(numParameters == #method.Parameters, string_format("Method \"%s->%s\" expects %i parameters. %i parameters found.", self.Type, method.Name, numParameters, #method.Parameters)) + + local parameterFormat = {" %s ( "} + local parameterFormatN = 1 + for j=1,numParameters do + local paramType = knownMethod[j][2] + local parameter = method.Parameters[j] + assert(type(parameter) == TypeMap[paramType], string_format("Method \"%s->%s\" expects parameter %i (%s) to be: %s. Got %s", self.Type, method.Name, j, knownMethod[j][1], TypeMap[paramType], type(parameter))) + + parameterFormatN = parameterFormatN + 1 + parameterFormat[parameterFormatN] = TypeFormatMap[paramType] .. " " + end + parameterFormatN = parameterFormatN + 1 + parameterFormat[parameterFormatN] = ")" + + parameterFormat = table_concat(parameterFormat) + local methodStr = string_format(parameterFormat, method.Name, table_unpack(method.Parameters)) + if method.Option then + methodStr = string_format("%s option %s", methodStr, method.Option) + end + data[i] = methodStr + end + + return string_format("create %s named %s\r\n{\r\n%s\r\n}\r\n", self.Type, self.Name, table_concat(data, "\r\n")) +end \ No newline at end of file From 8bdb52295a05343d5cc6d0704a864e548004909e Mon Sep 17 00:00:00 2001 From: Proddy Date: Sat, 27 Jul 2024 12:37:28 +0100 Subject: [PATCH 3/5] Fixing RCF `ReadFile` - Added a custom `ReadFileOffset` to support _really_ old Mod Launcher versions. --- ForcedCar/CustomFiles.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ForcedCar/CustomFiles.lua b/ForcedCar/CustomFiles.lua index 1430b90..2f8210f 100644 --- a/ForcedCar/CustomFiles.lua +++ b/ForcedCar/CustomFiles.lua @@ -35,6 +35,10 @@ if not IsHackLoaded("FileSystemRCFs") then return true end) local _ReadFile = ReadFile + ReadFileOffset = ReadFileOffset or function(Path, Position, Size) + local Data = _ReadFile(Path) + return string.sub(Data, Position + 1, Position + Size) + end function ReadFile(Path) local RCFFile = RCFFiles[Path] if not Exists(Path, true, false) and RCFFile then From 88532316026eab8ede505fcf40bbdb021748c1c4 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sat, 27 Jul 2024 12:37:49 +0100 Subject: [PATCH 4/5] Attempt to not yeet the car out of existence --- ForcedCar/Resources/HandleMissionLoad.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ForcedCar/Resources/HandleMissionLoad.lua b/ForcedCar/Resources/HandleMissionLoad.lua index 0087b8a..d09b2d9 100644 --- a/ForcedCar/Resources/HandleMissionLoad.lua +++ b/ForcedCar/Resources/HandleMissionLoad.lua @@ -96,8 +96,9 @@ else end local Function, Index = MissionInit:GetFunction("CloseStage", true) - MissionInit:InsertFunction(Index, "SetFadeOut", 0.1) + MissionInit:InsertFunction(Index, "SetSwapForcedCarLocator", CarLocator) MissionInit:InsertFunction(Index, "SwapInDefaultCar") + MissionInit:InsertFunction(Index, "SetFadeOut", 0.1) if Settings.RemoveOutOfVehicle then local toRemove = {} From 97f437cb4dcc3c796a1b2551d72f487b296c20bd Mon Sep 17 00:00:00 2001 From: Proddy Date: Sat, 27 Jul 2024 17:39:09 +0100 Subject: [PATCH 5/5] Update HandleMissionLoad.lua --- ForcedCar/Resources/HandleMissionLoad.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ForcedCar/Resources/HandleMissionLoad.lua b/ForcedCar/Resources/HandleMissionLoad.lua index d09b2d9..734292e 100644 --- a/ForcedCar/Resources/HandleMissionLoad.lua +++ b/ForcedCar/Resources/HandleMissionLoad.lua @@ -96,7 +96,7 @@ else end local Function, Index = MissionInit:GetFunction("CloseStage", true) - MissionInit:InsertFunction(Index, "SetSwapForcedCarLocator", CarLocator) + MissionInit:InsertFunction(Index, "SetSwapDefaultCarLocator", CarLocator) MissionInit:InsertFunction(Index, "SwapInDefaultCar") MissionInit:InsertFunction(Index, "SetFadeOut", 0.1)