Hi all,
How would one go about making it so that a recipe can only be crafted in an assembly machine when it doesn't require fluids? Is there a way?
Thanks!
Recipe can only be crafted in assembly machines
Re: Recipe can only be crafted in assembly machines
I'm also having some issues with the following chunk of script
which throws this: "Attempt to index global 'events' (a nil value)"
when starting the game
Code: Select all
script.on_event(events.on_tick, function(event)
if (game.tick % 60) == 0 then
heal_wall()
end
end)
when starting the game
- Ranakastrasz
- Smart Inserter
- Posts: 2179
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Recipe can only be crafted in assembly machines
in overrides
as prototype
as prototype.
Just ripped that from Cartmans electronics overhaul. Should work fine. This is the current version which I have messed with.
Code: Select all
for _, assembler in pairs (data.raw["assembling-machine"]) do
for _, category in pairs (assembler.crafting_categories) do
if category == "crafting" then
table.insert(assembler.crafting_categories,"electronics")
end
end
end
Code: Select all
{
type = "recipe-category",
name = "electronics"
},
Code: Select all
{
type = "recipe", name = "electronic-circuit-3",
icon = "__base__/graphics/icons/electronic-circuit.png",
enabled = false,
category = "electronics",
energy_required = 1.0,--2.0,
ingredients = {
{"prepped-pcb", 1},
{"electronic-components",2}
},
results = {{"electronic-circuit",2}}
},
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Recipe can only be crafted in assembly machines
OK, I'll look into that. Any idea why the events would be throwing null? Did they change the events class?
Re: Recipe can only be crafted in assembly machines
I'm having a hard time finding out how to force technologies to be researched. I've added pre-req techs to some existing technologies, and how I thought it should be done isn't working.
Code: Select all
script.on_load(function()
for _,player in pairs(game.players) do
if player.force.technologies["alien-hybridization1"].researched then
player.force.technologies['alien-bioengineering'].researched = true
player.force.recipes['alien-bioconstruct'].enabled = true
end
end
end)
Re: Recipe can only be crafted in assembly machines
What do you mean when you say it "isn't working"? Are you saying:vedrit wrote:I'm having a hard time finding out how to force technologies to be researched. I've added pre-req techs to some existing technologies, and how I thought it should be done isn't working.
*) You want alien-bioconstruct to require research, but it can be crafted at the beginning of the game
*) You're trying to enable the recipe for alien-bioconstruct when alien-hybridization1 is researched, but the recipe isn't getting enabled?
*) You're trying to make alien-bioengineering become researched when alien-hybridization1 is researched
Re: Recipe can only be crafted in assembly machines
Alien Bio Engineering tech enables the alien bioconstruct and is a prerequisite for alien hybridization 1. I'm trying to check if alien hybridization 1 is already researched to then mark alien bio engineering as researched and enable alien bioconstruct. It's not working in that neither happens.
Edit: Ok, I got it so the recipe will unlock, but is there a way to mark the tech as researched? When I try to use force.technologies['alien-bioengineering'].researched = true I get an error saying that I'm trying to do research before the game has started
Edit: Ok, I got it so the recipe will unlock, but is there a way to mark the tech as researched? When I try to use force.technologies['alien-bioengineering'].researched = true I get an error saying that I'm trying to do research before the game has started