#Directorio - Factorio Mods

1 messages · Page 1 of 1 (latest)

vast bane
#

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?

  1. How does your semi-random proceduralized recipes work?
  2. Is the procedural recipes the main focus? Or the removal of single input recipes?
gaunt compass
#

feel free! it 'doesnt have a license' (it doesn't stop you from doing anything)

gaunt compass
#

(this is some of the procedural code)

#

quezeler its not my fault i dont know how to code raisedcateyebrow

#

(obligatory /s)

hidden plaza
#

well first of you should fix the indentation, secondly since you're not removing ingredients you dont need new loops each time

vast bane
#

Your periodic overhaul mod looks super complex. How's that going?

gaunt compass
#

pretty good tbh, working on 0.7 right now

gaunt compass
#

but if it aint broke

hidden plaza
#

if its on a github it'd be easier to cintribute

gaunt compass
#

i hate the fact you are right trianglepupper

#

this is the only other mod i own that has a github repo

hidden plaza
#

yeah those hardcoded recipe overrides are gonna drive mod compatibiltiy into the ground

gaunt compass
#

yeah, i knew that going in but trianglepupper

#

such is life

hidden plaza
#

so why exactly did you have that entire hardcoded list? to avoid the duplicate ingredient issue?

gaunt compass
#

mhm

hidden plaza
#

and probably would need to change all of it to detect the 1-1 recipes by itself instead of some hardcoded ones

gaunt compass
#

i obviously thought about it, but i was surprised i could even get it to procedurally change the ingredients trianglepupper

gritty stratus
#

shouldn't this just be iron considering pipes are 1:1

gaunt compass
#

because the pipe recipes are still needed, i decided to keep any recipes that uses them

#

(i did think about it though)

toxic rock
#

same with walls i suppose?

#

hm, i think it'd be interesting to know which recipes needed to be hand-coded

toxic rock
#
--- @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