Page 1 of 1

Changing the "mining time" of Iron ore

Posted: Wed Apr 06, 2016 9:30 pm
by lepe
I want to change the mining speed of Iron ore so that it can be mined faster (per my understanding of the mining formula).
How can this be accomplished?

I've tried a few things in both data.lua and prototypes/items.lua, but none seem to work.
(Though they did add a yellow label to the Iron ore's tooltip with my mod's name, not sure what's that about.)
Here's everything that I've tried:

Code: Select all

data.raw.resource["iron-ore"].autoplace.mining_speed = 1
data.raw.resource["iron-ore"].autoplace["mining-speed"] = 1]
data.raw.resource["iron-ore"].autoplace.speed = 1
data.raw.resource["iron-ore"].mining_speed= 1
data.raw.resource["iron-ore"]["mining-speed"] = 1
data.raw.resource["iron-ore"].speed = 1
Note: My other things in the mod do work successfully, so it's not a problem with mod not working/activating.

Re: Changing the "mining time" of Iron ore

Posted: Wed Apr 06, 2016 9:35 pm
by prg
You're looking for data.raw.resource["iron-ore"].minable.mining_time

Re: Changing the "mining time" of Iron ore

Posted: Wed Apr 06, 2016 9:37 pm
by lepe
prg wrote:You're looking for data.raw.resource["iron-ore"].minable.mining_time
Excellent, that did the trick. Thank you.

Is there a place where I can look up this API?

Re: Changing the "mining time" of Iron ore

Posted: Wed Apr 06, 2016 9:40 pm
by prg
I just had a look through data/base/prototypes/entity/demo-resources.lua and made a guess.

Re: Changing the "mining time" of Iron ore

Posted: Wed Apr 06, 2016 9:43 pm
by lepe
prg wrote:I just had a look through data/base/prototypes/entity/demo-resources.lua and made a guess.
I see. Thanks for your help.