[Space Age] Recipes with no category have no recycling recipes
Posted: Sat Nov 23, 2024 2:36 pm
As mentioned in the (long) subject, recipes with no category property don't have recycling recipes. You can test this with my mod Quality Assurance (where every new recipe doesn't have a category). I will fix this in Quality Assurance, so make sure you have the current version as of posting, 1.2.3.
As seen in this image, placing an AMS machine into a recycler (image taken with just QA, Quality and the Base Mod) shows an unlocalised message saying that the machine can't be recycled. Please fix this issue, as the category property is OPTIONAL, and the code to create the AMS machines doesn't opt-out of recycling, or use a category banned from recycling such as chemistry or crafting-with-fluid.
Here is the relevant part of the code, where Machine is the entity the mod is making an AMS version of.
This recipe is later added to data.raw here, near the end of the code:
with AMSMachine being an entity, AMSMachineItem being an item, AMSMachineRecipe being a recipe and AMSMachineTechnology being a technology.
As seen in this image, placing an AMS machine into a recycler (image taken with just QA, Quality and the Base Mod) shows an unlocalised message saying that the machine can't be recycled. Please fix this issue, as the category property is OPTIONAL, and the code to create the AMS machines doesn't opt-out of recycling, or use a category banned from recycling such as chemistry or crafting-with-fluid.
Here is the relevant part of the code, where Machine is the entity the mod is making an AMS version of.
Code: Select all
AMSMachineRecipe = {}
AMSMachineRecipe.name = AMSMachineItem.name
AMSMachineRecipe.type = "recipe"
if Machine.localised_name ~= nil and not Machine.localised_name == {} and not Machine.localised_name == "" then
AMSMachineRecipe.localised_name = {"?", {"ams.name", {"?", {"__ENTITY__" .. Machine.name .. "__"}, Machine.localised_name}}, "ams.fallback-name"}
else
AMSMachineRecipe.localised_name = {"?", {"ams.name", {"__ENTITY__" .. Machine.name .. "__"}}, {"ams.fallback-name"}}
end
if Machine.localised_description ~= nil and not Machine.localised_description == {} and not Machine.localised_description == "" then
AMSMachineRecipe.localised_description = {"?", {"ams.description", {"?", {"__ENTITY__" .. Machine.name .. "__"}, Machine.localised_description}}, "ams.fallback-description"}
else
AMSMachineRecipe.localised_description = {"?", {"ams.description", {"__ENTITY__" .. Machine.name .. "__"}}, {"ams.fallback-description"}}
end
if Machine.MachineItem == nil and Machine.minable ~= nil then
if Machine.minable.result ~= nil and Machine.minable.result ~= "" then
AMSMachineRecipe.ingredients = {{type = "item", name = Machine.minable.result, amount = 1}, {type = "item", name = "steel-plate", amount = 10}, {type = "item", name = "copper-cable", amount = 20}}
else
AMSMachineRecipe.ingredients = {{type = "item", name = "electronic-circuit", amount = 1}, {type = "item", name = "steel-plate", amount = 10}, {type = "item", name = "copper-cable", amount = 20}}
end
else
AMSMachineRecipe.ingredients = {{type = "item", name = Machine.MachineItem, amount = 1}, {type = "item", name = "steel-plate", amount = 10}, {type = "item", name = "copper-cable", amount = 20}}
end
if AMSMachineRecipe.ingredients[1]["name"] == nil then
AMSMachineRecipe.ingredients[1]["name"] = "electronic-circuit"
log("Had to replace ingredient name for \"" .. AMSMachineRecipe.name .. "\"")
end
AMSMachineRecipe.results = {{type = "item", name = AMSMachineItem.name, amount = 1}}
AMSMachineRecipe.enabled = false
Code: Select all
log("Made AMS version of \"" .. Machine.name .. "\".")
data:extend{AMSMachine, AMSMachineItem, AMSMachineRecipe, AMSMachineTechnology}