bahrmichael / factorio-tycoon

GNU General Public License v3.0
10 stars 7 forks source link

Bug construction #41

Closed LUISDASARTIMANHAS closed 1 year ago

LUISDASARTIMANHAS commented 1 year ago

construction horizontally and occupied space vertically

image

bahrmichael commented 1 year ago

Thank you! I've seen that during development, and wasn't sure if it shows up in published releases. Will investigate :)

bahrmichael commented 1 year ago

Maybe factorio gets confused by the shorthand positions. I'll try specifying them as coordinates and see how it goes.

LUISDASARTIMANHAS commented 1 year ago

the conflict and selection coordinates are inverted, I think if you change the x to y it should work collision_box = { { -8.4, -2.4}, {8.4, 2.4} }, selection_box = { { -8.5, -2.5}, {8.5, 2.5} }, collision_box = { { -x1, -y1}, {x2, y2} }, selection_box = { { -x1, -y1}, {x2, y2} },

left:x1 right:x2 bottom: y1 top: y2

you can try to use the automatic adjustment with the size

bahrmichael commented 1 year ago

This issue is a bit more confusing than just having the wrong numbers.

I've seen this again yesterday in my own test:

Screenshot 2023-10-11 at 11 19 26

Today when I reconstruct that building (or construct it in another save):

Screenshot 2023-10-11 at 11 21 00

I only made a formatting change, that really can't be the reason:

Screenshot 2023-10-11 at 11 22 38
bahrmichael commented 1 year ago

I also tried replacing the shorthand version {x, y} with the longhand version {x=x, y=y}, but the squeak through mod can't handle that.

LUISDASARTIMANHAS commented 1 year ago

So the problem is the image since the game is rotating the hitbox and the structure but the image is not rotated, try putting 2 frames in the official image

LUISDASARTIMANHAS commented 1 year ago

Just like the game does with the car that has 64 positions and 64 images in just 1

LUISDASARTIMANHAS commented 1 year ago

When you use the R button or rotate the game changes the position and takes the image that fits the position, in this case I notice that the butcher's shop only has 1 image

LUISDASARTIMANHAS commented 1 year ago

I'm working on this bug but I only see the solution of adding another image or leaving the butcher position fixed

LUISDASARTIMANHAS commented 1 year ago

This is an example of what I use in my constructions

local path_main = "__Applied-Energistics-2__/"

data:extend({
    {
        type = "container",
        name = "drive-entidade",
        icon = path_main .. "graficos/Blocos/drive.png",
        icon_size = 128,
        icon_mipmaps = 4,
        minable = { mining_time = 1, result = "drive" },
        max_health = 350,
        inventory_size = 8,
        -- corpse = "big-remnants",
        corpse = "assembling-machine-2-remnants",
        -- dying_explosion = "big-explosion",
        dying_explosion = "assembling-machine-2-explosion",
        alert_icon_shift = { -0.09375, -0.375 },
        collision_box = {
            { -1.2, -1.2 },
            { 1.2,  1.2 }
        },
        selection_box = {
            { -1.5, -1.5 },
            { 1.5,  1.5 }
        },
        drawing_box = {
            { -1.5, -1.5 },
            { 1.5,  1.5 }
        },
        energy_source = {
            emissions_per_minute = 3,
            type = "electric",
            usage_priority = "secondary-input"
        },
        resistances = {
            {
                type = "fire",
                percent = 70
            }
        },
        damaged_trigger_effect = {
            entity_name = "spark-explosion",
            type = "create-entity",
            damage_type_filters = "fire",
            offsets = { { 0, 1 } },
            offset_deviation = { { -0.5, -0.5 }, { 0.5, 0.5 } }
        },
        allowed_effects = {
            "consumption",
            "speed",
            "productivity",
            "pollution"
        },
        flags = {
            "placeable-neutral",
            "placeable-player",
            "player-creation",
            "not-upgradable"
        },
        placeable_by = {
            item = "drive",
            count = 1
        },
        module_specification = {
            module_slots = 0,
            module_info_icon_shift = { 0, 0.5 }
        },
        working_sound = {
            sound = {
                { filename = "__base__/sound/assembling-machine-t2-1.ogg", volume = 0.45 }
            },
            fade_in_ticks = 4,
            audible_distance_modifier = 0.5,
            fade_out_ticks = 20
        },
        vehicle_impact_sound = {
            {
                filename = "__base__/sound/car-metal-impact-2.ogg",
                volume = 0.5
            },
            {
                filename = "__base__/sound/car-metal-impact-3.ogg",
                volume = 0.5
            },
            {
                filename = "__base__/sound/car-metal-impact-4.ogg",
                volume = 0.5
            },
            {
                filename = "__base__/sound/car-metal-impact-5.ogg",
                volume = 0.5
            },
            {
                filename = "__base__/sound/car-metal-impact-6.ogg",
                volume = 0.5
            }
        },
        picture = {
            layers = {
                {
                    filename = path_main .. "graficos/Blocos/drive.png",
                    height = 128,
                    shift = { 0, -0.015625 },
                    priority = "extra-high",
                    width = 128
                },
                {
                    filename = path_main .. "graficos/Blocos/drive.png",
                    height = 128,
                    shift = { 0.3125, 0.203125 },
                    priority = "extra-high",
                    width = 128,
                    draw_as_shadow = true
                }
            }
        },
        close_sound = {
            {
                filename = "__base__/sound/machine-close.ogg",
                volume = 0.5
            }
        },
        open_sound = {
            {
                filename = "__base__/sound/machine-open.ogg",
                volume = 0.5
            }
        },
    }
})
LUISDASARTIMANHAS commented 1 year ago

Frame 1

I was thinking about that

bahrmichael commented 1 year ago

True, if we can't find the root cause we need to add a vertical image.

bahrmichael commented 1 year ago
Screenshot 2023-10-12 at 08 45 51

Problem happened again in editor mode.