Page 1 of 1

Invisible ghosts..?

Posted: Mon May 08, 2017 11:06 am
by teemu
I tried to create an inserter ghost with the in-game console but it seems to be invisible and in general just not there:

Code: Select all

/c E = game.player.surface.create_entity{name = "entity-ghost", inner_name = "inserter", position = game.player.position, expires = false}
If I, however, use

Code: Select all

E.revive()
then the inserter is "revived" as expected. What's up with this?

Re: Invisible ghosts..?

Posted: Mon May 08, 2017 3:04 pm
by 321freddy
This is because you haven't defined a force for the ghost. The force defaults to enemy and you cannot see ghosts of different forces.
If you do this it should work:

Code: Select all

/c E = game.player.surface.create_entity{name = "entity-ghost", force="player", inner_name = "inserter", position = game.player.position, expires = false}

Re: Invisible ghosts..?

Posted: Mon May 08, 2017 3:40 pm
by teemu
Ah right. That explains. Thanks.