Changing some ores to infinite
Posted: Mon Apr 11, 2016 3:03 pm
Hello,
I'm trying to adapt an already existing mod, "endless resources" to transform only ore tiles that are above a value (let's say 3000) to infinite like oil. The code of the mod is fairly simple, it transform anything that isn't infinite (everything except oil) to an infinite type resource :
From what I have found looking in the forums, data.raw.resource["something"] would reference only a global resource type and would not allow to go through all the ore tiles on the map. Is there a way to have a for loop that could change tiles one by one (changing only those who have 3000+ ores to infinite) ?
I'm trying to adapt an already existing mod, "endless resources" to transform only ore tiles that are above a value (let's say 3000) to infinite like oil. The code of the mod is fairly simple, it transform anything that isn't infinite (everything except oil) to an infinite type resource :
Code: Select all
for k, v in pairs(data.raw.resource) do
if not data.raw.resource[k].infinite then
data.raw.resource[k].infinite = true
data.raw.resource[k].minimum = 175
data.raw.resource[k].normal = 350
end
end