RSSy MYGO.pl Opublikowano Luty 5, 2023 o 17:43 RSSy Udostępnij Opublikowano Luty 5, 2023 o 17:43 The Shotguns are stubborn and refuse to let you mod their attributes, so I stubbornly forced their attributes to be moddable with help from Lux's "WeaponHandling" Library. Here's what I ended up making possible: - Customise the durations for each "state" of a Shotgun reload. - Change firing rate through changing animation playback rate. - L4D1: Remove or force reload pumps, with the option to force animation updates Media Forced reload pumps without viewmodel updates Excuse the low quality. Forced reload pumps with forced viewmodel updates Excuse the low quality, too. How do I get started? Edit the file that corresponds to your L4D in the "data" folder, which should either be "data/l4d1_shotgun_handler.cfg" or"data/l4d2_shotgun_handler.cfg". The contents of the files are as follows: Configs Documentation for each file is found at the very bottom data/l4d1_shotgun_handler.cfg PHP Code: "ShotgunHandler" { // Let's go break stuff! // --------------------- // Tier 1s // >> L4D2WeaponType_Pumpshotgun << "weapon_pumpshotgun" { "mult_refiretime" "1.00" "mult_reloadtime_start" "1.25" "mult_reloadtime_insert" "1.00" "mult_reloadtime_end" "1.00" // Mods "mod_reloadpump_mode" "0" // Don't touch "base_refiretime" "0.875" "base_reloadtime_start" "0.400" // 0.393 "base_reloadtime_insert" "0.475" // 0.473 "base_reloadtime_end" "0.700" // 0.875 if empty "weapontype" "17" } // Tier 2s // >> L4D2WeaponType_Autoshotgun << "weapon_autoshotgun" { "mult_refiretime" "1.20" "mult_reloadtime_start" "1.00" "mult_reloadtime_insert" "1.00" "mult_reloadtime_end" "1.00" // Mods "mod_reloadpump_mode" "1" // Don't touch "base_refiretime" "0.250" "base_reloadtime_start" "0.400" // 0.395; 0.416 if empty "base_reloadtime_insert" "0.400" // 0.396 "base_reloadtime_end" "0.440" // 0.444; 1.000 if empty "weapontype" "15" } // LIST OF KVs: // ------------ ////////////////////////////////////////////////////// // "mult_refiretime" // (float | default: 1.0) // // - Adjust the time to refire a weapon and its animation's playback rate; Native "WeaponHandling" feature. ////////////////////////////////////////////////////// // "mult_reloadtime_start" // "mult_reloadtime_insert" // "mult_reloadtime_end" // (float | default: 1.0) // // - Multipliers for their respective reload anim states. >1.0 speeds things up and <1.0 slows things down. ////////////////////////////////////////////////////// ////// MODS ////////////////////////////////////////////////////// // "mod_reloadpump_mode" [L4D1] // (int | default: -1) // // - Affects behavior of empty reloads. Leave this on -1 if you do not want to use it. // - Modes: // - - #0 removes pumps to allow immediate refire. // - - #1 forces a pump for any reload. // - - - For each mode, add them by 2 to force viewmodel animation updates. MAY NOT LOOK PRETTY. // - Gotchas: // - - If you pump your shotgun during any insert anim, "mult_reloadtime_end" doesn't adjust the playback rate. // - - In mode 0, pumps may block inputs longer than they should. // ////////////////////////////////////////////////////// ////// THE 'DON'T TOUCH' KVs ////////////////////////////////////////////////////// // "base_refiretime" // (N/A | default: N/A) // // - Unused. Was for setting fire rate duration, but race conditions with "WeaponHandling" over netprops makes this impossible. // - - As of now, it is only here for reference. ////////////////////////////////////////////////////// // "base_reloadtime_start" // "base_reloadtime_insert" // "base_reloadtime_end" // (float | default: 0.5) // // - Designates the durations of each reload anim state. Removes the need to always grab durations from the netprops, which isn't always reliable. (They start at 0 before any reload is performed!) // - - May be used to control reload durations without adjusting animation speed. ////////////////////////////////////////////////////// // "weapontype" // (int | default: 0) // // - The weapon ID a weapon "block" is for, which is based on what's described in 'scripting/include/WeaponHandling.inc'. ////////////////////////////////////////////////////// // ------------ // END OF LIST. } data/l4d2_shotgun_handler.cfg PHP Code: "ShotgunHandler" { // Let's go break stuff! // --------------------- // Tier 1s // >> L4D2WeaponType_Pumpshotgun << "weapon_pumpshotgun" { "mult_refiretime" "1.00" "mult_reloadtime_start" "0.85" "mult_reloadtime_insert" "0.95" "mult_reloadtime_end" "1.10" // Don't touch "base_refiretime" "0.875" "base_reloadtime_start" "0.475" "base_reloadtime_insert" "0.500" "base_reloadtime_end" "0.600" "weapontype" "17" } // >> L4D2WeaponType_PumpshotgunChrome << "weapon_shotgun_chrome" { "mult_refiretime" "1.00" "mult_reloadtime_start" "1.00" "mult_reloadtime_insert" "1.00" "mult_reloadtime_end" "1.00" // Don't touch "base_refiretime" "0.875" "base_reloadtime_start" "0.475" "base_reloadtime_insert" "0.500" "base_reloadtime_end" "0.600" "weapontype" "18" } // Tier 2s // >> L4D2WeaponType_Autoshotgun << "weapon_autoshotgun" { "mult_refiretime" "1.20" "mult_reloadtime_start" "1.00" "mult_reloadtime_insert" "1.00" "mult_reloadtime_end" "1.00" // Don't touch "base_refiretime" "0.250" "base_reloadtime_start" "0.450" // 0.650 "base_reloadtime_insert" "0.375" // 0.380 "base_reloadtime_end" "0.675" "weapontype" "15" } // >> L4D2WeaponType_AutoshotgunSpas << "weapon_shotgun_spas" { "mult_refiretime" "1.40" "mult_reloadtime_start" "1.00" "mult_reloadtime_insert" "1.00" "mult_reloadtime_end" "1.00" // Don't touch "base_refiretime" "0.250" "base_reloadtime_start" "0.450" "base_reloadtime_insert" "0.375" "base_reloadtime_end" "0.700" "weapontype" "16" } // Misc. // >> L4D2WeaponType_SniperAwp << // LIST OF KVs: // ------------ ////////////////////////////////////////////////////// // "mult_refiretime" // (float | default: 1.0) // // - Adjust the time to refire a weapon and its animation's playback rate; Native "WeaponHandling" feature. ////////////////////////////////////////////////////// // "mult_reloadtime_start" // "mult_reloadtime_insert" // "mult_reloadtime_end" // (float | default: 1.0) // // - Multipliers for their respective reload anim states. >1.0 speeds things up and <1.0 slows things down. ////////////////////////////////////////////////////// ////// THE 'DON'T TOUCH' KVs ////////////////////////////////////////////////////// // "base_refiretime" // (N/A | default: N/A) // // - Unused. Was for setting fire rate duration, but race conditions with "WeaponHandling" over netprops makes this impossible. // - - As of now, it is only here for reference. ////////////////////////////////////////////////////// // "base_reloadtime_start" // "base_reloadtime_insert" // "base_reloadtime_end" // (float | default: 0.5) // // - Designates the durations of each reload anim state. Removes the need to always grab durations from the netprops, which isn't always reliable. (They start at 0 before any reload is performed!) // - - May be used to control reload durations without adjusting animation speed. ////////////////////////////////////////////////////// // "weapontype" // (int | default: 0) // // - The weapon ID a weapon "block" is for, which is based on what's described in 'scripting/include/WeaponHandling.inc'. ////////////////////////////////////////////////////// // ------------ // END OF LIST. } Console Commands PHP Code: // ++ Cvars ++ // ----------- // Prints to chat about the weapons's new stats when shooting or reloading. /// Not saved to the CFG file. l4d_shotgun_handler_debug "0" // ++ ConCmd ++ // ------------ // Reloads the data from the plugin's config. sm_sh_reload Changelog Code: > v1.0 (05-Feb-2023) - Released on Alliedmodders publicly after at least 365 days. Happy birthday my plugin.Installation Extract the .ZIP file's contents and drop the folders into addons/sourcemod. Special Mentions Lux - WeaponHandling library. :bee: Attached Files l4d_shotgun_handler_02060140.zip (13.1 KB) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi