Page 1 of 1

Proper Final Fixes

Posted: Thu Oct 17, 2019 10:08 am
by Claviduck
A master mod cancels one recipe of a soft dependency mod. The recipe does not longer appear in the master mod overwriting technology. How can i easily put that recipe into existence again?

Re: Proper Final Fixes

Posted: Thu Oct 17, 2019 10:21 am
by darkfrei
Set dependency and place your code to the data-final-fixes.lua (or data-updates or data.lua, where the master has changed the prototype:

Code: Select all

data:extend(list_of_prototypes)

Re: Proper Final Fixes

Posted: Thu Oct 17, 2019 11:47 am
by Claviduck
Thank you for your help. But i am too new to programming to understand your advise. Also i did most likely describe the problem not properly.
But i found some code snippet that worked (after i googled the problem). I still do not understand all of it though...
here is the solution:

Code: Select all

if data.raw.recipe["rubber-vulcanised"] then
table.insert(data.raw["technology"]["sulfur-processing"].effects, {type = "unlock-recipe", recipe = "rubber-vulcanised"})
	
end 

Re: Proper Final Fixes

Posted: Thu Oct 17, 2019 12:14 pm
by darkfrei
Claviduck wrote:
Thu Oct 17, 2019 11:47 am
Thank you for your help. But i am too new to programming to understand your advise. Also i did most likely describe the problem not properly.
But i found some code snippet that worked (after i googled the problem). I still do not understand all of it though...
here is the solution:

Code: Select all

if data.raw.recipe["rubber-vulcanised"] then
  table.insert(data.raw["technology"]["sulfur-processing"].effects, {type = "unlock-recipe", recipe = "rubber-vulcanised"})	
end 
It's connection between technology and enabled recipes by this technology.