Page 1 of 1

Changing some ores to infinite

Posted: Mon Apr 11, 2016 3:03 pm
by alesque
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 :

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
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) ?

Re: Changing some ores to infinite

Posted: Mon Apr 11, 2016 4:40 pm
by IhanaMies
Currently that's not possible. You could change the amount of ores above 2000 to a very high number which is almost the same as infinite. Though the output stays the same

Re: Changing some ores to infinite

Posted: Mon Apr 11, 2016 5:18 pm
by orzelek
alesque wrote: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 :

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
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) ?
To get effect similar to what you want you need to grab two mods that together work like this:
Angels Infinite Ores link
RSO link
When both are present all ore fields outside of starting area will be composed of mixed finite and infinite ore patches.

Re: Changing some ores to infinite

Posted: Mon Apr 11, 2016 11:06 pm
by Arch666Angel
;)
Image

Re: Changing some ores to infinite

Posted: Sat Apr 16, 2016 4:27 pm
by alesque
Thanks for both of your answers, exactly what I was looking for !