[MOD 0.12.0] endless resources

Topics and discussion about specific mods
LoSboccacc
Filter Inserter
Filter Inserter
Posts: 253
Joined: Wed Feb 20, 2013 9:35 pm
Contact:

[MOD 0.12.0] endless resources

Post by LoSboccacc »

Hi, here is my mod

it makes all resources infinite as oil.
https://www.dropbox.com/s/uyp40my30t8p8 ... 0.zip?dl=0


minimum resources are 0.25 instead of 0.1, makes for one ore mined every 4 mining cycles on average (ui shows 0.3 sec, but yeld is 50% and mining time is 2, so you get 0.25sec).

it is pretty crude; on request I made it to infinite every resource in the resource table, but I will revert to hardcoded values if any conflict arise (never tested with other resources adding mod)
Last edited by ssilk on Sat Aug 22, 2015 10:05 am, edited 5 times in total.
Reason: Changed title to match board rules http://www.factorioforums.com/forum/viewtopic.php?f=89&t=947
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [0.9.x] endless resources

Post by FreeER »

LoSboccacc wrote: it is pretty crude, I think it is incompatible with all other resources mods, because I didn't understand how the other way of modding works (that is, I replaced all the ore with copypasta)
If you are not making any other changes then this should be suitable for making all resources infinite, do note that for it to work properly with other mods then you should have it depend (in info.json) upon the mods that add resources (use a ? (ex: "? F-mod") so that they only load first if they do exist, not actually 'required') without the dependency they may not be run before your mod and in that case their resources will not be in data.raw for you to change:

Code: Select all

for _, resource in ipairs(data.raw.resource) do
    if not resource.infinite then resource.infinite=true end
    if not resource.minimum then resource.minimum=20 end
    if not resource.maximum then resource.maximum=350 end
end
Also note that this checks if it's already infinite (so that resources are not overwritten with different min/max values)

an alternative method would be:

Code: Select all

if data.raw.resource["copper-ore"] then
  if not data.raw.resource["copper-ore"].infinite then data.raw.resource["copper-ore"].infinite=true end
  if not data.raw.resource["copper-ore"].min then data.raw.resource["copper-ore"].min=20 end
  if not data.raw.resource["copper-ore"].max then data.raw.resource["copper-ore"].max=350 end
end
this would allow you to specify different min/max values for certain ores, but also requires you to do them each manually (you could also use if resource.name=="copper-ore" then in the for loop, and then an elseif for the other resources you want to specify manually and then just use an else min=20 and max=350 for anything you don't want to be different (or didn't know about when writing the mod))...I think that's all the useful info I have for this :)

Also, you don't need a dependency of "scenario-pack", there may well be users who download this that have not paid for the scenario pack (and thus wouldn't be able to use your mod without removing the dependency theirselves).
LoSboccacc
Filter Inserter
Filter Inserter
Posts: 253
Joined: Wed Feb 20, 2013 9:35 pm
Contact:

Re: [0.9.x] endless resources

Post by LoSboccacc »

mod updated with the suggested fixes!

same link in the op.

yeld should be a little higher on the low end, allowing actual useful resource patch utilization
filippe999
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Sat May 03, 2014 12:45 pm
Contact:

Re: [0.9.x] endless resources

Post by filippe999 »

Thanks for the mod, its really good to hook-up some high efficiency mining drills to an "empty" vein so you don't overproduce pollution and still able to mine that very tiny bit of ore.
BurnHard
Filter Inserter
Filter Inserter
Posts: 519
Joined: Mon Oct 21, 2013 5:08 pm
Contact:

Re: [0.9.x] endless resources

Post by BurnHard »

BIG THANKS for the mod, I think it is a gread addition to the game. I love bulding big factories and so I never will have to deconstruct large parts due to depleted resources.

I hope the devs try for them themselves and consider to implement it.
BurnHard
Filter Inserter
Filter Inserter
Posts: 519
Joined: Mon Oct 21, 2013 5:08 pm
Contact:

Re: [0.9.x] endless resources

Post by BurnHard »

Playing with it 16 hours now, seems to be balanced... It doesn't feel "cheaty" because you really have to expand nevertheless.
LoSboccacc
Filter Inserter
Filter Inserter
Posts: 253
Joined: Wed Feb 20, 2013 9:35 pm
Contact:

Re: [0.9.x] endless resources

Post by LoSboccacc »

Link down because dropbox, will fix when I get back.

edit:
link updated!
User avatar
CorrettoSambuca
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sun May 04, 2014 9:29 am
Contact:

Re: [0.9.x] endless resources

Post by CorrettoSambuca »

