Page 1 of 1

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

Posted: Sun May 07, 2017 10:04 pm
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

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

Posted: Sun May 07, 2017 10:14 pm
by Nexela
data:extend(
{
{
type = "ammo-category",
name = "my_ammo_category_name"
},
}

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

Posted: Sun May 07, 2017 10:16 pm
by underscore
Thanks :D