Fridge


Adds a fridge chest that can freeze items in it, slow down the spoil time of it by 20 times. Mom don't need to worry about my agricultural science pack anymore! Just put them into refrigerator! working in progress, feel free to make any pr

Content
2 days ago
2.0
2.42K
Storage

b Crash [Fixed]

21 days ago

Was setting up a new Yumako farm and everything picked up fresh at 100% and kept on the logistic fridge few seconds later it crashes.

Error MainLoop.cpp:1429: Exception at tick 10290721: The mod Fridge (0.0.3) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event Fridge::on_tick (ID 0)
spoil_tick can not be set to longer than the item's normal spoil ticks.
stack traceback:
[C]: in function 'newindex'
__Fridge
/control.lua:79: in function 'check_fridges'
Fridge/control.lua:97: in function <Fridge/control.lua:90>

21 days ago
(updated 21 days ago)

seems the script is updating the spoil rate too fast, technically it increase the spoil tick by 19 tick every 20 tick. but don't know why it increase too much. need some tweaks I will do that today.

think I know, the edge case. the very fresh item may only passed less than 19 ticks of it's spoil ticks, so adding 19 ticks to it causing problem. need a top bound.

21 days ago
(updated 21 days ago)

updated! the game doesn't have the access to item's normal spoil ticks so I just make the fridge start working only for items below 99% spoil percent.

21 days ago

still crashing the moment a 100% item is dropped on the fridge. I have the rate of spoil set to 50% on map creation. Maybe that misses with the math ?

21 days ago
(updated 21 days ago)

Having the same crash using 0.0.5.

In my case a fresh yumako put from the harvester on the fridge will have the crash after a few seconds.

Editing the condition on line 77 of control.lua to <90% (<99% as is) avoids the problem. I'll keep testing, for a more elegant solution

21 days ago

The error occurred when I tried to unload a biter's egg with the manipulator.

3304.619 Error MainLoop.cpp:1429: Exception at tick 17393700: The mod Fridge (0.0.5) caused a non-recoverable error.

Error while running event Fridge::on_tick (ID 0)
spoil_tick can not be set to longer than the item's normal spoil ticks.
stack traceback:
[C]: in function 'newindex'
__Fridge
/control.lua:79: in function 'check_fridges'
Fridge/control.lua:97: in function <Fridge/control.lua:90>

21 days ago

trying to locate the problem, since 19 ticks is just 0.3second, and i believe any spoiling item will have spoil time greater than 30s so making sure firdge only work from 99 percent should solve the problem. give me some time.

21 days ago

okey i know where is the problem, the spoill rate is the percent the item has spoiled, so its starts from 0, let me update it very quick

21 days ago

Having the same crash using 0.0.5.

In my case a fresh yumako put from the harvester on the fridge will have the crash after a few seconds.

Editing the condition on line 77 of control.lua to <90% (<99% as is) avoids the problem. I'll keep testing, for a more elegant solution

hi would you do me a faver by opening the fridge and put your cursor on the item to see it's spoil time, see if it decreases or increases. cause you said it crash after few seconds, it's more sound like the spoil ticks is increasing slowly and hit the upper bound after few seconds. because the spoil tick is updated 3 times a second, if it will crash when putting 100% fresh item, it should crash immedinately.

21 days ago

the latest update should fix the problem. and I still want to make sure everything works as I expected so help me look at if the spoil time increases or decreases. on my computer it works fine, but just in case, I need the data from you guys.

21 days ago

hi would you do me a faver by opening the fridge and put your cursor on the item to see it's spoil time, see if it decreases or increases. cause you said it crash after few seconds, it's more sound like the spoil ticks is increasing slowly and hit the upper bound after few seconds. because the spoil tick is updated 3 times a second, if it will crash when putting 100% fresh item, it should crash immedinately.

I experimented a little while console printing the values of spoil_percent, and the crashes would happen after printing some bogus number (8.6e-05 and the like). Where it came from is beyond me (first opened the documentation for the API today, so I'm getting the hang of it).

Will make some tests with 0.0.6

21 days ago

minus number means the fresh percent is over 100% witch clearly nor right. what I am asking is when you hang your cursor on a item in your back pack or container. you will see a information panel list all its info, and on the bottom there will be a timer shows how long it has till it spoil. and when you put the item in the fridge, ideally you will see the timer starts to slow down (it may jump between two adjacent numbers but eventually it will go down.).
BUT! if yo see the timer numbers goes up, then it is not right and when it hit the upper bond the game will crash.

20 days ago

After the update, behavior is as expected. timer at first happen as normal, and then you see the slowdown (and the flicker).No timer increase tho

It seems resolved. And fast too. thanks!!

For curiosity sake (feel free to ignore this). Is it possible to the same problem still happen to an item with really low spoiltime? Where 19 ticks represent more than 0.5% of the total spoiltime? Made some tests using the bacteria (1m, the lowest spoiltime) and it seems alright. vanilla items are safe

20 days ago

Good to hear, thanks for testing! And for the question, that was calculated, i don't want to loose too much of fridge's ability (if starts working at 90 percent, then it will lost 10 percent of its performance). At first I decide 99 percent, that will be safe for any item with spoil time larger than 30s, and I thought there will be no item with a spoil time less than that. But then I think why not 99.5% then the smallest spoil time will be 1 min, but who will make a item with a spoil time less than 1 min? So I decide to use that. But if anyone has a mod like that in the future, I will adjust the starting position, and also I may just make a setting option in the game so people can adjust it.

New response