Base Weapon off of a Base Weapon, Possible?

Hi! Is it possible to create a base weapon which derives from another base weapon? I haven’t tried this yet, but I recall a while back that I was about to.

I’m creating a SWEP pack to compete with the two most popular running packs, mostly to meet the demands of various nine year olds who play Garry’s Mod, but on the side, I’d like to see a decent pack written myself.

Here’s the basic layout:
[ul]
[li]Base Weapon (Special Features)
[/li][list]
[li]Pistol-Type Weapons Base
[/li][li]Shotgun-Type Weapons Base
[/li][li]Machine Gun-Type Weapons Base
[/li][/ul]
[/list]

Although you could just write three base weapons, if you wanted to add universal features to all three, then you could just update the root base instead.

What happened to the all knowing Andrew? Why don’t you just type it up real quick and try it?

Aren’t bases based off an base anyway? So it should work yes.

I honestly would, but I wanted to see if I could get a fast answer before beating a response. That’s why I haven’t thrown any code together yet.

[editline]12:13PM[/editline]

Well, I thought the same thing commander, but I just wanted someone to verify if possible. I’ll try it out. And what’s wrong with knowing something? People here shouldn’t ridicule you whether you know something or do not. Unfortunately, people here spend more time flaming than being helpful. Generally I just keep posting in the thread now, disregarding any individual troll’s reply.

Isn’t this the kind of stuff that should be asked in the Newbie Question subforum?

To answer: Yes, it works like that. All weapons have a base weapon of weapon_base, so the packs base weapon has a base there eventually up the chain.

If you wanted to, you could base a weapon off weapon_ak47 or whatever the css ak47 weapon is and it’d work.

Thanks for the verification.

And then how would you call a function from the base weapon? I have no idea why, but every time I try to do that, I end up with a stack overflow.

[lua]self.BaseClass:PrimaryFire()[/lua]