LuaEntity.minable

Things that already exist in the current mod API
Post Reply
sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

LuaEntity.minable

Post by sparr »

From an actual prototype:

Code: Select all

minable = {hardness = 0.2, mining_time = 0.5, result = "inserter"}
From the API reference:
minable :: boolean [Read-Write]
This was brought to my attention in the new "Simple property requests" thread as an example of what not to request in that thread.

I'd actually like access to entity.minable.result and entity.minable.mining_time, both of which seem like a simple request, and the sort of thing that makes people want access to data.raw.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaEntity.minable

Post by Rseding91 »

That's because an entity can be not-mineable (a boolean on it) even when it has a mineable result. If you want the mineable result you want: http://lua-api.factorio.com/latest/LuaE ... properties
If you want to get ahold of me I'm almost always on Discord.

sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: LuaEntity.minable

Post by sparr »

Oh, that seems great. I'm not sure why it was given as the example in the simple request thread if it's already implemented and was simple originally?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaEntity.minable

Post by Rseding91 »

sparr wrote:Oh, that seems great. I'm not sure why it was given as the example in the simple request thread if it's already implemented and was simple originally?
The example thread is talking about the *results* of mining it: like mining an assembling machine with items in it - all the items + the entity.
If you want to get ahold of me I'm almost always on Discord.

sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: LuaEntity.minable

Post by sparr »

That's not obvious from the way the example is worded. I thought it was really just referring to the minable.result in the prototype.

Post Reply

Return to “Already exists”