Making a gun that requires no ammo

Place to get help with not working mods / modding interface.
User avatar
Fishbus
Inserter
Inserter
Posts: 31
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

Making a gun that requires no ammo

Post by Fishbus »

Heya,

I want to make a weapon, or gun. something I can attach to say, a vehicle. I do not need ammo in any way, and I can just fire it without any cost.

e.g. I want to make a gun that only "action = ..." is to just make a noise when I press fire.

Is there such a way? I feel like since turrets can do it (e.g. a worm is a turret with infinite spitting ammo) that a gun should be able to.

Cheers!
Natha
Filter Inserter
Filter Inserter
Posts: 263
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: Making a gun that requires no ammo

Post by Natha »

What have you achieved so far?
User avatar
Fishbus
Inserter
Inserter
Posts: 31
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

Re: Making a gun that requires no ammo

Post by Fishbus »

Natha wrote: Wed Jul 02, 2025 7:36 am What have you achieved so far?
All I've been able to get is making a new weapon, attach it to the car, but it still requires ammo in some capacity it seems.

Code: Select all

 ammo_type =
      {
        source_type = "default",
        category = "gun-noise",
        target_type = "position",
        clamp_position = true,
		 action =
        {
          type = "direct",
          action_delivery =
          {
            -- do nothing
          }
        }
      },
So right now i'm at a loss.
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 581
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Making a gun that requires no ammo

Post by Silari »

Far as I'm aware it's not possible to make a gun that doesn't require ammo - presumably because some portions of it's attack is based on the ammo used.

You can make one that doesn't CONSUME ammo by setting the attack_parameters.ammo_consumption_modifier to 0. It still needs ammo in the gun but won't actually use any of it up when it fires.
User avatar
Fishbus
Inserter
Inserter
Posts: 31
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

Re: Making a gun that requires no ammo

Post by Fishbus »

Silari wrote: Wed Jul 02, 2025 5:05 pm Far as I'm aware it's not possible to make a gun that doesn't require ammo - presumably because some portions of it's attack is based on the ammo used.

You can make one that doesn't CONSUME ammo by setting the attack_parameters.ammo_consumption_modifier to 0. It still needs ammo in the gun but won't actually use any of it up when it fires.
I say boo to not being able to have no-ammo it seems like something that could have been possible.
Post Reply

Return to “Modding help”