[0.14.4] [Rseding91] - ghost timer and can_place_entity ghost returns false

Bugs that are actually features.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

[0.14.4] [Rseding91] - ghost timer and can_place_entity ghost returns false

Post by Nexela »

The ghost timer bars(assumption!) cause can_place_entity to return false when checking a ghost entity.

/c game.player.surface.create_entity{name="entity-ghost", inner_name="transport-belt", position={x=0,y=0}, direction=2, force=game.player.force}
/c game.player.print(tostring(game.player.surface.can_place_entity{name="entity-ghost", inner_name="transport-belt", position={x=0,y=1}, direction=2, force=game.player.force})) --returns false, I think the timer is the issue


/c game.player.print(tostring(game.player.surface.can_place_entity{name="entity-ghost", inner_name="transport-belt", position={x=0,y=0}, direction=2, force=game.player.force})) --returns false, expected
/c game.player.print(tostring(game.player.surface.can_place_entity{name="transport-belt", position={x=0,y=1}, direction=2, force=game.player.force})) --returns true, expected it is an empty tile
/c game.player.print(tostring(game.player.surface.can_place_entity{name="transport-belt", position={x=0,y=0}, direction=2, force=game.player.force})) --returns true, expected as you should be able to place over a ghost


Also a question. if the answer is no then it is a bug or a feature request :)
Is it possible to create ghosts without the timer? The same way they appear when shift-clicking to place a ghost or placing a blueprint.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15912
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.14.4] [Rseding91] - ghost timer and can_place_entity ghost returns false

Post by Rseding91 »

The issue is you're asking if you can build at exact tile positions and because you already built a ghost at another position and it corrected the position you gave it you're now checking if you can build a ghost belt half way over another ghost belt and it's telling you: no.

If you adjust you can_build checks to the correct center-of-tile then they all pass.
If you want to get ahold of me I'm almost always on Discord.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.14.4] [Rseding91] - ghost timer and can_place_entity ghost returns false

Post by Nexela »

Thanks for looking into this and for the center of tile check.
Post Reply

Return to “Not a bug”