Code: Select all
roboport.surface.create_entity{name="entity-ghost", position=belts.position, inner_name=p.name, direction = belts.direction, force=roboport.force, fast_replace=true}
Code: Select all
roboport.surface.create_entity{name="entity-ghost", position=belts.position, inner_name=p.name, direction = belts.direction, force=roboport.force, fast_replace=true}
So what you really need would be contsruction bots to support fast replacing entities,Mylon wrote:I specifically want to emulate the fast_replace behavior when placing by hand, but allow bots to do it.
Currently I create the ghost, and then check the ghost regularly if a bot is standing on it with the item and then do a create_entity call with the ghost.ghost_name, which removes both the original entity and the ghost. It's a weird hack and has some difficulties (namely, catching the old item which gets dripped on the ground) but it works.
Allowing bots to support this behavior natively would improve the performance/feel of this method.