Food Industry (2.0 beta)

by Oceanel

[Warning (!): Mod is still under development, and is not intended for a long game] This mod adds hunger and ways to produce foods and drinks. From grown foods can be obtained effect capsules.

Content
3 years ago
0.16 - 1.1
1.25K
Fluids Manufacturing

b [Fixed] Critical but avoidable

5 years ago

Hi, I experimented with the mod. I have discovered a little bug, its avoidable but happens every time.
So, Eat 1 crafting capsule, then go to the options turn of the calculate for players, then die from train or anything else. Turn on the calculate, when the effect expires ive got this message:

Error while running event FoodIndustry::on_tick (ID 0)
Given value has to be larger than or equal to: -1
stack traceback:
FoodIndustry/prototypes/functions/fi-calculations.lua:519: in function 'effects_vanilla_add_or_remove'
FoodIndustry/prototypes/functions/fi-calculations.lua:461: in function 'effects_remove'
FoodIndustry/prototypes/functions/fi-calculations.lua:568: in function 'effects_time_reduction'
FoodIndustry/control.lua:286: in function <FoodIndustry/control.lua:76>
stack traceback:
[C]: in function 'newindex'
__FoodIndustry
/prototypes/functions/fi-calculations.lua:519: in function 'effects_vanilla_add_or_remove'
FoodIndustry/prototypes/functions/fi-calculations.lua:461: in function 'effects_remove'
FoodIndustry/prototypes/functions/fi-calculations.lua:568: in function 'effects_time_reduction'
FoodIndustry/control.lua:286: in function <FoodIndustry/control.lua:76>

And the other problem is with the food pickers. The electric food picker is simply puts this message when i build it.

Error while running event FoodIndustry::on_built_entity (ID 6)
Passed index is out of range
stack traceback:
FoodIndustry/prototypes/scripts/food-picker.lua:106: in function 'v'
FoodIndustry/control.lua:350: in function 'local_on_added'
FoodIndustry/control.lua:365: in function <FoodIndustry/control.lua:364>
stack traceback:
[C]: in function 'set_filter'
FoodIndustry/prototypes/scripts/food-picker.lua:106: in function 'v'
FoodIndustry/control.lua:350: in function 'local_on_added'
FoodIndustry/control.lua:365: in function <FoodIndustry/control.lua:364>

The other problem is with the food pickers, they are all work at the same time, and if you have a big fruit tree farm with 30+ pickers the ups is drops like 20-30 units in the moment when the pickers are picking fruits from trees.

I hope this was helpful to improve more this mod. Thanks the work btw.

New response