Tile deconstruction and blueprinting

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
mickael9
Fast Inserter
Fast Inserter
Posts: 112
Joined: Mon Mar 14, 2016 4:04 am
Contact:

Tile deconstruction and blueprinting

Post by mickael9 »

It's currently not possible to ask for the deconstruction of specific tiles (or just tiles in an area).
It's also not possible to create a blueprint using LuaItemStack::create_blueprint with only tiles or to refuse to create the blueprint if only tiles are found

Proposal:
  • Add LuaTile::order_deconstruction(force)
  • Add LuaTile::cancel_deconstruction(force)
  • Add LuaTile::to_be_deconstructed()
  • Change LuaSurface::(cancel_)deconstruct_area and LuaItemStack::create_blueprint:
    1. Add always_include_tiles to LuaSurface::(cancel_)deconstruct_area
    2. Add exclude_entities: if true, entities are not included in the blueprint/deconstruct
    3. Add exclude_tiles: similar to exclude_entities but for tiles, ignored if always_include_tiles is true because that would be confusing
Rseding91
Factorio Staff
Factorio Staff
Posts: 15600
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Tile deconstruction and blueprinting

Post by Rseding91 »

For the tile related deconstruction/cancel deconstruction: that's done by checking if their exists a deconstructable tile proxy entity at that tile position.

As for the other ones: you can just check that the blueprint.tiles has/doesn't have something and clear it yourself through the API.
If you want to get ahold of me I'm almost always on Discord.
User avatar
mickael9
Fast Inserter
Fast Inserter
Posts: 112
Joined: Mon Mar 14, 2016 4:04 am
Contact:

Re: Tile deconstruction and blueprinting

Post by mickael9 »

Rseding91 wrote:For the tile related deconstruction/cancel deconstruction: that's done by checking if their exists a deconstructable tile proxy entity at that tile position.
And how would you do that exactly? find_entity doesn't return them. This is what I tried:

Code: Select all

print(game.player.surface.find_entity('deconstructible-tile-proxy', game.player.position)) -- nil (player standing on concrete)
How about just adding always_include_tiles to deconstruct_area() ? (we can always cancel deconstruction on things we don't want deconstructed)
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Tile deconstruction and blueprinting

Post by Nexela »

You have to create the proxy with surface.create_entity at the positions of the tile you want to deconstruct (I think)
\
Rseding91
Factorio Staff
Factorio Staff
Posts: 15600
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Tile deconstruction and blueprinting

Post by Rseding91 »

mickael9 wrote:
Rseding91 wrote:For the tile related deconstruction/cancel deconstruction: that's done by checking if their exists a deconstructable tile proxy entity at that tile position.
And how would you do that exactly? find_entity doesn't return them. This is what I tried:

Code: Select all

print(game.player.surface.find_entity('deconstructible-tile-proxy', game.player.position)) -- nil (player standing on concrete)
How about just adding always_include_tiles to deconstruct_area() ? (we can always cancel deconstruction on things we don't want deconstructed)
find_entity takes an absolute position - which it's extremely unlikely you're standing on the exact spot of the proxy entity.

Use find_entities_filtered and give it a bounding box.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Modding interface requests”