How do I make my guns use specific ammo I created?

Place to get help with not working mods / modding interface.
underscore
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun May 07, 2017 10:01 pm
Contact:

How do I make my guns use specific ammo I created?

Post by underscore »

I've been unable to find an answer to this.

I'm brand new to modding in Factorio (just started doing it today) and I'm using the submachine guns code to make a few customized guns
For these guns I made a few custom ammos:

Code: Select all

data:extend(
{
  {
    type = "ammo",
    name = "ak-magazine",
    icon = "__ModernWeaponryBase__/graphics/icons/firearm-magazine.png",
    flags = {"goes-to-main-inventory"},
    ammo_type =
    {
      category = "39mm-cartridge",
      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"
                },
                {
                  type = "damage",
                  damage = { amount = 4 , type = "physical"}
                }
              }
            }
          }
        }
      }
    },
    magazine_size = 30,
    subgroup = "ammo",
    order = "a[basic-clips]-a[firearm-magazine]",
    stack_size = 100
  }
}
)
I can't figure out how to make my own ammo_category or normal category.
Also, I don't know if I'm doing this right :P
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: How do I make my guns use specific ammo I created?

Post by Nexela »

data:extend(
{
{
type = "ammo-category",
name = "my_ammo_category_name"
},
}
underscore
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun May 07, 2017 10:01 pm
Contact:

Re: How do I make my guns use specific ammo I created?

Post by underscore »

Thanks :D
Post Reply

Return to “Modding help”