No ghosts for simple-entity

Place to post guides, observations, things related to modding that are not mods themselves.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

No ghosts for simple-entity

Post 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?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14912
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: No ghosts for simple-entity

Post by Rseding91 »

Simple entity has no force and as such can't be in a ghost.

It simply exists and has health.
If you want to get ahold of me I'm almost always on Discord.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: No ghosts for simple-entity

Post by mknejp »

Then what would be the next best thing to use that has no implied game logic?
Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: No ghosts for simple-entity

Post by Supercheese »

mknejp wrote:Then what would be the next best thing to use that has no implied game logic?
Hmm, maybe Wall?
Post Reply

Return to “Modding discussion”