Weapon Framework
A toolkit for adding weapons to Stick Fight: models, behaviours, effects and sounds, with 12 new weapon categories and modded weapons all on Menu Overhaul's WEAPONS screen. Local play only.
By maewing
| Last updated | 8 hours ago |
| Total downloads | 44 |
| Total rating | 2 |
| Categories | Mods Libraries AI Generated |
| Dependency string | maewing-Weapon_Framework-1.0.2 |
| Dependants | 1 other package depends on this package |
This mod requires the following mods to function
SFTG_Modding-BepInExPack_SFTG
Stick Fight: The Game-specific BepInEx x64 5.4.23.5. Preconfigured and ready to use.
Preferred version: 1.1.1maewing-Menu_Overhaul
Graphics settings, controller layouts for every player at once, two-pane MAPS and WEAPONS screens with previews and stats, a MODS page, and a pause menu that works with a gamepad. Keeps the game's look.
Preferred version: 1.0.0README
Weapon Framework
A toolkit for adding weapons to Stick Fight, and the system that puts them in the game: categories, spawning and saving. Needs Menu Overhaul, whose WEAPONS screen (with its close-ups and stats) is where you pick them.
For players
On its own, Weapon Framework adds no weapons: it's what weapon mods are built on. What it changes for you:
- 12 new categories on Menu Overhaul's WEAPONS screen instead of the game's basic ones: Pistols, Rifles, Shotguns, Heavy, Explosives, Melee, Control, Gadgets, Party, Lava, Snake and Godlike.
- Modded weapons on the same screen: weapons from mods built on the framework slot into those categories (or into categories of their own), marked MOD, with their own close-ups, stats and notes, and spawn like the game's.
- Your choices are kept per weapon (
BepInEx\config\WeaponFramework.menu.txt). Your old choices from the game's weapon screen are carried over the first time. The game's own saved settings are never touched, so removing the mod brings back your old choices exactly as they were. - Spawn odds are the game's. With Spawn Rate Changer 1.1.0 or later installed, every weapon, modded ones included, shows its share of the drops and gets a ticket slider (Left/Right, Y for the default).
Custom sounds
Any weapon's sounds (the game's too) can be replaced by dropping .wav files into BepInEx\config\WeaponFramework\Sounds\<weapon>\: shoot*.wav, draw*.wav, drop*.wav, and an optional sound.txt with volume = 0.8 / pitch = 1.1. The folder name is the weapon's id or name; weapons.txt in the Sounds folder lists them all.
Online
Local play only. In online matches only the game's own weapons spawn, at the game's own odds.
For modders
Add WeaponFramework.dll as a reference (the WeaponFramework.xml next to it gives you the docs in your editor) and [BepInDependency(WeaponFramework.Plugin.Guid)] to your plugin. Then, in your plugin's Awake:
WeaponRegistry.Add(new WeaponDefinition("mymod.katana", "KATANA", VanillaWeapon.Sword)
{
Category = WeaponCategory.Melee, // or your own: WeaponRegistry.AddCategory("mymod.blades", "BLADES")
Rarity = 5, // spawn tickets: basic guns are 20, the Sniper 5, the God Pistol 2
Ammo = 6,
Model = new WeaponModel { Grip = new Vector3(0, 0, -0.2f) }
.Box(new Vector3(0, 0, -0.2f), new Vector3(0.07f, 0.08f, 0.5f)) // handle
.Box(new Vector3(0, 0, 0.9f), new Vector3(0.04f, 0.07f, 1.7f)).Paint(GameMaterials.Blink), // blade
Behaviour = typeof(MyKatana),
ShootSounds = Sounds.LoadFolder(Path.Combine(myFolder, "swing")),
});
class MyKatana : WeaponBehaviour
{
public override bool OnAttack()
{
DashResult d = Moves.Dash(Owner, Aim, 8f);
foreach (PlayerHit h in Hits.AlongLine(Owner, d.From, d.To, 0.8f))
Hits.Damage(Owner, h, 50f, Aim, 10f);
Fx.Streak(d.From, d.To, Players.ColorOf(Owner));
Moves.Hang(Owner, 0.4f);
return true; // replaces the sword's own swing
}
}
What you get:
- Weapons: copy any game weapon and change it (
Base,Configure,Cooldown,Ammo), or put one of the game's unused weapons in the menu (WeaponDefinition.FromExisting). Models are built from boxes, cylinders, discs and balls in the game's own flat style (WeaponModel), held and as spinning pickups. - Hooks (
WeaponBehaviour):OnAttack,AfterAttack,OnAttackHeld/Released, a free alternative fire on the block button (OnAltPressed/Held/Released),OnShot(the projectile),ModifyDamage,OnDamageDealt,OnEquip/OnUnequip. Hold-to-charge withChargeTime. - Toolkit:
Projectile(your own bullets, bombs, hooks: gravity, bounces, sticking, blocking),GameShots(fire or tweak the game's own bullets),Blast(the game's explosion, your own, or a ring),Hits(lines and areas, respecting blocks),Moves(dash, teleport, hang, push),Status(stun, burn, poison, flipped controls, pinning),Deployable(mines, traps, turrets, owner-coloured lights),Deflect(surfaces that bounce bullets),Rope,Fx(streaks, slashes, flashes, afterimages, screen shake),Looks,Sounds(WAV loading, borrowing game sounds). - Registry:
WeaponRegistry(add, look up, rename, recategorise, set default tickets, switch on/off,ReadyandPlayerArmedevents),SpawnWeights(become the one provider of custom per-weapon spawn odds). - Debug keys (
[Debug] DebugKeys = truein the config):]/[give player 1 the next or previous weapon,\drops a pickup of player 1's weapon,'slow motion,-training (nobody can die from damage, and every hit is logged with its damage),=lines the other players up as targets,/fires a bullet at player 1,.pulls a target in front of player 1,`prints every weapon's stats.[Debug] Give= a weapon id or name hands it to player 1 straight away. With debug keys on when the game starts, every log line also goes toBepInEx\WeaponFramework-debug.logimmediately.