Changing some ores to infinite

Place to get help with not working mods / modding interface.
alesque
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 11, 2016 2:48 pm
Contact:

Changing some ores to infinite

Post 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) ?
IhanaMies
Inserter
Inserter
Posts: 36
Joined: Thu Mar 17, 2016 10:01 pm
Contact:

Re: Changing some ores to infinite

Post 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
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Changing some ores to infinite

Post 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.
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Changing some ores to infinite

Post by Arch666Angel »

;)
Image
alesque
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 11, 2016 2:48 pm
Contact:

Re: Changing some ores to infinite

Post by alesque »

Thanks for both of your answers, exactly what I was looking for !
Post Reply

Return to “Modding help”