Normal value for resources

Post Reply
orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Normal value for resources

Post by orzelek »

Currently LuaEnityPrototype contains fields for checking if resources is infinite and getting it's minimum value.
It would be good to add also normal value there - it would allow runtime calculation of actual resource %-age that resulting resource will have in infinite mode.

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

Re: Normal value for resources

Post by bobingabout »

I think that's what the maximum tag is for. it doesn't actually set a maximum, thats just the upper limit for the calculation. %age = current value/maximum, so if the maximum was 100, but there was 200 left, you'd have 200%.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Normal value for resources

Post by orzelek »

I haven't seen any use for maximum tag.
It was set in the endless mod but did not affect anything as far as I can tell.
%-age is based solely on normal and minimum values. And normal one is not accessible from LuaEntityPrototype currently.

Maximum neither but I'm not really sure whats the idea behind it.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13223
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Normal value for resources

Post by Rseding91 »

Resource "normal" is RNG based off the world you created. In other words there is no "normal" for a given resource prototype.

You'd need to store the resource amount on chunk generation and use that to determine the age/mined percent of a resource.
If you want to get ahold of me I'm almost always on Discord.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Normal value for resources

Post by orzelek »

There is a normal property for infinite resources. Here it is in oil resource:

Code: Select all

    type = "resource",
    name = "crude-oil",
    icon = "__base__/graphics/icons/crude-oil.png",
    flags = {"placeable-neutral"},
    category = "basic-fluid",
    order="a-b-a",
    infinite = true,
    minimum = 750,
    normal = 7500, 
This is the attribute I'm interested in.
In my test it seemed to work as I described and %-age for infinite resource (and %-age of minimum amount) is calculated from it.

Post Reply

Return to “Implemented mod requests”