AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   What are the L4D2 Reload Speed Values? (https://forums.alliedmods.net/showthread.php?t=338952)

FruityGum 08-05-2022 11:23

What are the L4D2 Reload Speed Values?
 
I want to compare the reload speed of all the guns in Left 4 Dead 2, but do not have the know-how to obtain this data.

My L4D2 modding ability is limited to Hammer and simple addons that change weapon script files. These script files do not list any information about the reload speed of non-shotgun weapons, which is why I am asking if someone may kindly provide me with this data.

I checked to see if this topic was asked before, but I could not find it. If this was asked before, my apologies.

Marttt 08-05-2022 11:38

Re: What are the L4D2 Reload Speed Values?
 
You can try outputting the information with https://forums.alliedmods.net/showthread.php?t=319947

FruityGum 08-05-2022 11:58

Re: What are the L4D2 Reload Speed Values?
 
I downloaded it, and searched all contained files for reload data. I looked over files myself then again with a find tool set for the word "Reload", and couldn't find what I needed. It has values to set a reload modifier, but nothing that lists the actual reload speed for weapons.

Silvers 08-05-2022 13:25

Re: What are the L4D2 Reload Speed Values?
 
You can find them in the Mission and Weapons - Info Editor weapons config.

FruityGum 08-05-2022 14:33

Re: What are the L4D2 Reload Speed Values?
 
Assuming these values are accurate, then I have found what I was looking for. Thank you kindly for your assistance.

I am somewhat tentative of the validity of these values, as it lists all assault rifles and sniper/hunting rifles as having an identical reload speed of 2.0 seconds, as well as the SMG reloading 0.5 seconds faster than the Silenced SMG and MP5.

Silvers 08-05-2022 14:46

Re: What are the L4D2 Reload Speed Values?
 
The forum thread and weapons config explains how to find the files to extract their values.

FruityGum 08-05-2022 14:54

Re: What are the L4D2 Reload Speed Values?
 
Are you referring to this line?

Info .txt scripts can be found in your games \left4dead2\pak01_dir.vpk, navigate to /missions/, /scripts/ and /scripts/melee/ folders.
Weapon Info examples can be found in the "weapon_*" .txt files in the /scripts/ folder.


I've been messing with those files before I posted, and with the exception of the shotguns, there is no line that lists the reload speed.

BRU7US 08-05-2022 15:14

Re: What are the L4D2 Reload Speed Values?
 
Maybe this will help you better, idk...

Code:

int g_iNextPAttO = FindSendPropInfo("CBaseCombatWeapon","m_flNextPrimaryAttack");
float flGameTime = GetGameTime();
float flNextTime_ret = GetEntDataFloat(weaponID, g_iNextPAttO); //weaponID - entityID of your weapon, g_iNextPAttO - value of "m_flNextPrimaryAttack" prop.
float flNextTime_calc;
flNextTime_calc = (flNextTime_ret - flGameTime) * 0.900 //(0.900 as I remember is a default value of reload speed modifier).

flNextTime_calc - this will be your final value of time of your reload speed (float value).

For shotguns:

const float g_fl_AutoS = 0.666666;
const float g_fl_AutoI = 0.4;
const float g_fl_AutoE = 0.675;

const float g_fl_SpasS = 0.5;
const float g_fl_SpasI = 0.375;
const float g_fl_SpasE = 0.699999;

const float g_fl_PumpS = 0.5;
const float g_fl_PumpI = 0.5;
const float g_fl_PumpE = 0.6;

All shotguns has a 3-stage reloading (Start, Insert, End)

Autoshotgun (M1014):
Start: g_fl_AutoS * 0.900
Insert: g_fl_AutoI * 0.900
End: g_fl_AutoE * 0.900

SPAS-12:
Start: g_fl_SpasS* * 0.900
Insert: g_fl_SpasI * 0.900
End: g_fl_SpasE * 0.900

Pump / Chrome Shotguns:
Start: g_fl_PumpS* * 0.900
Insert: g_fl_PumpI * 0.900
End: g_fl_PumpE * 0.900

Silvers 08-05-2022 15:38

Re: What are the L4D2 Reload Speed Values?
 
Code:

The key "ReloadDuration" is missing from many weapons, the game uses "2.0" as default value (it seems).
You can time them if you want and report back the correct values.

FruityGum 08-05-2022 18:12

Re: What are the L4D2 Reload Speed Values?
 
Quote:

Originally Posted by Silvers (Post 2785669)
Code:

The key "ReloadDuration" is missing from many weapons, the game uses "2.0" as default value (it seems).
You can time them if you want and report back the correct values.

That's probably what I'll have to end up doing. Confusing enough is how every source I've checked (including the L4D wiki, which has no numbers but ambiguously states certain reloads to be "long" or "short") conflicts with all the others, so I guess I'll need to work it out myself.

From adding a reload speed value of 5 (seconds) to the rifle_desert's file, I know I can "overwrite" the default reload speed. Also turns out that reload animations conform to the weapon's reload length, so I could make it 1 for inhumanly fast reload or 5 to really drag out the animation.

I imagine the best chance I have to figure out the reload speed is to insert a value of my own and appraise it by eye to see if it appears faster or slower than that weapon's vanilla reload speed. I can probably do it with some accuracy up to .5 seconds, but doubt I'll ever figure out of a weapon's actual reload is something like 2.476 or the like. Perhaps the animation files themselves hold the truth to the actual duration, though some of the reload animations already appear slightly slowed/quickened in vanilla L4D2, probably for weapon balance purposes.

For now, all I can give is the ReloadDuration located in the script file for each shotgun, which are the only ones to even list reloads (yet ironically are also the ones you cannot change the reload speed of).


All times are GMT -4. The time now is 02:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.