Would be interesting if it actually made all resources really infinite, oil included...
Option maybe? or different mod altogether?
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.9.x] endless resources

Post by bobingabout »

CorrettoSambuca wrote:Would be interesting if it actually made all resources really infinite, oil included...
Option maybe? or different mod altogether?
I think if you set resource.minimum to a stupid high number, like 2 billion, then the resources would never be able to fall below 2 billion(unless they are already below said value), and therefore be infinite.

Though keep in mind that a particularly rich vein would spew out resources really fast.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
CorrettoSambuca
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sun May 04, 2014 9:29 am
Contact:

Re: [0.9.x] endless resources

Post by CorrettoSambuca »

Exactly!
I'd be fine if I could have oil coming out at 1 speed, but constant...
Also I've been playing with some "limitations": for example the miners must be placed only on the ore, so no exploiting a single ore patch with 4 miners...
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.9.x] endless resources

Post by bobingabout »

CorrettoSambuca wrote:Exactly!
I'd be fine if I could have oil coming out at 1 speed, but constant...
Also I've been playing with some "limitations": for example the miners must be placed only on the ore, so no exploiting a single ore patch with 4 miners...
That's actually fairly easy, you reduce the resource seeking range, or whatever the actual tag is, on the electric miner to be 1.5 instead of 2.5, half the tile-width of the structure, and therefore it's tile radius. Since a structure can only be placed where the resource seeking range covers a resource, you have to place the building on top of the resource to mine it.

As for setting it to a minimum speed of 1/s, set minimum to the same value as normal, then a rich field will start at say... 50/s, and slowly depleat untill it hits 1/s, then become infinite.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
User avatar
CorrettoSambuca
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sun May 04, 2014 9:29 am
Contact:

Re: [0.9.x] endless resources

Post by CorrettoSambuca »

What I meant is that the miner has to be above a 3x3 patch of ore, with no clean ground underneath... This makes it so that small patches only allow for two miners at most. Another self-imposed rule is that miners must not touch each other, to further limit the output of bigger ore patches. With the small side-effect of allowing to walk through mining fields, which is otherwise impossible.
filippe999
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Sat May 03, 2014 12:45 pm
Contact:

Re: [0.9.x] endless resources

Post by filippe999 »

does this work on 0.10.12?
BurnHard
Filter Inserter
Filter Inserter
Posts: 519
Joined: Mon Oct 21, 2013 5:08 pm
Contact:

Re: [0.9.x] endless resources

Post by BurnHard »

I had a lot of fun with this mod, seems also quite balanced, but unfortunately not played since a while? Have you just tried activating the mod? Does it produce any error message?
Twinki
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Oct 08, 2014 1:10 pm
Contact:

Re: [0.9.x] endless resources

Post by Twinki »

This does work on 10.12, I've been using it the past week or so.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.9.x] endless resources

Post by bobingabout »

FreeER wrote:

Code: Select all

for _, resource in ipairs(data.raw.resource) do
    if not resource.infinite then resource.infinite=true end
    if not resource.minimum then resource.minimum=20 end
    if not resource.maximum then resource.maximum=350 end
end
I was thinking of implementing a feature such as this as an options in my ore mod, so I tried the code from your sugestion FreeER.

It didn't work.

I'm not so hot on LUA, so I looked up some examples of iterative code.

The problem is that you should be using pairs, not ipairs, replace that keyword, and it works.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Chronosfear
Inserter
Inserter
Posts: 23
Joined: Sat Sep 27, 2014 6:39 am
Contact:

Re: [0.9.x] endless resources

Post by Chronosfear »

Hi ,
most of the time I´m just stalking the forum silently.

But this nice mod forces me to show myself to the world.
I really like it .
Thanks.

But I think it is slightly bugged , cause the % value will very slowly degrade until depletion ,
Oil isn't endless , too <- could be changed by an update of the game, and that's why yours aren't endless ,too.
So they are only extreme amount of resources on a tile , but it's limited.

Maybe it always was like this . I started playing only about a month ago.

kind regards
Chronosfear
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.9.x] endless resources

Post by bobingabout »

I havn't tried this directly, but did add the option to my own mod.
If it is working propperly, resources depleate down to about 0.3/s then don't depleat
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
LoSboccacc
Filter Inserter
Filter Inserter
Posts: 253
Joined: Wed Feb 20, 2013 9:35 pm
Contact:

Re: [0.11.1] endless resources

Post by LoSboccacc »

updated for 0.11.1
BurnHard
Filter Inserter
Filter Inserter
Posts: 519
Joined: Mon Oct 21, 2013 5:08 pm
Contact:

Re: [0.11.1] endless resources

Post by BurnHard »

many thanks
Post Reply

Return to “Mods”