Need help adding a variable to an existing entity
Posted: Tue May 03, 2016 3:21 pm
A redditor requested a mod to make mining give additional resources and I decided to try it and found that just adding the variable count worked.
I've been trying to figure out how to put this in a mod file instead of having to alter the base file but I can't figure out how to add a variable to an existing entity. I've looked at other posts and tried a few variations but none seem to work.
Code: Select all
type = "resource",
name = "iron-ore",
icon = "__base__/graphics/icons/iron-ore.png",
flags = {"placeable-neutral"},
order="a-b-a",
minable =
{
hardness = 0.9,
mining_particle = "iron-ore-particle",
mining_time = 2,
result = "iron-ore",
count = 2
}
Code: Select all
data:extend
data.raw.resource["iron-ore"].mineable = {count = 2}
data.raw.["resource"]["iron-ore"].mineable = {count = 2}
data.raw.["resource"]["iron-ore"].mineable.count = 2}
data.raw.["resource"]["iron-ore"].mineable.insert(count = 2)
data.raw.resource["iron-ore"].mineable = {
hardness = 0.9,
mining_particle = "iron-ore-particle",
mining_time = 2,
result = "iron-ore",
count = 2
}