[MOD 0.12.0] endless resources

Mods that are directly focused on adding, removing or changing a game-concept to the vanilla game.
You need to rebuilt many things if you remove the mod, but it is still possible to remove it, without completely destroying the game.

[MOD 0.12.0] endless resources

Postby LoSboccacc » Tue Apr 15, 2014 8:40 pm

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
LoSboccacc
Fast Inserter
Fast Inserter
 
Posts: 240
Joined: Wed Feb 20, 2013 9:35 pm

Re: [0.9.x] endless resources

Postby FreeER » Tue Apr 15, 2014 9:35 pm

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).
User avatar
FreeER
Smart Inserter
Smart Inserter
 
Posts: 1335
Joined: Mon Feb 18, 2013 4:26 am
Location: Baytown, Tx, USA

Re: [0.9.x] endless resources

Postby LoSboccacc » Sat Apr 19, 2014 11:55 am

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
LoSboccacc
Fast Inserter
Fast Inserter
 
Posts: 240
Joined: Wed Feb 20, 2013 9:35 pm

Re: [0.9.x] endless resources

Postby filippe999 » Mon May 05, 2014 12:35 pm

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.
filippe999
Long Handed Inserter
Long Handed Inserter
 
Posts: 53
Joined: Sat May 03, 2014 12:45 pm

Re: [0.9.x] endless resources

Postby BurnHard » Mon May 05, 2014 12:42 pm

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: 514
Joined: Mon Oct 21, 2013 5:08 pm

Re: [0.9.x] endless resources

Postby BurnHard » Thu May 08, 2014 4:45 pm

Playing with it 16 hours now, seems to be balanced... It doesn't feel "cheaty" because you really have to expand nevertheless.
BurnHard
Filter Inserter
Filter Inserter
 
Posts: 514
Joined: Mon Oct 21, 2013 5:08 pm

Re: [0.9.x] endless resources

Postby LoSboccacc » Sat May 10, 2014 6:42 pm

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

edit:
link updated!
LoSboccacc
Fast Inserter
Fast Inserter
 
Posts: 240
Joined: Wed Feb 20, 2013 9:35 pm

Re: [0.9.x] endless resources

Postby CorrettoSambuca » Thu Jun 19, 2014 1:52 pm

Would be interesting if it actually made all resources really infinite, oil included...
Option maybe? or different mod altogether?
User avatar
CorrettoSambuca
Long Handed Inserter
Long Handed Inserter
 
Posts: 55
Joined: Sun May 04, 2014 9:29 am
Location: Italy

Re: [0.9.x] endless resources

Postby bobingabout » Thu Jun 19, 2014 3:35 pm

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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
 
Posts: 3470
Joined: Fri May 09, 2014 1:01 pm

Re: [0.9.x] endless resources

Postby CorrettoSambuca » Thu Jun 19, 2014 3:44 pm

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
CorrettoSambuca
Long Handed Inserter
Long Handed Inserter
 
Posts: 55
Joined: Sun May 04, 2014 9:29 am
Location: Italy

Re: [0.9.x] endless resources

Postby bobingabout » Fri Jun 20, 2014 7:44 am

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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
 
Posts: 3470
Joined: Fri May 09, 2014 1:01 pm

Re: [0.9.x] endless resources

Postby CorrettoSambuca » Fri Jun 20, 2014 7:52 am

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.
User avatar
CorrettoSambuca
Long Handed Inserter
Long Handed Inserter
 
Posts: 55
Joined: Sun May 04, 2014 9:29 am
Location: Italy

Re: [0.9.x] endless resources

Postby filippe999 » Sun Oct 05, 2014 1:03 pm

does this work on 0.10.12?
filippe999
Long Handed Inserter
Long Handed Inserter
 
Posts: 53
Joined: Sat May 03, 2014 12:45 pm

Re: [0.9.x] endless resources

Postby BurnHard » Sun Oct 05, 2014 5:41 pm

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?
BurnHard
Filter Inserter
Filter Inserter
 
Posts: 514
Joined: Mon Oct 21, 2013 5:08 pm

Re: [0.9.x] endless resources

Postby Twinki » Thu Oct 09, 2014 11:28 am

This does work on 10.12, I've been using it the past week or so.
Twinki
Burner Inserter
Burner Inserter
 
Posts: 13
Joined: Wed Oct 08, 2014 1:10 pm

Re: [0.9.x] endless resources

Postby bobingabout » Wed Oct 15, 2014 12:01 am

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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
 
Posts: 3470
Joined: Fri May 09, 2014 1:01 pm

Re: [0.9.x] endless resources

Postby Chronosfear » Wed Oct 29, 2014 8:08 pm

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
Chronosfear
Burner Inserter
Burner Inserter
 
Posts: 15
Joined: Sat Sep 27, 2014 6:39 am

Re: [0.9.x] endless resources

Postby bobingabout » Wed Oct 29, 2014 11:15 pm

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
User avatar
bobingabout
Smart Inserter
Smart Inserter
 
Posts: 3470
Joined: Fri May 09, 2014 1:01 pm

Re: [0.11.1] endless resources

Postby LoSboccacc » Sun Nov 02, 2014 7:14 pm

updated for 0.11.1
LoSboccacc
Fast Inserter
Fast Inserter
 
Posts: 240
Joined: Wed Feb 20, 2013 9:35 pm

Re: [0.11.1] endless resources

Postby BurnHard » Wed Nov 05, 2014 4:16 pm

many thanks
BurnHard
Filter Inserter
Filter Inserter
 
Posts: 514
Joined: Mon Oct 21, 2013 5:08 pm

Next

Return to Gameplay / Vanilla+

Who is online

Users browsing this forum: No registered users and 1 guest