[0.9.2] car-type sprite sheet renders fully transparent

This subforum contains all the issues which we already resolved.
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

[0.9.2] car-type sprite sheet renders fully transparent

Post by sparr »

I am trying to make a type="car" entity and use the attached sprite sheet. I have made an exact copy of the "car" entity and changed only the pictures attribute as follows:

Code: Select all

    pictures =
    {
      filename = "__im-on-a-boat__/graphics/entity/raft-sheet.png",
      line_length = 8,
      frame_width = 48,
      frame_height = 48,
      shift={0.5, 0},
      axially_symmetrical = false,
      direction_count = 64
    },
The entity is completely invisible in-game :( I fear that I've done something wrong related to the alpha channel of the image.
Attachments
raft-sheet.png
raft-sheet.png (57.12 KiB) Viewed 4342 times
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.9.2] car-type sprite sheet renders fully transparent

Post by kovarex »

Hello, the picture seems to be fine as well as the definition, but maybe there is some other problem.
Can you select it?
Or you can provide the code for the whole entity so I can inspect it.
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [0.9.2] car-type sprite sheet renders fully transparent

Post by sparr »

Here is the whole entity. It is literally a copy of the car entity with the name/images changed. If I use the car's pictures then it works fine. If I use my own pictures section then everything works except the sprites are invisible.

Code: Select all

  {
    type = "car",
    name = "raft",
    icon = "__im-on-a-boat__/graphics/icons/raft.png",
    flags = {"pushable", "placeable-neutral", "player-creation"},
    minable = {mining_time = 1, result = "raft"},
    max_health = 500,
    corpse = "medium-remnants",
    resistances = 
    {
      {
        type = "fire",
        percent = 50
      }
    },
    collision_box = {{-0.7, -1}, {0.7, 1}},
    selection_box = {{-0.7, -1}, {0.7, 1}},
    acceleration_per_energy = 0.000001,
    breaking_speed = 0.01,
    burner =
    {
      effectivity = 1,
      fuel_inventory_size = 1,
      smoke =
      {
        {
          name = "smoke",
          deviation = {0.25, 0.25},
          frequency = 50,
          position = {0, 1.5},
          slow_down_factor = 0.9,
          starting_frame = 3,
          starting_frame_deviation = 5,
          starting_frame_speed = 0,
          starting_frame_speed_deviation = 5
        }
      }
    },
    consumption = "600kW",
    friction = 0.02,
    light =
    {
      {
        type = "oriented",
        minimum_darkness = 0.3,
        picture =
        {
          filename = "__core__/graphics/light-cone.png",
          priority = "medium",
          scale = 2,
          width = 200,
          height = 200
        },
        shift = {-0.6, -14},
        size = 2,
        intensity = 0.6
      },
      {
        type = "oriented",
        minimum_darkness = 0.3,
        picture =
        {
          filename = "__core__/graphics/light-cone.png",
          priority = "medium",
          scale = 2,
          width = 200,
          height = 200
        },
        shift = {0.6, -14},
        size = 2,
        intensity = 0.6
      }
    },
    -- pictures =
    -- {
    --   filename = "__base__/graphics/entity/car/car-sheet.png",
    --   line_length = 8,
    --   frame_width = 130,
    --   frame_height = 93,
    --   shift={0.5, 0},
    --   axially_symmetrical = false,
    --   direction_count = 64
    -- },
    pictures =
    {
      filename = "__im-on-a-boat__/graphics/entity/raft-sheet.png",
      line_length = 8,
      frame_width = 48,
      frame_height = 48,
      shift={0.5, 0},
      axially_symmetrical = false,
      direction_count = 64
    },
    rotation_speed = 0.015,
    weight = 50,
    inventory_size = 80
  },
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.9.2] car-type sprite sheet renders fully transparent

Post by slpwnd »

I tried it with your spritesheet and the code for the entity you supplied and it all works fine. I have the raft in the game with the provisional sprites.

I didn't really change anything, just added an item for the raft so I can place it easily. Could you try to delete your crop cache file (crop-cache.dat in the root of Factorio)? Kovarex has a good point - can you select the entity?
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [0.9.2] car-type sprite sheet renders fully transparent

Post by sparr »

slpwnd wrote:I tried it with your spritesheet and the code for the entity you supplied and it all works fine. I have the raft in the game with the provisional sprites.

I didn't really change anything, just added an item for the raft so I can place it easily. Could you try to delete your crop cache file (crop-cache.dat in the root of Factorio)? Kovarex has a good point - can you select the entity?
I will try deleting the crop cache file (this is the second time that has been suggested, for different issues... maybe management of that file is the bug?).

The entity works completely, for selecting and entering and driving and managing the trunk. It's just invisible.
sparr
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: [0.9.2] car-type sprite sheet renders fully transparent

Post by sparr »

deleting crop-cache.dat resolved the problem
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.9.2] car-type sprite sheet renders fully transparent

Post by slpwnd »

sparr wrote:deleting crop-cache.dat resolved the problem
That is good to hear. Actually crop cache should be deleted any time a picture is changed in place (its size changes, the content of the picture changes, etc.)
xiphias
Burner Inserter
Burner Inserter
Posts: 13
Joined: Mon Nov 17, 2014 2:55 pm
Contact:

Re: [0.9.2] car-type sprite sheet renders fully transparent

Post by xiphias »

I know the thread is solved, but I have the same problem with a sprite I have created.

I followed Yuoki's tutorial (https://forums.factorio.com/forum/vie ... =15&t=8755)

I changed the base sprite for the stone furnace, just to see if I could get it in game, and the stone furnace works like usual, but is invisible!

The fun thing is when I open my sprite in paint, and just saves it as a PNG (which it was from the start), then it works!

I tried deleting the crop-cache.dat with no success.

Anyone have an idea of what it might be? :P

Here are the sprites I made using Maya:
Attachments
stone-furnace-fire.png
stone-furnace-fire.png (33.54 KiB) Viewed 4017 times
stone-furnace.png
stone-furnace.png (3.92 KiB) Viewed 4017 times
Post Reply

Return to “Resolved Problems and Bugs”