Page 1 of 5

[MOD 0.12.0] endless resources

Posted: Tue Apr 15, 2014 8:40 pm
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)

Re: [0.9.x] endless resources

Posted: Tue Apr 15, 2014 9:35 pm
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).

Re: [0.9.x] endless resources

Posted: Sat Apr 19, 2014 11:55 am
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

Re: [0.9.x] endless resources

Posted: Mon May 05, 2014 12:35 pm
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.

Re: [0.9.x] endless resources

Posted: Mon May 05, 2014 12:42 pm
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.

Re: [0.9.x] endless resources

Posted: Thu May 08, 2014 4:45 pm
by BurnHard
Playing with it 16 hours now, seems to be balanced... It doesn't feel "cheaty" because you really have to expand nevertheless.

Re: [0.9.x] endless resources

Posted: Sat May 10, 2014 6:42 pm
by LoSboccacc
Link down because dropbox, will fix when I get back.

edit:
link updated!

Re: [0.9.x] endless resources

Posted: Thu Jun 19, 2014 1:52 pm
by CorrettoSambuca
Would be interesting if it actually made all resources really infinite, oil included...
Option maybe? or different mod altogether?

Re: [0.9.x] endless resources

Posted: Thu Jun 19, 2014 3:35 pm
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.

Re: [0.9.x] endless resources

Posted: Thu Jun 19, 2014 3:44 pm
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...

Re: [0.9.x] endless resources

Posted: Fri Jun 20, 2014 7:44 am
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.

Re: [0.9.x] endless resources

Posted: Fri Jun 20, 2014 7:52 am
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.

Re: [0.9.x] endless resources

Posted: Sun Oct 05, 2014 1:03 pm
by filippe999
does this work on 0.10.12?

Re: [0.9.x] endless resources

Posted: Sun Oct 05, 2014 5:41 pm
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?

Re: [0.9.x] endless resources

Posted: Thu Oct 09, 2014 11:28 am
by Twinki
This does work on 10.12, I've been using it the past week or so.

Re: [0.9.x] endless resources

Posted: Wed Oct 15, 2014 12:01 am
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.

Re: [0.9.x] endless resources

Posted: Wed Oct 29, 2014 8:08 pm
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

Re: [0.9.x] endless resources

Posted: Wed Oct 29, 2014 11:15 pm
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

Re: [0.11.1] endless resources

Posted: Sun Nov 02, 2014 7:14 pm
by LoSboccacc
updated for 0.11.1

Re: [0.11.1] endless resources

Posted: Wed Nov 05, 2014 4:16 pm
by BurnHard
many thanks