[SOLVED] I want to modify the mining_time on trees and rocks

Place to get help with not working mods / modding interface.
Post Reply
Guard13007
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Feb 29, 2016 6:42 am
Contact:

[SOLVED] I want to modify the mining_time on trees and rocks

Post by Guard13007 »

I figured out how to modify the mining_time on resources (which it seems applies to ores, stone, crude_oil, but NOT to trees or rocks).

But I am having difficulty finding where trees and rocks are defined so I can modify them. I looked at data.raw.tile, data.raw.resource, data.raw.recipe (even though I know that one doesn't make sense), and I can't figure it out.
Last edited by Guard13007 on Tue Oct 31, 2017 8:52 pm, edited 1 time in total.

User avatar
Ghoulish
Filter Inserter
Filter Inserter
Posts: 462
Joined: Fri Oct 16, 2015 8:40 am

Re: I want to modify the mining_time on trees and rocks

Post by Ghoulish »

There's a mod called https://mods.factorio.com/mods/zzcorrod ... ee-cutting Fast Tree Cutting, Have a look to see how they achieved it.
See the daily™ struggles with my Factory! :D https://www.twitch.tv/repetitivebeats

Guard13007
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Feb 29, 2016 6:42 am
Contact:

Re: I want to modify the mining_time on trees and rocks

Post by Guard13007 »

Ghoulish wrote:There's a mod called https://mods.factorio.com/mods/zzcorrod ... ee-cutting Fast Tree Cutting, Have a look to see how they achieved it.
Thank you. Turns out for trees it is incredibly simple:

Code: Select all

for _, tree in pairs (data.raw.tree) do
	tree.minable.mining_time = 0.1
end
Now for rocks...

Guard13007
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Feb 29, 2016 6:42 am
Contact:

Re: I want to modify the mining_time on trees and rocks

Post by Guard13007 »

Figured out rocks:

Code: Select all

for name, entity in pairs(data.raw['simple-entity']) do
  if name:find('rock') and entity.minable and entity.minable.mining_time then
    entity.minable.mining_time = entity.minable.mining_time / 2
  end
end

Post Reply

Return to “Modding help”