Destroy Building on Pick-up/Mine

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Destroy Building on Pick-up/Mine

Post by TheSAguy »

I have a building in my mod, that I feel is very OP. I was thinking that I could make it that, once placed, it could not be moved. If you did move it, it would be destroyed.

I was able to do this by changing the "minable" line

minable = {hardness = 0.2, mining_time = 0.5, result = "AlienControlStation"},
to
minable = {hardness = 0.2, mining_time = 0.5, result = "stone-brick"},

So now, when picked-up I get a brick and not the station anymore.

I was wondering, is there a way to get a warning message letting you know it's going to be destroyed?
Can I say how many items I get back? Like 50 bricks, or bricks and something else?

Any other thoughts how to handle this?

Thanks.
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Destroy Building on Pick-up/Mine

Post by ratchetfreak »

or make it non-minable so you need to shoot it to destroy it.

if you take a gun to your building you know you are not getting it back.
ajranney
Inserter
Inserter
Posts: 30
Joined: Mon May 25, 2015 4:44 am
Contact:

Re: Destroy Building on Pick-up/Mine

Post by ajranney »

If you make hardness a large enough value it cannot be mined. This is based on the power of the tool vs the hardness of the object. Mods may allow more powerful tools. When the hardness is larger than the tools power it is not able to be mined.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14264
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Destroy Building on Pick-up/Mine

Post by Rseding91 »

If you don't want the entity to be minable just exclude the minable property from the prototype.

If you want it to mine into multiple items define results instead of result.
If you want to get ahold of me I'm almost always on Discord.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Destroy Building on Pick-up/Mine

Post by TheSAguy »

Rseding91 wrote:If you don't want the entity to be minable just exclude the minable property from the prototype.

If you want it to mine into multiple items define results instead of result.
Thanks Rseding91, I did not know that. My solution was to create an expensive intermediary item and have that the result. So you'd get most back, but lose, in my case the alien artifacts used to create the item.
Post Reply

Return to “Modding help”