Dectorio - free decorative recipes not working as wanted

Place to get help with not working mods / modding interface.
Post Reply
Dancyspartan
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Nov 12, 2022 10:20 am
Contact:

Dectorio - free decorative recipes not working as wanted

Post by Dancyspartan »

Hi,

I'm trying to modify the mod Dectorio to provide every decoration to be free. Only intended for personal use.
However - I have _zero_ knowledge about .lua or coding in general.
I've so far been able to make the tiles free - located in \prototypes\recipe

- All the recipes for the floorings, walls and decoratives are free by using

Code: Select all

 ingredients = {}, 
The thing that doesn't work is the free recipes in landscaping.lua

The mod seems to gather the recipe ingredients based on the entity it wants to create a recipe for.
I've tried to both set this to zero by:

Code: Select all

table.insert(ingredients, {result.name, result.amount_max * 0})
(multiplying by zero)

When that didn't work I tried to remove the connection to the gatherer entity_ingredients by again setting ingredients = {},

I first ran the mod on my save WITHOUT any modifications done to the source code.
Is it maybe because this recipe generator runs once per tile, and then stores that recipe somewhere I am not aware? Perhaps it is set in the save file itself - and doesn't generate each boot of game/load of save?

I think I could 'get it to work' by disabling the mod all together and reloading and then enabling it again - which I will try now. But more to the point I want to know WHY it behaves like this. Is my hunch correct?

Pi-C
Smart Inserter
Smart Inserter
Posts: 1648
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Dectorio - free decorative recipes not working as wanted

Post by Pi-C »

Dancyspartan wrote:
Sat Nov 12, 2022 10:30 am
The mod seems to gather the recipe ingredients based on the entity it wants to create a recipe for.
I've tried to both set this to zero by:

Code: Select all

table.insert(ingredients, {result.name, result.amount_max * 0})
(multiplying by zero)
This doesn't work because you add new ingredients with amount 0. Instead, you should replace the amount of the ingredients that already are in the table.

Another point of failure is that your mod acts too early, so Dectorio overwrites your changes. Make sure you modify the recipes after Dectorio! If Dectorio changes the recipes in data.lua, modify them in data-updates.lua; if Dectorio changes them in data-updates.lua, put your code into data-final-fixes.lua. If Dectorio makes the changes in data-final-fixes.lua, force it to load (and run) before your mod by adding a dependency on it to info.json. If you do that, you can skip replacing the amounts of each individual ingredient by setting recipe.ingredients to {}.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding help”