The mod that adds the gun in the screenshot can be found here.
WARNING: You will need a Minetest build with this commit to avoid any potential crashes.
Features:
- Full auto guns.
- Drop/load mags.
- Customizable mags/mag-types.
- Generated detailed gun/mag tooltips.
- Alternate fire mode.
- Callbacks to ease customization (modders).
- Firearms start out empty.
- Punch with a empty firearm in hand to load a mag with a ammo count > 0 and a mag_type corresponding to the wielded firearm.
- Press the drop key (Q by default) to swap fire mode of wielded firearm (if applicable and ammo count > 0).
- Press the drop key to drop a guns mag (if the mag is empty).
- Rightclick with firearm (if mag is not empty) in order to ADS (if applicable).
- Combine a stack of bullets along with a non-full mag in the craft-grid to fill it.
- Drop a non-empty mag in the craft-grid to get the bullets out of it.
Guns and magazines can easily be registered with:
gunkit.register_firearm(name, def)
And:
gunkit.register_mag(name, def)
Respectively. I include a couple examples here but detailed information can be found in the mods README file (see github link).
Registering a firearm:
Code: Select all
gunkit.register_firearm("rpg_guns:smg_ice", {
description = "Ice Smg",
inventory_image = "rpg_guns_smg.png",
wield_scale = {x = 2, y = 2, z = 1},
mag_type = "smg",
sounds = {
mag_load = "rpg_guns_mag_load",
mag_drop = "rpg_guns_mag_drop",
fire_empty = "rpg_guns_fire_empty",
},
callbacks = {fire = {on_hit = hit_sound}, alt_fire = {on_hit = freeze}},
fire = {
bullet_texture = "rpg_guns_bullet.png",
sounds = {
fire = "rpg_guns_fire",
fire_toggle = "rpg_guns_toggle_a",
shell_drop = "rpg_guns_shell_drop",
},
range = 60,
speed = 300,
spread = 4,
dmg = 7,
shots = 1,
interval = 0.1,
zoom = 2,
},
alt_fire = {
bullet_texture = "default_ice.png",
sounds = {
fire = "rpg_guns_fire",
fire_toggle = "rpg_guns_toggle_b",
shell_drop = "rpg_guns_shell_drop",
},
range = 30,
speed = 300,
spread = 6,
dmg = 0,
shots = 9,
interval = 5,
zoom = 1.5,
},
})
Code: Select all
gunkit.register_mag("rpg_guns:smg_mag", {
description = "Smg Mag",
inventory_image = "rpg_guns_smg_mag.png",
ammo = "rpg_guns:bullet",
max_ammo = 100,
mag_type = "smg",
})