Support equipment consumption using ammunition instead of just energy

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Wozbo
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Mar 08, 2025 11:54 pm
Contact:

Support equipment consumption using ammunition instead of just energy

Post by Wozbo »

Had an idea to build a mod around the concept of mounting the weapons you can build on a turret platform. EX: Shoulder mounted rocket launcher/ shoulder mounted railgun/ shoulder mounted tesla cannon. Current issue that I'm encountering is that it doesn't *look like* there's a way to avoid ammo_type like you can with turrets or handheld weapons. I'd like to still have these turrets consume ammo, and then follow that ammo's ammo_type rules.

I'd like attack_parameters to support a "consume_from_inventory" parameter if possible, which would then follow all the current ammunition consumption/ refill logic. Even better if we could support some sort of stack size too for how many stacks of ammo can be put in the personal defense. I'm also just fine consuming straight from inventory, if feasible.
eugenekay
Filter Inserter
Filter Inserter
Posts: 577
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Support equipment consumption using ammunition instead of just energy

Post by eugenekay »

I think this exists? SMG Equipment implements this by doing:

Code: Select all

 attack_parameters = {
      type = 'projectile',
      ammo_category = 'bullet',
      ammo_type = {
        energy_consumption = "30kJ",
        action = {
          type = 'direct',
          action_delivery = {
            type = 'instant',
            source_effects = { type = 'create-explosion', entity_name = 'explosion-gunshot' },
            target_effects = {
              {
                type = 'create-entity',
                entity_name = 'explosion-hit',
                offsets = { { 0, 1 } },
                offset_deviation = { { -0.5, -0.5 }, { 0.5, 0.5 } },
              },
              { type = 'damage', damage = { amount = 20, type = 'physical' } },
              { type = 'activate-impact', deliver_category = 'bullet' },
            },
          },
        },
      },
And then there is Personal Tesla Defense Equipment which draws from Armor Energy Grid (although it can use the Tesla Gun graphics).

I hope this helps! I would like to see a Mod which supports Tesla gun ammo in a “Tesla Pod”, as well as mini-Rockets, and Gun Pods… without adding EVERY CONCEIVABLE OPTION and unnecessary ammo types. :-)
Wozbo
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Mar 08, 2025 11:54 pm
Contact:

Re: Support equipment consumption using ammunition instead of just energy

Post by Wozbo »

So to be clear: I *did* get things working similar to above. What I’m asking for is ammo consumption, ex: use explosive rockets and take their stats etc.

I think the above works on energy consumption only end of the day.

I *could* do something like requiring a massive amount of ammo first as part of the recipe but it still feels odd. I’d like my personal smg defense to be able to use normal/ piercing/ uranium rounds based on what I have in my inventory.
eugenekay
Filter Inserter
Filter Inserter
Posts: 577
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Support equipment consumption using ammunition instead of just energy

Post by eugenekay »

You can also try Gun Equipment, which is close to what you are looking for. It uses an onTick script so is not great for performance, but it does "Load" magazines into the Gun Pod - including Tungsten Ammo - but it does not work with Quality magazines.
Post Reply

Return to “Modding interface requests”