Page 1 of 1

code verification

Posted: Wed Feb 25, 2026 9:06 pm
by MateuszCOMPANY
Doing mods update in my repository (1.1>2.0) but have problem with this one : https://mods.factorio.com/mod/FishGun
It works fine with Factorio v1.1 but have trouble to run it on 2.0, even AI cant spot problem.
Please check code where is probable incompatibility:
btw. Its not gun, fire button cause eat fish from magazine and self-heal

DATA.LUA

Code: Select all

data:extend{
    {
        type = "gun",
        name = "spoon-spoon",
        icon = "__FishGun__/graphics/icons/spoon.png",
        icon_size = 64,
        stack_size = 5,
        attack_parameters = {
            type = "projectile",
            ammo_category = "capsule",
            cooldown = 90,
            movement_slow_down_factor = -0.5,
            sound = {
                {
                    filename = "__base__/sound/eat.ogg",
                    volume = 0.8
                },
                {
                    filename = "__base__/sound/eat-1.ogg",
                    volume = 0.8
                },
                {
                    filename = "__base__/sound/eat-2.ogg",
                    volume = 0.8
                },
                {
                    filename = "__base__/sound/eat-3.ogg",
                    volume = 0.8
                },
                {
                    filename = "__base__/sound/eat-4.ogg",
                    volume = 0.8
                }
            },
            range = 0
        },
        subgroup = "gun"
    },
    {
        type = "ammo",
        name = "spoon-fish-ammo",
        magazine_size = 5,
        ammo_type = {
            category = "capsule",
            target_type = "direction",
            action =
            {
                type = "direct",
                action_delivery =
                {
                    type = "instant",
                    source_effects =
                    {
                        {
                            type = "damage",
                            damage = {type = "physical", amount = -50}
                        }
                    }
                }
            }
        },
        icon = "__FishGun__/graphics/icons/fish-ammo.png", icon_size = 64,
        stack_size = 200,
        subgroup = "ammo"
    },
    {
        type = "recipe",
        name = "spoon-spoon",
        ingredients = {
            {"iron-stick", 10}  
        },
        enabled = true,
        result = "spoon-spoon",
        energy_required = 5,
    },
    {
        type = "recipe",
        name = "spoon-fish-ammo",
        ingredients = {
            {"iron-plate", 2},
            {"raw-fish", 5}
        },
        enabled = true,
        result = "spoon-fish-ammo",
        energy_required = 1,
    },
}