Coding Weapons: Events in Weapon Files Created 17 years ago2007-11-18 20:48:00 UTC by StoneFrog StoneFrog

Created 17 years ago2007-11-18 20:48:00 UTC by StoneFrog StoneFrog

Posted 17 years ago2007-11-18 20:48:00 UTC Post #238765
I've been coding this weapon for HL, the boomstick. It is based off of the shotgun's .cpp file (though I have already defined all new things such as the class name, weight, ammo, etc).

It only has the primary fire mode, so I just chopped out the secondary fire information and disabled secondary fire.

However, now I'm close to compiling hl.dll but have error C2065: 'm_flNextReload' : undeclared identifier going. This is in the shotgun's coding, for reloading (yay, that rhymes). Yet it does not work properly here. I heard that these events are weapon-specific, and I would need to redefine them for usage in other weapons.

How would I go about doing that? Help would be appreciated.
Posted 17 years ago2007-11-18 21:22:47 UTC Post #238767
i dont have much experience with this, but remove the secondary fire case in the reload code (shotgun reloads with 1 shell left and user tries to double fire)

the undeclared identifier could be the secondary fire pointer or whatnot. pure guesswork here, i haven't even touched the HL code at all.
Penguinboy PenguinboyHaha, I died again!
Posted 17 years ago2007-11-18 22:30:22 UTC Post #238776
That doesn't help...I don't get it too as all the other m_fl commands work fine.
Posted 17 years ago2007-11-19 09:16:15 UTC Post #238799
Just to make things clear, m_flNextReload is a variable used in all(?) weapon source files.
Oskar Potatis Oskar Potatis🦔
Posted 17 years ago2007-11-19 09:53:29 UTC Post #238801
Have you based your class on CBaseWeapon or CShotgun (or whatever the shotgun class is called)?
ChickenFist ChickenFist<Witty Title>
Posted 17 years ago2007-11-19 20:37:36 UTC Post #238833
I based it off of CBaseWeapon. Do you think I can utilize shotgun functions if I base my weapon off of the shotgun?
You must be logged in to post a response.