Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Killing Floor Forums > Killing Floor Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 07-11-2012, 12:32 PM
xtsnet xtsnet is offline
Member
 
Join Date: Jun 2012
Posts: 42
Default Pistol Reload time

Probably not the real place I should ask this - But the people here would probably answer it best.

Is it my imagination or does the pistol reload time never increase for sharp shooter?
Reply With Quote
  #2  
Old 07-11-2012, 12:55 PM
Gartley's Avatar
Gartley Gartley is offline
Senior Member
 
Join Date: Dec 2010
Location: UK
Posts: 2,152
Default

I think you mean to ask if it decreases as opposed to increase.
Well this is the code that handles it.

Code:
static function float GetReloadSpeedModifier(KFPlayerReplicationInfo KFPRI, KFWeapon Other)
{
	if ( Crossbow(Other) != none || Winchester(Other) != none
		 || Single(Other) != none || Dualies(Other) != none
         || Deagle(Other) != none || DualDeagle(Other) != none
         || MK23Pistol(Other) != none || DualMK23Pistol(Other) != none
         || M14EBRBattleRifle(Other) != none || Magnum44Pistol(Other) != none
         || Dual44Magnum(Other) != none )
	{
		if ( KFPRI.ClientVeteranSkillLevel == 0 )
		{
			return 1.0;
		}

		return 1.0 + (0.10 * float(KFPRI.ClientVeteranSkillLevel)); // Up to 60% faster reload with Crossbow/Winchester/Handcannon
	}

	return 1.0;
}
As you can see pistols do get the increase.
__________________
Whisky's Workshop

"As you can see here, I'm -ALL ON MY F***ING OWN! Guys where the hell are you?!"

Last edited by Gartley; 07-14-2012 at 08:12 AM.
Reply With Quote
  #3  
Old 07-11-2012, 03:28 PM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 3,729
Default

I honestly don't know what you mean by this. If you could explain a little, we should be able to help.
__________________

Reply With Quote
  #4  
Old 07-14-2012, 08:07 AM
Phada's Avatar
Phada Phada is offline
Senior Member
 
Join Date: Aug 2010
Location: France
Posts: 190
Default

To clarify because both seem wrong, the pistols reloading time is reduced because the reloading speed is increased.

As for the code pasted above, if you return 2 here, it will be 2 time faster to reload; will return 1.1 at lv1 etc to 1.6 at lv6.
Reply With Quote
  #5  
Old 07-14-2012, 04:33 PM
scary ghost's Avatar
scary ghost scary ghost is offline
Senior Member
 
Join Date: Sep 2010
Location: California
Posts: 779
Default

Quote:
Originally Posted by Phada View Post
To clarify because both seem wrong, the pistols reloading time is reduced because the reloading speed is increased.

As for the code pasted above, if you return 2 here, it will be 2 time faster to reload; will return 1.1 at lv1 etc to 1.6 at lv6.
That's not how reloading bonus works. Actually it's more accurate to say reloading rate. Anyways, the new rate is calculated by dividing the old rate with the modifier, not multiply, as the function name would suggest. Same with weapons that have a fire rate bonus, like melee weapons. The variable represents how many reloads you can do in a time frame, not how long it takes to do 1 reload.
Reply With Quote
  #6  
Old 07-15-2012, 06:21 AM
Phada's Avatar
Phada Phada is offline
Senior Member
 
Join Date: Aug 2010
Location: France
Posts: 190
Default

Are you sure about what the var represents?
I think the ReloadRate in KFWeapon is the delay until the reload is finished.
If this is correct, dividing the base delay by 2 is 2 times faster.
Reply With Quote
  #7  
Old 07-15-2012, 10:16 AM
FluX FluX is offline
Senior Member
 
Join Date: Oct 2010
Posts: 3,729
Default

I personally would say it's a multiply as if you wanted twice as quick, it would be rate * 0.5 which cuts it in half whereas dividing is rate / 0.5 which makes it take even longer for it to reload.
__________________

Reply With Quote
  #8  
