#Directorio - Factorio Mods
1 messages · Page 1 of 1 (latest)
This is kind of similar to a mod I'm working on! Looks great and I have some questions. Mind if I take a look at your code and *borrow parts of it?
- How does your semi-random proceduralized recipes work?
- Is the procedural recipes the main focus? Or the removal of single input recipes?
feel free! it 'doesnt have a license' (it doesn't stop you from doing anything)
- its some code i botched from my main overhaul, im surprised it even worked
- nope, the main focus and premise is just "no single input/output recipes"
(this is some of the procedural code)
quezeler its not my fault i dont know how to code 
(obligatory /s)
well first of you should fix the indentation, secondly since you're not removing ingredients you dont need new loops each time
Your periodic overhaul mod looks super complex. How's that going?
pretty good tbh, working on 0.7 right now
same answer as above, i will probably refactor it at some point
but if it aint broke
if its on a github it'd be easier to cintribute
i hate the fact you are right 
this is the only other mod i own that has a github repo
yeah those hardcoded recipe overrides are gonna drive mod compatibiltiy into the ground
so why exactly did you have that entire hardcoded list? to avoid the duplicate ingredient issue?
mhm
and probably would need to change all of it to detect the 1-1 recipes by itself instead of some hardcoded ones
i obviously thought about it, but i was surprised i could even get it to procedurally change the ingredients 
shouldn't this just be iron considering pipes are 1:1
because the pipe recipes are still needed, i decided to keep any recipes that uses them
(i did think about it though)
same with walls i suppose?
hm, i think it'd be interesting to know which recipes needed to be hand-coded
--- @param recipe data.RecipePrototype
--- @param ingredient data.IngredientPrototypr
local function add_ingredient(recipe, ingredient)
local ingredients = recipe.ingredients or {}
recipe.ingredients = ingredients
for _, elem in pairs(ingredients) do
if elem.type == ingredient.type and elem.name == ingredient.name then
elem.amount = elem.amount + ingredient.amount
return
end
end
ingredients[#ingredients+1] = ingredient
end