Page 1 of 1

LuaEntity.minable

Posted: Tue May 09, 2017 9:49 pm
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.

Re: LuaEntity.minable

Posted: Tue May 09, 2017 9:54 pm
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

Re: LuaEntity.minable

Posted: Tue May 09, 2017 9:57 pm
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?

Re: LuaEntity.minable

Posted: Tue May 09, 2017 10:01 pm
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.

Re: LuaEntity.minable

Posted: Tue May 09, 2017 10:11 pm
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.