Refrigeration

by JanJB99

Use Cryptechnologie to freeze spoilable items increasing their livespan. Unfreezing carries the risk of destroying the item.

Tweaks
11 months ago
2.0
437

g no agricultral science freezing

20 days ago

This is my personal favorite mod for spoilable refrigeration and after a while I noticed that Agricultural Science is absent from the list of freezable Items. in an attempt to fix this i noticed that the "tool" type is absent when collecting all spoilables so it is skipped. in an attempt to fix this I tried adding it manually with this code

local agpack = getFrozenItem(data.raw.tool["agricultural-science-pack"])
agpack.durability = nil
agpack.durability_description_key = nil
agpack.durability_description_value = nil
agpack.factoriopedia_durability_description_key = nil
agpack.infinite = nil

data:extend(agpack)

data:extend(getFreezeRecipe(data.raw.tool["agricultural-science-pack"]))
data:extend(unfreezeRecipes(data.raw.tool["agricultural-science-pack"]))

table.insert(data.raw.technology["refrigeration"].effects,
{
type = "unlock-recipe",
recipe = "freeze_agricultural-science-pack",
})
table.insert(data.raw.technology["refrigeration"].effects,
{
type = "unlock-recipe",
recipe = "unfreeze_agricultural-science-pack",
})

but i keep getting back an "invalid prototype array error"

Failed to load mods: core/lualib/dataloader.lua:18: Invalid prototype array {
color_hint = {},
default_import_location = "gleba",
drop_sound = {},
icons = {},
inventory_move_sound = {},
localised_description = {},
localised_name = {},
name = "frozen_agricultural-science-pack",
order = "i",
pick_sound = {},
random_tint_color = {},
spoil_result = "spoilage",
spoil_ticks = 2160000,
spoil_to = "spoilage",
stack_size = 200,
subgroup = "science-pack",
type = "item",
weight = 1000
}
stack traceback:
[C]: in function 'error'
core/lualib/dataloader.lua:18: in function 'extend'
10x-challenge/data-updates.lua:90: in main chunk

any idea what i am doing wrong or any possibility that the base mod could be changed to add the agricultural science pack as it seems like it should be one of the top things you will want to refrigerate.

New response