Kenni’s Weapon Base

If you liked this item, please rate it up on Steam Workshop page.

Author: kenni

Last revision: 17 May at 09:26 UTC (1)

File size: 389.51 KB

On Steam Workshop

Description:


[www.paypal.me]

Kenni’s Weapon Base

What is this?

Kenni’s Weapon Base is an easy to use weapon framework for developers who want to port weapons fast and not worry about custom advance coding a weapon may require. See full features below.

How fast?

In this example, an ar2 with full inspect anims, ar2 alt fire, sprint/walk states, bullet configs, empty ammo variant anims, etc… now takes less than 200 lines of text to write and you get a full SWEP.
With this base you can write most of the HL2 weapons without even needing to write one custom logic per weapon. Thats how fast you can make your common sweps in this.

Features

Weapon types

  • Semi-auto, full-auto, burst fire
  • Bolt-action and pump-action
  • Shotgun with shell-by-shell phased reload
  • Charge / windup weapons (minigun, railgun, held shots)
  • Guns with melee bash
  • Pure melee with combo chains
  • Thrown weapons (frag grenades, molotovs) with throw / lob / roll modes
  • Dedicated projectile launcher, you just write the entity you want to launch when your fire animation happens with additional support for launching ar2 balls.

Animation system

  • Automatic variant fallback chain — the base tries _iron_empty → _iron → _empty → base for fire, and _empty → base for everything else
  • Every animation key supports an _empty variant for when the clip is dry
  • Random animation selection — define multiple entries for any key and the base picks one each time
  • Walk, sprint, idle, lowered, ADS transition, bolt, charge, phased reload, inspect, throw all handled. Each anim knows when to play and at what state the player is in.

Systems

  • Priority system — every action has a priority level, higher-priority actions block lower ones automatically
  • ADS with viewmodel offset, FOV zoom, mid-dip, hold or toggle mode
  • Per-stance spread (stand, crouch, walk, sprint, air, ADS)
  • Accumulating recoil with configurable kick, max, decay, and side randomness
  • Custom muzzle flash — disable, named util.Effect, or particle attached to muzzle
  • Custom impact effect — disable, named util.Effect, particle, with optional decal suppression
  • Dynamic muzzle light on every shot
  • Scope overlay fullscreen material for sniper scopes
  • Key abstraction — IN_* engine flags, MOUSE_* mouse buttons, KEY_* keyboard keys all work

and many more

For developers

Full written documentation covering every table, every field, every system in the GitHub code.

To make a weapon: copy the template, fill in your values, delete the systems you don’t need.

TEMPLATE CODE [github.com]

Limitations
  • No NPC Support yet
  • Attachements not yet planned
  • No Render target scopes support yet.
  • Base doesn’t cover unconventional weapons like a gravity gun, the base is designed for the most common type of sweps which are guns, melee or some kind of projectile launcher.

Personal Notes

Note that this base is still in development, more features will add be added. So if you encounter any bugs pls report in the comments.

Compared to other bases

Most weapon bases give you a foundation and expect you to write logic on top. Kenni’s Weapon Base took the time to see what are the common behavior/pattern/system/mechanics a bunch of weapons does and can do, and implemented them all in it’s base code so you dont have to write custom logic code. The advance mechanics of this base does that for you.

This is a personal and commission base refined through production use across dozens of weapons. Every feature exists because at least one real weapon needed it.

Requirements

No dependencies. Base only — no weapons included.

Credits

kenni — base author.

tags; hl2 gmod combine reskin animation memes rp_ gm_ roblox minecraft vj swep ep1 ep2 zombine hla alyx ttt prop scp mod pm scanner beta leak skibidi realism tracer muzzleflash cool nuke nextbot replacement AR2 MMOD Effects Tracer nextbot source roleplay, hands swep, fun, point, dance, taunt, realism, posing, pose, darkrp hecu monster bms source black mesa source xen bmbs blueshift swep sweps hecu collective marine operation security bms wep Weapon battle fight Gordon swep bomb weapon ar2 pirate source bms bmx xenians xenian bmbs rail gun stalker tfa arc9 arccw base

Download
Revisions:

Old revisions of this mod are available below. Click the link to download.