Old 07-16-2012, 03:39 AM
Splatpope's Avatar
Splatpope Splatpope is offline
Senior Member
 
Join Date: Jan 2012
Location: Belgium
Posts: 1,084
Default

Or you could try testing modifiying it to see if you're all right :P
__________________
Reply With Quote
  #9  
Old 07-16-2012, 02:23 PM
scary ghost's Avatar
scary ghost scary ghost is offline
Senior Member
 
Join Date: Sep 2010
Location: California
Posts: 779
Default

Quote:
Originally Posted by Phada View Post
Are you sure about what the var represents?
I think the ReloadRate in KFWeapon is the delay until the reload is finished.
If this is correct, dividing the base delay by 2 is 2 times faster.
It's the same interpretation. If base rate is 1 reload per X seconds, dividing the rate by 2 means you can reload 2 times in the same X seconds, or inverted, twice as fast. The point I'm making though is the usage of the multiplier is with division. That's why the number returned is greater than 1. You can look at all the KFVet files and all perks with similar firespeed and reloadspeed bonuses return numbers >= 1.
Reply With Quote
  #10  
Old 07-17-2012, 08:20 PM
YoYoBatty's Avatar
YoYoBatty YoYoBatty is offline
Senior Member
 
Join Date: Dec 2009
Location: Canada
Posts: 3,319
Default

ReloadRate is the time it takes to reload, divided it will make a quicker reload with this you must also multiply the ReloadAnimRate which is the speed at which the gun reloads.
__________________
Reply With Quote
  #11  
Old 08-19-2012, 05:01 PM
xtsnet xtsnet is offline
Member
 
Join Date: Jun 2012
Posts: 42
Default Solved

just going through some of my old posts - forgot about this one

1st off - Marco has solved it in his latest release - and now I know how to do it for any weap - but thx for the responses and help
Reply With Quote
  #12  
Old 08-21-2012, 05:52 AM
poosh's Avatar
poosh poosh is offline
Senior Member
 
Join Date: Jan 2011
Posts: 1,489
Default

KFWeapon.uc
Code:
exec function ReloadMeNow()
{
	local float ReloadMulti;

	if(!AllowReload())
		return;

	if ( bHasAimingMode && bAimingRifle )
	{
		FireMode[1].bIsFiring = False;

		ZoomOut(false);
		if( Role < ROLE_Authority)
			ServerZoomOut(false);
	}

	if ( KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo) != none && KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill != none )
	{
		ReloadMulti = KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.Static.GetReloadSpeedModifier(KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo), self);
	}
	else
	{
		ReloadMulti = 1.0;
	}

	bIsReloading = true;
	ReloadTimer = Level.TimeSeconds;
	ReloadRate = Default.ReloadRate / ReloadMulti;

	if( bHoldToReload )
	{
		NumLoadedThisReload = 0;
	}

	ClientReload();
	Instigator.SetAnimAction(WeaponReloadAnim);

	// Reload message commented out for now - Ramm
	if ( Level.Game.NumPlayers > 1 && KFGameType(Level.Game).bWaveInProgress && KFPlayerController(Instigator.Controller) != none &&
		 Level.TimeSeconds - KFPlayerController(Instigator.Controller).LastReloadMessageTime > KFPlayerController(Instigator.Controller).ReloadMessageDelay )
	{
		KFPlayerController(Instigator.Controller).Speech('AUTO', 2, "");
		KFPlayerController(Instigator.Controller).LastReloadMessageTime = Level.TimeSeconds;
	}
}
As Scary_ghost said, reload bonus is calculated by division, not multiplication. 60% reload bonus means it takes 1.6 times less time to reload (e.g. level 6 Sharpshooter reloads Dual Magnums in 2.79s, off-perk: 4.47s).
100% faster reload would mean twice faster reload, not the instant reload in no-time.
__________________
KF Servers: Official+Custom maps. Custom Monters/SuperZombies/Doom3. Powered by ScrnBalance mutator.
scrn.no-ip.org:7707 - 6p HoE server
46.223.78.106:7713 - 20p Custom Sui/HoE Server
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC