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.
Normal value for resources
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Normal value for resources
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%.
Re: Normal value for resources
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.
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.
Re: Normal value for resources
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.
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.
Re: Normal value for resources
There is a normal property for infinite resources. Here it is in oil resource:
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.
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,
In my test it seemed to work as I described and %-age for infinite resource (and %-age of minimum amount) is calculated from it.