veden / RampantArsenal

GNU General Public License v3.0
6 stars 10 forks source link

Need help with one recipe update #13

Closed garrotte13 closed 2 years ago

garrotte13 commented 2 years ago

Hello. Please help with code to update Repair Capsule (the basic one unlocked with Regeneration tech) recipe for Warmonger. I tried this code in data-final-fixes.lua according to Factorio API and discussions in forums, but it can't find the recipe

table.insert( data.raw.recipe["repairCapsule"].normal.ingredients, {type="item", name="biomass", amount=2} )

Tried these too: table.insert( data.raw["recipe"]["repairCapsule"].normal.ingredients, {type="item", name="biomass", amount=2} )

table.insert( data.raw["recipe"]["repairCapsule"].ingredients, {type="item", name="biomass", amount=2} )

Every time the same problem - recipe entity doesn't exist, but RampantArsenal is 100% loaded and initiated.

garrotte13 commented 2 years ago

For example updating Industrial Revolution 2 recipes goes fine. Tried absolutely the same code with RampantArsenal just for a check - it doesn't find recipe entity.

veden commented 2 years ago

data.raw.recipe["repair-capsule-rampant-arsenal"] All of the names in my mods tend to have the mod name at the end and potential the type after the name of the thing.

veden commented 2 years ago

I think you are looking at a variable name and that contains the constructed actual name of the recipe.

veden commented 2 years ago

if you add print(serpent.dump(data.raw.recipe)) in your data-final-fixes.lua all of the recipes will be printed to the console.

garrotte13 commented 2 years ago

Thank you! I still don't understand that magic (unable to find where it is defined repairCapsule = "repair-capsule-rampant-arsenal"), but it really works.