Page 1 of 1

No ghosts for simple-entity

Posted: Sun Aug 21, 2016 5:35 am
by mknejp
I have the following prototypes

Code: Select all

  {
    type = "item",
    name = "foo",
    icon = "__base__/graphics/icons/battery.png",
    flags = {},
    subgroup = "foo-group",
    order = "b",
    place_result = "foo",
    stack_size = 50,
  },
  {
    type = "simple-entity",
    name = "foo",
    icon = "__base__/graphics/icons/battery.png",
    flags = {"placeable-neutral", "not-on-map", "placeable-off-grid", "player-creation"},
    minable = {hardness = 0.1, mining_time = 0.1, result = "foo"},
    max_health = 0,
    picture =
    {
      filename = "__base__/graphics/icons/battery.png",
      priority = "extra-high",
      width = 32,
      height = 32,
    },
    render_layer = "object",
  },
The problem I am running into is that it seems impossible to create ghosts of the simple-entity. Neither via script nor by shift-clicking with the item in hand. However I can place the entity just fine. Unfortunately the error message is not very helpful

Code: Select all

/c game.player.surface.create_entity{name="entity-ghost", inner_name="foo", position=game.player.position, force=game.player.force}

Code: Select all

Cannot execute command. Error: Entity creation of entity-ghost failed stack traceback: [string "game.player.surface.create_entity{name="entit..."].1: in main chunk
Is this a bug or am I doing something wrong?

Re: No ghosts for simple-entity

Posted: Sun Aug 21, 2016 6:13 am
by Rseding91
Simple entity has no force and as such can't be in a ghost.

It simply exists and has health.

Re: No ghosts for simple-entity

Posted: Sun Aug 21, 2016 6:30 am
by mknejp
Then what would be the next best thing to use that has no implied game logic?

Re: No ghosts for simple-entity

Posted: Sun Aug 21, 2016 6:38 am
by Supercheese
mknejp wrote:Then what would be the next best thing to use that has no implied game logic?
Hmm, maybe Wall?