[Source] NPC FireRate

Grab your favourite IDE and tinker with the innards of game engines

[Source] NPC FireRate

Postby ThrillerProd on Tue Aug 07, 2012 6:06 pm

Hi,

I'm currently on EP2 SP engine, I've added a lot of features in my mod and done a lot of build.
But, I want to change the firerate of the NPC (especially the combine) because I modified it deliberately (And I can't find where I done this) and it's very slooooow, it's a major problem...

Thanks !
Actinium Studio
User avatar
ThrillerProd
Dumpling
Dumpling
 
Joined: Sun Dec 12, 2010 10:00 am

Re: [Source] NPC FireRate

Postby stoopdapoop on Tue Aug 07, 2012 6:19 pm

well, it's going to be challenging for us to tell you where you made the change. Did you try looking in headers for the weapons themselves? there's a function called "GetFirerate()" or something like that that returns the firerate for that weapon, it's called whenever the weapon is fired (either by players, or by npcs).
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: [Source] NPC FireRate

Postby ThrillerProd on Wed Aug 08, 2012 8:49 am

Nope that not come from the weapon, if I demand to you it's for have a begin point, a somewhere to search something ^^ (I don't know if you understand, my english is pretty bad)
Actinium Studio
User avatar
ThrillerProd
Dumpling
Dumpling
 
Joined: Sun Dec 12, 2010 10:00 am

Re: [Source] NPC FireRate

Postby Ken Chan on Wed Aug 08, 2012 12:23 pm

weapon_smg1.cpp:

Code: Select all
class CWeaponSMG1 : public CHLSelectFireMachineGun
{
   ...
   float   GetFireRate( void ) { return 0.075f; }   // 13.3hz
   ...
}
User avatar
Ken Chan
Regular
Regular
 
Joined: Mon Apr 09, 2012 7:16 pm
Location: Hong Kong

Re: [Source] NPC FireRate

Postby ThrillerProd on Wed Aug 08, 2012 12:54 pm

Yeah, that change the firerate of the weapon for the player but not for NPC...
If I want to make a slow rate of fire like a sniper rifle, the Npc shoot like a rifle...
If I want to make a minigun, the npc shoot like a rifle again...
It's the problem. I try to see the base definition of MachineGun weapon, no way, i try to see the ShotRegulator system, no way again.
Actinium Studio
User avatar
ThrillerProd
Dumpling
Dumpling
 
Joined: Sun Dec 12, 2010 10:00 am

Return to Programming

Who is online

Users browsing this forum: No registered users