[2.0.60] Unloaded stomper-corpse variations (multilayered problem) + Solution

Post your bugs and problems so we can fix them.
Ingo-Igel
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Nov 03, 2024 7:01 pm
Contact:

[2.0.60] Unloaded stomper-corpse variations (multilayered problem) + Solution

Post by Ingo-Igel »

UPDATE [2.0.65]:

Update 2.0.65 has changed the situation.
Only the following two points remain from the original bug report:
  • missing stomper-corpse-effect-map (stomper/water_reflection/pictures)
    • stomper-corpse-1.png ---> ???
    • stomper-corpse-2.png ---> stomper-corpse-effect-map-1.png
    • stomper-corpse-3.png ---> stomper-corpse-effect-map-2.png
  • stomper/decay_animation/frame_count is 15, not 16. The frame count of 15 causes the last frame of the animation to be omitted.
OLD:

Even though they are defined in enemies.lua, stomper-corpse-1.png and stomper-corpse-2.png are not loaded as variations and are not displayed in the game.
Only stomper-corpse-3.png is loaded and used in the game.

Factorio\data\space-age\prototypes\entity\enemies.lua (original Code):

Code: Select all

{
      type = "corpse",
      name = prefix .. "stomper-corpse",
      icon = stomper_graphics_definitions.icon,
      flags = {"placeable-neutral", "not-on-map"},
      hidden_in_factoriopedia = true,
      subgroup = "corpses",
      final_render_layer = "corpse",
      --animation_render_layer = "entity",
      order = "a-l-a",
      selection_box = {{-3, -3}, {3, 3}},
      collision_box = {{-2, -2}, {2, 2}},
      tile_width = 3,
      tile_height = 3,
      selectable_in_game = false,
      time_before_removed = 60 * 60,
      remove_on_tile_placement = true,
      decay_frame_transition_duration = 50,
      use_decay_layer = true,
      water_reflection =
      {
        pictures =
        --for some reason these load only the 2nd variant of corpses, so that variant is prioritised for water reflections
        {
          {
            filename = "__space-age__/graphics/entity/stomper/stomper-corpse-effect-map-2.png",
            width = 189,
            height = 134,
            shift = util.by_pixel(-5,0),
            --frame_count = 1,
            scale = 0.4 * 4 * stomper_scale,
            usage = "player"
          },
          {
            filename = "__space-age__/graphics/entity/stomper/stomper-corpse-effect-map-1.png",
            width = 189,
            height = 134,
            shift = util.by_pixel(0,0),
            --frame_count = 1,
            scale = 0.4 * 4 * stomper_scale,
            usage = "player"
          },

        }
      },
    animation = {
      layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
      },
      layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
    },
      layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
      }
    },
      decay_animation ={
        layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1",
          {
            frame_count = 15,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1-mask",
          {
            frame_count = 15,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        },
        layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2",
          {
            frame_count = 15,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2-mask",
          {
            frame_count = 15,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        },
        layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3",
          {
            frame_count = 15,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3-mask",
          {
            frame_count = 15,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        }

      }
    },
As you commented, only the second variant is loaded.

Code: Select all

--for some reason these load only the 2nd variant of corpses, so that variant is prioritised for water reflections
Actually, the third variant. More on that later.

The key issue here is that some brackets are missing. The individual "layers" must be placed in their own set of curly brackets, as follows:

Code: Select all

animation = {
        {
                layers= {...}
        },
        {
                layers= {...}
        },
        {
                layers= {...}
        }
},
decay_animation ={
        {
                layers= {...}
        },
        {
                layers= {...}
        },
        {
                layers= {...}
        }
},
Caution is advised at this point, as adding the curly brackets is not the final solution.
There are three additional problems here:
  1. There are three variants of the Stomper Corpse, but only two Stomper Corpse Effect Maps.
  2. The stomper corpse and stomper corpse effect map numbering does not match.
    • stomper-corpse-1.png ---> ???
    • stomper-corpse-2.png ---> stomper-corpse-effect-map-1.png
    • stomper-corpse-3.png ---> stomper-corpse-effect-map-2.png
  3. The "stomper-corpse-1.png" texture does not match the "stomper-corpse-1.lua" and "stomper-corpse-1-mask.png" files, so it cannot be loaded.
    See:viewtopic.php?t=130099
As I understand it, the textures need to be corrected first.
  1. Either delete the incorrect, non-functioning "stomper-corpse-1.png" file and reduce the counters of the other two files ("stomper-corpse-2.png" and "stomper-corpse-3.png") by one.
  2. Alternatively, you can repair the broken "stomper-corpse-1.png" and add the missing stomper-corpse-effect-map. In this case, the names must also be adjusted to correspond.
The code should look like this in the first case:

Code: Select all

{
      type = "corpse",
      name = prefix .. "stomper-corpse",
      icon = stomper_graphics_definitions.icon,
      flags = {"placeable-neutral", "not-on-map"},
      hidden_in_factoriopedia = true,
      subgroup = "corpses",
      final_render_layer = "corpse",
      --animation_render_layer = "entity",
      order = "a-l-a",
      selection_box = {{-3, -3}, {3, 3}},
      collision_box = {{-2, -2}, {2, 2}},
      tile_width = 3,
      tile_height = 3,
      selectable_in_game = false,
      time_before_removed = 60 * 60,
      remove_on_tile_placement = true,
      decay_frame_transition_duration = 50,
      use_decay_layer = true,
      water_reflection =
      {
        pictures =
        {
          {
            filename = "__space-age__/graphics/entity/stomper/stomper-corpse-effect-map-1.png",
            width = 189,
            height = 134,
            shift = util.by_pixel(-5,0),
            --frame_count = 1,
            scale = 0.4 * 4 * stomper_scale,
            usage = "player"
          },
          {
            filename = "__space-age__/graphics/entity/stomper/stomper-corpse-effect-map-2.png",
            width = 189,
            height = 134,
            shift = util.by_pixel(0,0),
            --frame_count = 1,
            scale = 0.4 * 4 * stomper_scale,
            usage = "player"
          },

        }
      },
    animation = {
      {layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
    }},
      {layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
      }
    }},
      decay_animation ={
        {layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1-mask",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        }},
        {layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2-mask",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        }}
      }
    },
Or like this in the second case.:

Code: Select all

    {
      type = "corpse",
      name = prefix .. "stomper-corpse",
      icon = stomper_graphics_definitions.icon,
      flags = {"placeable-neutral", "not-on-map"},
      hidden_in_factoriopedia = true,
      subgroup = "corpses",
      final_render_layer = "corpse",
      --animation_render_layer = "entity",
      order = "a-l-a",
      selection_box = {{-3, -3}, {3, 3}},
      collision_box = {{-2, -2}, {2, 2}},
      tile_width = 3,
      tile_height = 3,
      selectable_in_game = false,
      time_before_removed = 60 * 60,
      remove_on_tile_placement = true,
      decay_frame_transition_duration = 50,
      use_decay_layer = true,
      water_reflection =
      {
        pictures =
        {
          {
            filename = "__space-age__/graphics/entity/stomper/stomper-corpse-effect-map-1.png",
            width = 189,
            height = 134,
            shift = util.by_pixel(-5,0),
            --frame_count = 1,
            scale = 0.4 * 4 * stomper_scale,
            usage = "player"
          },
          {
            filename = "__space-age__/graphics/entity/stomper/stomper-corpse-effect-map-2.png",
            width = 189,
            height = 134,
            shift = util.by_pixel(0,0),
            --frame_count = 1,
            scale = 0.4 * 4 * stomper_scale,
            usage = "player"
          },
                    {
            filename = "__space-age__/graphics/entity/stomper/stomper-corpse-effect-map-3.png",
            width = 189,
            height = 134,
            shift = util.by_pixel(0,0),
            --frame_count = 1,
            scale = 0.4 * 4 * stomper_scale,
            usage = "player"
          }
        }
      },
    animation = {
      {layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
      }},
      {layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
    }},
      {layers = {
        util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3",
        {
          frame_count = 1,
          scale = 0.4 * stomper_scale,
          shift = util.by_pixel(0, 0),
          direction_count = 1,
          surface = "gleba",
          usage = "enemy"
        }
      ),
      util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3-mask",
      {
        frame_count = 1,
        scale = 0.4 * stomper_scale,
        shift = util.by_pixel(0, 0),
        direction_count = 1,
        tint = tint_mask,
        tint_as_overlay = true,
        surface = "gleba",
        usage = "enemy"
      }),
      }
    }},
      decay_animation ={
        {layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-1-mask",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        }},
        {layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-2-mask",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        }},
        {layers ={
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
          util.sprite_load("__space-age__/graphics/entity/stomper/stomper-corpse-3-mask",
          {
            frame_count = 16,
                        scale = 0.4 * stomper_scale,
            shift = util.by_pixel(0, 0),
            direction_count = 1,
            tint = tint_mask,
            tint_as_overlay = true,
            flags = {"corpse-decay"},
            surface = "gleba",
            usage = "corpse-decay"
          }),
        }}
      }
    },
In my examples, I also increased the decay_animation/frame_count from 15 to 16, as otherwise the last decay frame would be omitted.

It's likely that my "shift = util.by_pixel(XX, XX)" entries are incorrect and need to be adjusted.
Post Reply

Return to “Bug Reports”